-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
fix pkgsMusl.rustc #186443
Merged
Merged
fix pkgsMusl.rustc #186443
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yu-re-ka
requested review from
zowoq,
Mic92,
LnL7,
FRidh and
jonringer
as code owners
August 13, 2022 12:45
alyssais
requested changes
Aug 13, 2022
This is both simpler and works in more cases, e.g. for the bootstrap binaries linked against musl libc.
The crt-static option selects if the C runtime is linked dynamically or statically into the resulting binaries. There is a default value of this setting for each platform, but it is not always what we want. For example, musl targets are assumed to always have the C runtime linked statically, but we support both. In practise, this fixes an error in the pkgsMusl.rustc build: > cannot produce dylib for `rustc_driver v0.0.0 (/build/rustc-1.63.0-src/compiler/rustc_driver)` as the target `x86_64-unknown-linux-musl` does not support these crate types
alyssais
reviewed
Aug 13, 2022
It builds!
A build script crashes: > cannot produce dylib for `rustc_driver v0.0.0 (/build/rustc-1.63.0-src/compiler/rustc_driver)` as the target `x86_64-unknown-linux-musl` does not support these crate types
The linked issue was resolved upstream and the `-lgcc` is no longer required since rust-lang/compiler-builtins#377 was merged.
Tell rust if we want our binaries linked statically or dynamically. Otherwise the compiler will always produce statically linked binaries for musl targets, as this is the default.
alyssais
approved these changes
Aug 13, 2022
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.
Commit messages are great now, thanks!
LGTM, but patchelf scares me so I didn't look at those changes too closely. Hopefully somebody else can who's more familiar with it.
Switching from manual patching to AutopatchelfHook looks good to me. |
pyelftools ships a readelf binary for its test suite that is linked against glibc. Replacing this readelf binary with our stdenv version doesn't work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
Note that while the resulting rustc is fully functional, pkgsMusl.cargo is still broken
Parts of this were previously reviewd in #141972
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/
)nixos/doc/manual/md-to-db.sh
to update generated release notes