-
Notifications
You must be signed in to change notification settings - Fork 197
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
Rust doesn't compile openssl library on MacOSX #2167
Comments
@ineiti I'd suggest running With that, I am able to run Let us know if that does, or does not, work for you? |
@savil Thanks a lot, that solves the problem and it compiles fine now! I did not know about this package, and I did spend 30 minutes on Google with the error message before opening this issue. How could I have discovered this? Some questions:
|
Those are great questions. I think Devbox should do better here, and in particular since this is a bit of an FAQ for Rust with Macs, we should make it Just Work ™️ . Lets leave this task open for a bit. I'll look into it more this week. There are some considerations in my mind:
To your questions:
|
With a simple rust project I'm not able to run
(fresh new mac, very nice test :) ) |
What is the error message when it fails? Also, did you actually install cargo? Because with your devbox.json you only install rustup - look at my |
Error is
|
Adding also |
Ok now it is working, for some reasons I removed |
@savil - Is there a place this information should be added? The is a good idea and will be included? |
A few thoughts:
re: adding the apple frameworks by default to the nixpkgs definition of rustup in MacOS |
After this staging-next cycle, the stdenv in master (and when 24.11 releases) will include a full SDK. It should have all the frameworks needed to build macOS applications and libraries (like OpenSSL). It also propagates libiconv, which should remove the need to conditionally add it for Rust applications. I have some documentation I need to write for the release, but the gist of using a new SDK is you add it as a build input. The SDK uses setup hooks to set the latest one from your inputs plus propagated inputs, so there is no way to accidentally mix them. Edit: for reference, the following SDKs will be available in 24.11: 10.12.2 (default on x86_64-darwin), 10.13.2, 10.14.6, 10.15.6, 11.3 (default on aarch64-darwin), 12.3, 13.3, 14.4, 15.0. The default and minimum version for x86_64-darwin is being updated to match aarch64-darwin for 25.05. They will be updated more regularly to better match the platform’s supported versions. Additionally, Darwin will use clang-19 by default and will(probably) use darwin.ICU and darwin.libpcap by default for icu and libpcap respectively. |
I also wanted to add that source release packages (like libiconv, ICU, and libpcap) have been updated to the source releases for macOS 15. They will be updated as new ones are made available. |
@reckenrode thanks a lot for the update - so I guess I'll just wait for the 24.11 release and won't bother with adding the notes to the rustup nix package. |
What happened?
I have a rust project which uses openssl. Now I would like to have a reproducible build using devbox. But when I use
rustup
from devbox, the compilation fails at linking time.I tried the same repo with
flox
and a locally installed rust, which compiles and runs fine!Steps to reproduce
Clone the repo, start the shell, and compile parts of it:
The final output of the linker is this:
Command
shell
devbox.json
Devbox version
0.11.1
Nix version
nix (Nix) 2.23.0
What system does this bug occur on?
macOS (Apple Silicon)
Debug logs
No response
The text was updated successfully, but these errors were encountered: