From 1810b522d7c69fbc67f05aed4183aa53afffecfd Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Wed, 13 Nov 2024 08:04:55 -0500 Subject: [PATCH 1/2] Revert "stdenv: set NIX_DONT_SET_RPATH_FOR_TARGET on Darwin" This reverts commit 10c87ee2c7661b0e699b270744439b2643aaa43b. --- 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 2cbd2636a463..2cda43d5632f 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -114,9 +114,14 @@ let export NIX_NO_SELF_RPATH=1 '' + lib.optionalString (hostPlatform.isDarwin && hostPlatform.isMacOS) '' export MACOSX_DEPLOYMENT_TARGET=${hostPlatform.darwinMinVersion} - '' + lib.optionalString targetPlatform.isDarwin '' - export NIX_DONT_SET_RPATH_FOR_TARGET=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_DONT_SET_RPATH_FOR_TARGET=1 + # '' + ; inherit initialPath shell defaultNativeBuildInputs defaultBuildInputs; From 719c731df3f1b48570fc1e89d83e27d78ee26b23 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sat, 16 Nov 2024 15:12:39 -0500 Subject: [PATCH 2/2] stdenv: elaborate on nature of mass rebuilds --- pkgs/stdenv/generic/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 2cda43d5632f..9952a6ae0623 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -115,8 +115,11 @@ let '' + lib.optionalString (hostPlatform.isDarwin && hostPlatform.isMacOS) '' export MACOSX_DEPLOYMENT_TARGET=${hostPlatform.darwinMinVersion} '' - # 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 + # TODO this should be uncommented, but it causes stupid mass rebuilds due to + # `pkgsCross.*.buildPackages` not being the same, resulting in cross-compiling + # for a target rebuilding all of `nativeBuildInputs` for that target. + # + # 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_DONT_SET_RPATH_FOR_TARGET=1