top-level, stdenv: Make `system` and `stdenv.system` describe the hostPlatform.
Intuitively, one cares mainly about the host platform: Platforms differ
in meaningful ways but compilation is morally a pure process and
probably doesn't care, or those difference are already abstracted away.
@Dezgeg also empirically confirmed that > 95% of checks are indeed of
the host platform.
Yet these attributes in the old cross infrastructure were defined to be
the build platform, for expediency. And this was never before changed.
(For native builds build and host coincide, so it isn't clear what the
intention was.)
Fixing this doesn't affect native builds, since again they coincide. It
also doesn't affect cross builds of anything in Nixpkgs, as these are no
longer used. It could affect external cross builds, but I deem that
unlikely as anyone thinking about cross would use more explicit
attributes for clarity, all the more so because the rarity of inspecting
the build platform.
commit773233ca771a359e63328a57216f57fd45092e60
authorJohn Ericson <John.Ericson@Obsidian.Systems>
dateMon 27 Aug 2018, 14:39 (8 years ago)
parente51f736
pkgs/stdenv/generic/default.nix+3
@@ -127,6 +127,9 @@ let
127127 "`stdenv.isArm` is deprecated after 18.03. Please use `stdenv.isAarch32` instead"
128128 hostPlatform.isAarch32;
129129
130+ # The derivation's `system` is `buildPlatform.system`.
131+ inherit (buildPlatform) system;
132+
130133 # Whether we should run paxctl to pax-mark binaries.
131134 needsPax = isLinux;
132135
pkgs/top-level/stage.nix+1−1
@@ -89,7 +89,7 @@ let
8989 targetPlatform = lib.warn
9090 "top-level `targetPlatform` is deprecated since 18.09. Please use `stdenv.targetPlatform`."
9191 super.stdenv.targetPlatform;
92− inherit (super.stdenv.buildPlatform) system;
92+ inherit (super.stdenv.hostPlatform) system;
9393 };
9494
9595 splice = self: super: import ./splice.nix lib self (buildPackages != null);