stdenv/darwin: set NIX_COREFOUNDATION_RPATH via hook#230870
stdenv/darwin: set NIX_COREFOUNDATION_RPATH via hook#230870eliasnaur wants to merge 1 commit intoNixOS:stagingfrom
Conversation
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.
|
I’m working on a bump of the Darwin stdenv to LLVM 15 in #229786. As part of that, I’m refactoring the build process and cleaning things up a bit. I made setting Note that I’m not trying to step on the toes of any other PRs, but if the stdenv update results in other issues being resolved, I’d like to identify and address those. |
Great work, thank you! My particular use-case is to build bit-for-bit reproducible disk images for raspberry pi. I wrote a test for a similar problem with $ export MY_NIXPKGS_DIR=...
# before this PR
$ nix build --rebuild --override-input nixpkgs "$MY_NIXPKGS_DIR" -L github:eliasnaur/nix-lib64-rpath 2>&1 |rg NIX_COREFOUNDATION_RPATH
demonstrate-lib64-rpath-armv6l-unknown-linux-musleabihf> NIX_COREFOUNDATION_RPATH: /nix/store/6g3l83hj6j4snkk3y3m2i9yv1i93p914-apple-framework-CoreFoundation-11.0.0/Library/Frameworks
# after this PR
$ nix build --rebuild --override-input nixpkgs "$MY_NIXPKGS_DIR" -L github:eliasnaur/nix-lib64-rpath 2>&1 |rg NIX_COREFOUNDATION_RPATH
demonstrate-lib64-rpath-armv6l-unknown-linux-musleabihf> NIX_COREFOUNDATION_RPATH: Let me know, and I'll close this PR.
This PR is not even mine, and I don't understand the stdenv machinery well. I'm just trying to obtain reproducibility, and if you're doing the hard work, then great! |
|
Thanks for the test. That really helped. The approach I was taking didn’t work. I ended up adding a hook in final |
What a coincidence; I didn't want to burden you with extra work so I just now completed a build with your PR. I reached the same conclusions as you, that the |
|
This is probably a better solution than manual hacks like #196564. |
Yes, we might want to revert things like that as a part of PR with a global fix. |
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.
|
Superseded by #234861. |
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.
This is a updated version of #111385 authored by @veprbl.
CC @LnL7 who reviewed the original PR.
Closes #111385
Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)