-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
cargo: avoid using system curl on darwin #300521
Conversation
Thank you! I'm going to take a closer look at this at some point this week, but it may take me a bit to conduct a proper review, as I'd like to test this on multiple major macOS versions. (My main suspicion is that this may be a Sonoma issue, not a Ventura one as noted in the rust-overlay PR.) |
Sounds good. I'm not on Ventura so I can't comment on that, but I do see it on 14.4.1. |
The last times I built rustc on Ventura in a sandbox, I did not run into this issue, which makes me think it's a Sonoma thing and perhaps the original author just typo'd. |
I'm (finally) going to take some time to look into this either today or tomorrow, extremely sorry about the delay. |
No worries! FWIW I've been using a fork of nixpkgs-unstable with this PR on x86-64-darwin (currently 14.5) and haven't run into any issues. |
I keep running into this -- seeing it currently on nixpkgs/master on 15.0.1 with a
|
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.
This PR should target staging due to the number of rebuilds.
Modern versions of macOS link the system-provided curl library against the system-provided libressl library. On recent versions of macOS, the system libressl library reads from /private/etc/ssl/openssl.cnf. As this path is not included in the default Nix sandbox profile, applications that use the system curl library will report a permission error [1]. This issue affects the bootstrap version of cargo and can be seen while building rustc for darwin with the sandbox enabled [2]. This change works around the sandbox failure by using install_name_tool to patch the cargo binary to use curl provided by Nix, which was the approach used in oxalica/rust-overlay [3]. [1]: NixOS/nix#9625 [2]: https://gist.github.com/al3xtjames/06bf71ceffd745eef20be8ce03b982c5 [3]: oxalica/rust-overlay#149
0f29b34
to
153867a
Compare
Description of changes
Modern versions of macOS link the system-provided curl library against the system-provided libressl library. On recent versions of macOS, the system libressl library reads from
/private/etc/ssl/openssl.cnf
. As this path is not included in the default Nix sandbox profile, applications that use the system curl library will report a permission error.This issue affects the bootstrap version of cargo and can be seen while building rustc for darwin with the sandbox enabled. This change works around the sandbox failure by using
install_name_tool
to patch the cargo binary to use curl provided by Nix, which was the approach used in oxalica/rust-overlay.Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.