-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 sysroot option not being honored across rustc #80933
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
Is there a way to test this? |
It can be tested it by moving the libraries that come with the Rust distribution (including the sanitizer libraries) to a different location, and compiling a program using the -Zsanitizer option (e.g., -Zsanitizer=address). Before the fix, the build fails trying to link the sanitizer libraries from the same location regardless whether sysroot was specified; after the fix, the build succeeds if sysroot is specified to the (sysroot equivalent relative to the) location of the previously moved libraries that come with the Rust distribution and sanitizer libraries. |
@bors r+ Thanks! |
📌 Commit 8c16ad5de78883c2600072ec8d74abace5dd9fe4 has been approved by |
(Approved this even without the test because it seems super convoluted to test for, unlikely to regress, and the change looks correct without much doubt anyway) |
@bors r- The reason this uses the default sysroot instead of |
Uh, using the default sysroot regardless of |
For the motivation behind the current implementation see #65241 (comment). Starting the search in the provided sysroot and then falling back to the default one sound fine to me. |
The job Click to see the possible cause of the failure (guessed by this bot)
|
I've amended my commit to check if the sanitizer library exists in the specified/session sysroot, and if it doesn't exist, use the default sysroot. What do you think? |
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author |
Change link_sanitizer_runtime() to check if the sanitizer library exists in the specified/session sysroot, and if it doesn't exist, use the default sysroot.
@bors r+ Now that it falls back to the old implementation if the prerequisite libraries are not found in the proper sysroot, there should be no regression for xargo/build-std use-cases. |
📌 Commit 7378676 has been approved by |
⌛ Testing commit 7378676 with merge 0d7abce4a48a9ef8907159ca96c1be64e762342e... |
💥 Test timed out |
@bors retry |
…as-schievink Rollup of 14 pull requests Successful merges: - rust-lang#75180 (Implement Error for &(impl Error)) - rust-lang#78578 (Permit mutable references in all const contexts) - rust-lang#79174 (Make std::future a re-export of core::future) - rust-lang#79884 (Replace magic numbers with existing constants) - rust-lang#80855 (Expand assert!(expr, args..) to include $crate for hygiene on 2021.) - rust-lang#80933 (Fix sysroot option not being honored across rustc) - rust-lang#81259 (Replace version_check dependency with own version parsing code) - rust-lang#81264 (Add unstable option to control doctest run directory) - rust-lang#81279 (Small refactor in typeck) - rust-lang#81297 (Don't provide backend_optimization_level query for extern crates) - rust-lang#81302 (Fix rendering of stabilization version for trait implementors) - rust-lang#81310 (Do not mark unit variants as used when in path pattern) - rust-lang#81320 (Make bad shlex parsing a pretty error) - rust-lang#81338 (Clean up `dominators_given_rpo`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Change link_sanitizer_runtime() to check if the sanitizer library exists in the specified/session sysroot, and if it doesn't exist, use the default sysroot. (See #79253.)