stdenv/darwin: set NIX_COREFOUNDATION_RPATH via hook#111385
stdenv/darwin: set NIX_COREFOUNDATION_RPATH via hook#111385veprbl wants to merge 1 commit intoNixOS:stagingfrom
Conversation
pkgs/stdenv/darwin/default.nix
Outdated
There was a problem hiding this comment.
The main reason this is set directly in the stdenv is to ensure that any usage of frameworks takes priority. The goal here is to link against the pure version as much as possible, but system frameworks also link against the CoreFoundation framework in which case also linking against the pure build causes problems.
There was a problem hiding this comment.
I think that the ordering might be enforced by extraBuildInputs, but just in case there is a simple bash logic in corefoundation-setup-hook.sh to avoid overriding NIX_COREFOUNDATION_RPATH.
This will unset the variable in the cross stdenv where CF is taken out of extraBuildInputs. This is useful for cross compilation to linux where setting RPATH on glibc will break it in runtime. The hook needs to be turned off during the bootstrapping to prevent unwanted references between the stages.
bc46d34 to
cb5cb29
Compare
|
I marked this as stale due to inactivity. → More info |
|
@eliasnaur Yes, please, use the contents of this PR as you see fit. |
|
Thanks, see #230870. |
|
Great. Let's close this then. |
Closes NixOS#230870. Thanks to @eliasnaur for the test case and for rasining awareness and to @veprbl for the work done on NixOS#111385. This takes a slightly different approach from those two PRs. The hook is set unconditionally. The stdenv bootstrap doesn’t really need CF at all, so setting the hook is harmless. This simplifies things.
Closes NixOS#230870. Thanks to @eliasnaur for the test case and for rasining awareness and to @veprbl for the work done on NixOS#111385. This takes a slightly different approach from those two PRs. The hook is set unconditionally. The stdenv bootstrap doesn’t really need CF at all, so setting the hook is harmless. This simplifies things.
Closes NixOS#230870. Thanks to @eliasnaur for the test case and for rasining awareness and to @veprbl for the work done on NixOS#111385. This takes a slightly different approach from those two PRs. The hook is set unconditionally. The stdenv bootstrap doesn’t really need CF at all, so setting the hook is harmless. This simplifies things.
This will unset the variable in the cross stdenv where CF is taken out
of extraBuildInputs. This is useful for cross compilation to linux
where setting RPATH on glibc will break it in runtime.
The hook needs to be turned off during the bootstrapping to prevent
unwanted references between the stages.
Motivation for this change
Fixes darwin -> gnu64 cross compilation
Closes: #103517
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)cc @Gaelan