summary refs log tree commit diff
path: root/pkgs/stdenv/cross
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2016-11-11 06:34:24 -0800
committerNicolas B. Pierron <nicolas.b.pierron@gmail.com>2016-11-12 20:20:44 +0100
commitf68e16f0235989f11ad7394edf656649c652bef4 (patch)
treefd36bd24f37c23a1d071f33589f3b21d35a1a40a /pkgs/stdenv/cross
parent645e2b55e5605fba878675c7ce12231bbd8fb156 (diff)
downloadnixlib-f68e16f0235989f11ad7394edf656649c652bef4.tar
nixlib-f68e16f0235989f11ad7394edf656649c652bef4.tar.gz
nixlib-f68e16f0235989f11ad7394edf656649c652bef4.tar.bz2
nixlib-f68e16f0235989f11ad7394edf656649c652bef4.tar.lz
nixlib-f68e16f0235989f11ad7394edf656649c652bef4.tar.xz
nixlib-f68e16f0235989f11ad7394edf656649c652bef4.tar.zst
nixlib-f68e16f0235989f11ad7394edf656649c652bef4.zip
top-level: Make cross compiling slightly saner
Removes the weird stdenv cycle used to match the old infrastructure.
It turns out that matching it so precisely is not needed.
Diffstat (limited to 'pkgs/stdenv/cross')
-rw-r--r--pkgs/stdenv/cross/default.nix20
1 files changed, 9 insertions, 11 deletions
diff --git a/pkgs/stdenv/cross/default.nix b/pkgs/stdenv/cross/default.nix
index 93c5a21d9d5a..575692ca0126 100644
--- a/pkgs/stdenv/cross/default.nix
+++ b/pkgs/stdenv/cross/default.nix
@@ -8,24 +8,22 @@ rec {
   };
   vanillaStdenv = (import ../. (args // argClobber // {
     allPackages = args: allPackages (argClobber // args);
-  })).stdenv;
+  })).stdenv // {
+    # Needed elsewhere as a hacky way to pass the target
+    cross = crossSystem;
+  };
 
-  # Yeah this isn't so cleanly just build-time packages yet. Notice the
-  # buildPackages <-> stdenvCross cycle. Yup, it's very weird.
-  #
-  # This works because the derivation used to build `stdenvCross` are in
-  # fact using `forceNativeDrv` to use the `nativeDrv` attribute of the resulting
-  # derivation built with `vanillaStdenv` (second argument of `makeStdenvCross`).
-  #
-  # Eventually, `forceNativeDrv` should be removed and the cycle broken.
+  # For now, this is just used to build the native stdenv. Eventually, it should
+  # be used to build compilers and other such tools targeting the cross
+  # platform. Then, `forceNativeDrv` can be removed.
   buildPackages = allPackages {
     # It's OK to change the built-time dependencies
     allowCustomOverrides = true;
-    bootStdenv = stdenvCross;
+    bootStdenv = vanillaStdenv;
     inherit system platform crossSystem config;
   };
 
   stdenvCross = buildPackages.makeStdenvCross
-    vanillaStdenv crossSystem
+    buildPackages.stdenv crossSystem
     buildPackages.binutilsCross buildPackages.gccCrossStageFinal;
 }