about summary refs log tree commit diff
path: root/pkgs/tools/package-management
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-12-31 19:48:42 +0100
committerFlorian Klink <flokli@flokli.de>2020-12-31 20:06:34 +0100
commit31999436daf18dc4f98559304aa846613dd821bb (patch)
tree2bc4352a5077266debe93fca4eb81f2c9e06b23a /pkgs/tools/package-management
parentd5a113804972fec237c993a0aa79e53aa2041c7a (diff)
downloadnixlib-31999436daf18dc4f98559304aa846613dd821bb.tar
nixlib-31999436daf18dc4f98559304aa846613dd821bb.tar.gz
nixlib-31999436daf18dc4f98559304aa846613dd821bb.tar.bz2
nixlib-31999436daf18dc4f98559304aa846613dd821bb.tar.lz
nixlib-31999436daf18dc4f98559304aa846613dd821bb.tar.xz
nixlib-31999436daf18dc4f98559304aa846613dd821bb.tar.zst
nixlib-31999436daf18dc4f98559304aa846613dd821bb.zip
nix: fix closure bloat on `nix`
The conditional preventing closure bloat unfortunately didn't apply for
the `nix` attribute, which is at 2.3.10 (not 2.4.*, what this did check
for).

Due to the somewhat funny 2.4pre* version strings used for nixUnstable
not being understood by lib.versionOlder, we also need to explicitly add
a check for that.
Diffstat (limited to 'pkgs/tools/package-management')
-rw-r--r--pkgs/tools/package-management/nix/default.nix13
1 files changed, 9 insertions, 4 deletions
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index bfc67ccac632..fbbd0656b26b 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -33,7 +33,6 @@ common =
       version = lib.getVersion name;
 
       is24 = lib.versionAtLeast version "2.4pre";
-      isExactly24 = lib.versionAtLeast version "2.4" && lib.versionOlder version "2.4";
 
       VERSION_SUFFIX = suffix;
 
@@ -93,9 +92,15 @@ common =
             patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
           ''}
         '' +
-        # For Nix 2.4, patch around an issue where the Nix configure step pulls in the
-        # build system's bash and other utilities when cross-compiling
-        lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform && isExactly24) ''
+        # On all versions before c9f51e87057652db0013289a95deffba495b35e7,
+        # released with 2.3.8, we need to patch around an issue where the Nix
+        # configure step pulls in the build system's bash and other utilities
+        # when cross-compiling.
+        lib.optionalString (
+          stdenv.buildPlatform != stdenv.hostPlatform &&
+          (lib.versionOlder "2.3.8" (lib.traceVal version) && !is24)
+          # The additional is24 condition is required as versionOlder doesn't understand nixUnstable version strings
+        ) ''
           mkdir tmp/
           substitute corepkgs/config.nix.in tmp/config.nix.in \
             --subst-var-by bash ${bash}/bin/bash \