From 983e74ae4e9092a302ba281357e33ae9f32a2024 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 22 May 2018 13:25:35 -0400 Subject: [PATCH 1/2] stdenv: Avoid targetPlatform.isDarwin causing a mass rebuild We want `buildPackages` to be almost the same as `buildPackages.buildPackges`, but that is only true if most packages don't care about the target platform. The commented code however made them all care about whether the target platform was Darwin. --- pkgs/stdenv/generic/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index e9ae54811a2..2eac9e58daa 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -90,9 +90,14 @@ let '' + lib.optionalString hostPlatform.isDarwin '' export NIX_DONT_SET_RPATH=1 export NIX_NO_SELF_RPATH=1 - '' + lib.optionalString targetPlatform.isDarwin '' - export NIX_TARGET_DONT_SET_RPATH=1 - ''; + '' + # TODO this should be uncommented, but it causes stupid mass rebuilds. I + # think the best solution would just be to fixup linux RPATHs so we don't + # need to set `-rpath` anywhere. + # + lib.optionalString targetPlatform.isDarwin '' + # export NIX_TARGET_DONT_SET_RPATH=1 + # '' + ; inherit initialPath shell defaultNativeBuildInputs defaultBuildInputs; From 4ffa8b6125c83d6e49fbe3574edc053db7ea2ec1 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 22 May 2018 17:37:29 -0400 Subject: [PATCH 2/2] binutils: Do not needless redownload sources cascading more rebuilds Unfortunately this is a crude hack that we use the same binutils source everywhere in the bootstrap chain. --- pkgs/development/tools/misc/binutils/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index fb780734bd7..db0908952dc 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -19,10 +19,11 @@ in stdenv.mkDerivation rec { name = targetPrefix + basename; - src = fetchurl { + # HACK to ensure that we preserve source from bootstrap binutils to not rebuild LLVM + src = stdenv.__bootPackages.binutils-unwrapped.src or (fetchurl { url = "mirror://gnu/binutils/${basename}.tar.bz2"; sha256 = "028cklfqaab24glva1ks2aqa1zxa6w6xmc8q34zs1sb7h22dxspg"; - }; + }); patches = [ # Turn on --enable-new-dtags by default to make the linker set