about summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-13 11:31:24 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-14 23:30:37 -0400
commit330ca731e88ec015181c43d92ae8f7c77cf0226a (patch)
tree1e840031c407cd50702ff78d05daca2f28c45c46 /pkgs/stdenv
parentd7160f39bd46e8ee86e95cbaf7a8f3d5685ab30c (diff)
downloadnixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.tar
nixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.tar.gz
nixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.tar.bz2
nixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.tar.lz
nixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.tar.xz
nixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.tar.zst
nixlib-330ca731e88ec015181c43d92ae8f7c77cf0226a.zip
treewide: Get rid of all uses of crossConfig
The hack of using `crossConfig` to enforce stricter handling of
dependencies is replaced with a dedicated `strictDeps` for that purpose.
(Experience has shown that my punning was a terrible idea that made more
difficult and embarrising to teach teach.)

Now that is is clear, a few packages now use `strictDeps`, to fix
various bugs:

 - bintools-wrapper and cc-wrapper
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix5
-rw-r--r--pkgs/stdenv/generic/setup.sh4
2 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 46df958b8396..e108e3f156ac 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -52,7 +52,8 @@ rec {
     # InstallCheck phase
     , doInstallCheck ? false
 
-    , crossConfig ? null
+    , # TODO(@Ericson2314): Make always true and remove
+      strictDeps ? stdenv.hostPlatform != stdenv.buildPlatform
     , meta ? {}
     , passthru ? {}
     , pos ? # position used in error messages and for meta.position
@@ -156,6 +157,8 @@ rec {
           userHook = config.stdenv.userHook or null;
           __ignoreNulls = true;
 
+          inherit strictDeps;
+
           depsBuildBuild              = lib.elemAt (lib.elemAt dependencies 0) 0;
           nativeBuildInputs           = lib.elemAt (lib.elemAt dependencies 0) 1;
           depsBuildTarget             = lib.elemAt (lib.elemAt dependencies 0) 2;
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index d7a4781448ae..bfab19dd9737 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -501,7 +501,7 @@ activatePackage() {
     # the transition, we do include everything in thatcase.
     #
     # TODO(@Ericson2314): Don't special-case native compilation
-    if [[ ( -z "${crossConfig-}" ||  "$hostOffset" -le -1 ) && -d "$pkg/bin" ]]; then
+    if [[ ( -z "${strictDeps-}" ||  "$hostOffset" -le -1 ) && -d "$pkg/bin" ]]; then
         addToSearchPath _PATH "$pkg/bin"
     fi
 
@@ -551,7 +551,7 @@ _addToEnv() {
         for depTargetOffset in "${allPlatOffsets[@]}"; do
             (( "$depHostOffset" <= "$depTargetOffset" )) || continue
             local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"
-            if [[ -z "${crossConfig-}" ]]; then
+            if [[ -z "${strictDeps-}" ]]; then
                 # Apply environment hooks to all packages during native
                 # compilation to ease the transition.
                 #