-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat: Expost host and target sysroot to build scripts. #13443
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @weihanglo (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Sorry I don't quite follow. I read through the relevant issues but haven't found any design decision made. Do we have discussions in other places like Zulip I missed? |
Asking because we would like to have design discussions in issue threads, and PRs is for discussing each implementation separately. That would make things a bit easier to follow :) |
Hi, sorry about that! I advised c272 to share the implementation first as the best way to move the discussion forwards. We should have followed the contributor's guide a bit more closely - hope it didn't seem too pushy. Writing the patch fleshed this idea out a bit more in the process, so one of us will share that in a separate feature request issue. |
☔ The latest upstream changes (presumably #13409) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #13872) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (possibly 081d7ba) made this pull request unmergeable. Please resolve the merge conflicts. |
What does this PR try to resolve?
Currently, when using
-Zbuild-std
, Cargo passes a--sysroot
argument down to the relevantrustc
invocations. However, the value of this argument is not exposed to build scripts, so if a build script wishes to mirror therustc
configuration of the host, they must somehow discover the sysroot themselves.This patch exposes the host (
RUSTC_HOST_SYSROOT
) and target (RUSTC_TARGET_SYSROOT
) sysroots to build scripts through additional environment variables.Fixes #7501
Related to rust-lang/wg-cargo-std-aware#50
How should we test and review this PR?
An example build script displaying these environment variables is as follows:
Additional information
N/A