summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Ericson <mail@JohnEricson.me>2018-09-04 01:29:24 -0400
committerGitHub <noreply@github.com>2018-09-04 01:29:24 -0400
commitd62e62e6a8ed8989167accf53736a169f2e3dac0 (patch)
tree0300605ea8729b48a2fa04b6692c54c1dce29848
parentd7c0d9a7f83b7f80e08888c040ea8a2ab7ca5f71 (diff)
parent06cd7c15a3f2d990316b8c685226d8155f0304cf (diff)
downloadnixlib-d62e62e6a8ed8989167accf53736a169f2e3dac0.tar
nixlib-d62e62e6a8ed8989167accf53736a169f2e3dac0.tar.gz
nixlib-d62e62e6a8ed8989167accf53736a169f2e3dac0.tar.bz2
nixlib-d62e62e6a8ed8989167accf53736a169f2e3dac0.tar.lz
nixlib-d62e62e6a8ed8989167accf53736a169f2e3dac0.tar.xz
nixlib-d62e62e6a8ed8989167accf53736a169f2e3dac0.tar.zst
nixlib-d62e62e6a8ed8989167accf53736a169f2e3dac0.zip
Merge pull request #46023 from Ericson2314/fix-45993
mkDerivation: Fix cross compilation
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 8af6d0e04008..e1ce3200e8c9 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -187,7 +187,15 @@ rec {
           builder = attrs.realBuilder or stdenv.shell;
           args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)];
           inherit stdenv;
-          inherit (stdenv.hostPlatform) system;
+
+          # The `system` attribute of a derivation has special meaning to Nix.
+          # Derivations set it to choose what sort of machine could be used to
+          # execute the build, The build platform entirely determines this,
+          # indeed more finely than Nix knows or cares about. The `system`
+          # attribute of `buildPlatfom` matches Nix's degree of specificity.
+          # exactly.
+          inherit (stdenv.buildPlatform) system;
+
           userHook = config.stdenv.userHook or null;
           __ignoreNulls = true;