-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swift-corelibs: set NIX_COREFOUNDATION_RPATH in a hook #234861
Conversation
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.
I don't see how this can fix darwin-to-linux cross. |
The other part is in the stdenv rework that drops setting |
Rely on swift-corefoundation to set this in its hook. That way, it will be dropped from the `extraBuildInputs` during a cross build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question for clarification. Given the rebuilds staging is appropriate I'll try doing a build anyway though but that'll have to be tomorrow.
Result of 1 package built:
|
I'm still testing this. I don't expect issues so feel free to merge if you're confident in the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was finally able to reproduce on the staging commit, not sure what I was doing wrong before.
LGTM
Thank you! I can confirm that this was the final piece of the puzzle in my quest towards bit-for-bit reproducibility: my project now builds the exact same bits across all 4 combinations of Linux/macOS and x86_64/M1. |
@emilazy found a bug in NixOS#234861. Specifically, the hook is not actually applied. e2fsprogs links against darwin.CF, but since it cannot find the framework by rpath, it crashes. Since the hook should always be used, it is copied directly to `nix-support/setup-hook` instead of providing it as an attribute. This preserves dropping the hook in the cross-compilation case while providing it for everything else that needs it. To avoid further churn and due to the complexity of building the stdenv with the hook active, this change required the stdenv rework.
Description of changes
Closes #230870. Thanks to @eliasnaur for the test case and for rasining awareness and to @veprbl for the work done on #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.
Things done
sandbox = true
set 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/
)