git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit31999436daf18dc4f98559304aa846613dd821bb authorFlorian Klink <flokli@flokli.de> dateThu 31 Dec 2020, 19:48 (6 years ago) parentd5a1138
1 file changed+9−4
pkgs/tools/package-management/nix/default.nix+9−4
pkgs/tools/package-management/nix/default.nix+9−4
@@ -33,7 +33,6 @@ common =
3333 version = lib.getVersion name;
3434
3535 is24 = lib.versionAtLeast version "2.4pre";
36− isExactly24 = lib.versionAtLeast version "2.4" && lib.versionOlder version "2.4";
3736
3837 VERSION_SUFFIX = suffix;
3938
@@ -93,9 +92,15 @@ common =
9392 patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
9493 ''}
9594 '' +
96− # For Nix 2.4, patch around an issue where the Nix configure step pulls in the
97− # build system's bash and other utilities when cross-compiling
98− lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform && isExactly24) ''
95+ # On all versions before c9f51e87057652db0013289a95deffba495b35e7,
96+ # released with 2.3.8, we need to patch around an issue where the Nix
97+ # configure step pulls in the build system's bash and other utilities
98+ # when cross-compiling.
99+ lib.optionalString (
100+ stdenv.buildPlatform != stdenv.hostPlatform &&
101+ (lib.versionOlder "2.3.8" (lib.traceVal version) && !is24)
102+ # The additional is24 condition is required as versionOlder doesn't understand nixUnstable version strings
103+ ) ''
99104 mkdir tmp/
100105 substitute corepkgs/config.nix.in tmp/config.nix.in \
101106 --subst-var-by bash ${bash}/bin/bash \