-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
compiler/rustc_session: fix sysroot detection logic #108376
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
7ad3a2b
to
e53f6f5
Compare
Why is this fix Linux specific? This shouldn't not work on Windows, right? |
Sorry for the late reply.
Yes, although I think #103660 removed this logic to fix certain issues on the Windows platform. |
Which logic? Do you mean |
Sure, will take it r? @ozkanonur |
e53f6f5
to
45df5a5
Compare
This comment has been minimized.
This comment has been minimized.
4ee8694
to
a6245cc
Compare
a6245cc
to
0da3064
Compare
Thank you for the fixes. This looks good to me. I am not sure why one of the pipeline is stuck 🤔 Can you force push to trigger pipelines again? @liushuyu |
... on systems where /usr/lib contains a multi-arch structure
0da3064
to
2186358
Compare
Done. Rebased and force-pushed. |
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.
lgtm
@bors r+ rollup |
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#108376 (compiler/rustc_session: fix sysroot detection logic) - rust-lang#108400 (add llvm cgu instructions stats to perf) - rust-lang#108496 (fix rust-lang#108495, postfix decrement and prefix decrement has no warning) - rust-lang#108505 (Further unify validity intrinsics) - rust-lang#108520 (Small cleanup to `one_bound_for_assoc_type`) - rust-lang#108560 (Some `infer/mod.rs` cleanups) - rust-lang#108563 (Make mailmap more correct) - rust-lang#108564 (Fix `x clean` with specific paths) - rust-lang#108571 (Add contains_key to SortedIndexMultiMap) - rust-lang#108578 (Update Fuchsia platform team members) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This pull request fixes the sysroot detection logic on systems where
/usr/lib
contains a multi-arch structure (e.g. installsrustc_driver
into/usr/lib/x86_64-linux-gnu
folder).This fixes a regression for various Linux systems introduced in #103660. On Debian and Ubuntu systems, the logic in the pull request, as mentioned earlier, will resolve the sysroot to
/usr/lib
, makingrustc --print target-libdir
to return/usr/lib/lib/rustlib/x86_64-unknown-linux-gnu/lib
(notice the extralib
at the beginning).The fix is not very "clean" according to the standard. If you have any suggestions on improving the logic, you are more than welcome to comment below!