wrapRustcWith: allow --sysroot to be overridden#274853
Merged
alyssais merged 2 commits intoNixOS:stagingfrom Dec 19, 2023
Merged
wrapRustcWith: allow --sysroot to be overridden#274853alyssais merged 2 commits intoNixOS:stagingfrom
alyssais merged 2 commits intoNixOS:stagingfrom
Conversation
dblsaiko
approved these changes
Dec 17, 2023
Contributor
There was a problem hiding this comment.
Every day I learn some crazy new bash syntax. :^)
It turns out that unlike a normal Unix program, if the --sysroot option is given more than once, rustc will error rather than using the last value given. Therefore, we need to ensure we only add our default --sysroot argument if one hasn't been given explicitly on the wrapper's command line. This fixes cross compilation of rustc. Closes: NixOS#271736 Fixes: 8b51cdd ("rustc: add a compiler wrapper")
02fd9bd to
1200bc2
Compare
Contributor
This reverts commit e97f8fe. No longer necessary since the rustc wrapper now handles --sysroot correctly.
dblsaiko
approved these changes
Dec 17, 2023
yu-re-ka
approved these changes
Dec 17, 2023
Contributor
yu-re-ka
left a comment
There was a problem hiding this comment.
I have done only end to end tests
Contributor
|
Do you mind if I merge this? |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/rust-cross-compiling-no-std-with-custom-target/39236/3 |
This file contains hidden or 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
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
It turns out that unlike a normal Unix program, if the --sysroot option is given more than once, rustc will error rather than using the last value given. Therefore, we need to ensure we only add our default --sysroot argument if one hasn't been given explicitly on the wrapper's command line.
This fixes cross compilation of rustc.
Closes: #271736
Fixes: 8b51cdd ("rustc: add a compiler wrapper")
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-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.