-
Notifications
You must be signed in to change notification settings - Fork 341
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 build.rs invoking RUSTC to do check builds #2436
Conversation
test-cargo-miri/build.rs
Outdated
@@ -20,4 +20,9 @@ fn main() { | |||
println!("cargo:rerun-if-changed=build.rs"); | |||
println!("cargo:rerun-if-env-changed=MIRITESTVAR"); | |||
println!("cargo:rustc-env=MIRITESTVAR=testval"); | |||
|
|||
// Test that autocfg works. |
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.
Arguably this is testing cargo-miri build script support so having this in test-cargo-miri is the right place IMO.
Oh interesting, this fails in cross-mode. That is probably a problem even before the recent RUSTC changes, but would be nice to find a way to fix it... |
@rustbot author |
Ah, the problem is that it uses the wrong sysroot. That's why we usually forward rustc invocations through cargo-miri -- it adjusts the sysroot. I had to completely redo the way we manage the sysroot for this, but now it should be working. |
this requires a change in sysroot handling: miri driver now requires MIRI_SYSROOT to be set when it is in 'target' mode, rather than relying on `--sysroot` always being present.
Okay this is now quite different from where it started, and also works much better. I have updated the PR title and description accordingly. @rustbot ready |
Oooh you figured out the env var dance with unsetting for recursive cases. I gave up on that. I should make a graph of what invokes what some day... |
@bors r+ |
☀️ Test successful - checks-actions |
This makes the Miri driver, when invokved via the RUSTC env var from inside a build script, behave almost entirely like rustc. I had to redo how we propagate sysroot information for this (which is actually back to how we used to do sysroot propagation many years ago).
Fixes #2431