-
Notifications
You must be signed in to change notification settings - Fork 352
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
make Miri work in rustc bootstrap stage 0 #1405
Conversation
Ah... this breaks outside of the rustbuild environment because "miri-as-rustc" uses the wrong sysroot dir... namely something relative to where the binary lives. |
03abe59
to
49a3a86
Compare
This now works locally, and should also still work during bootstrap. r? @oli-obk |
Also while at it, refactor how we pass the default Miri flags
@@ -123,7 +122,47 @@ fn compile_time_sysroot() -> Option<String> { | |||
}) | |||
} | |||
|
|||
/// Execute a compiler with the given CLI arguments and callbacks. | |||
fn run_compiler(mut args: Vec<String>, callbacks: &mut (dyn rustc_driver::Callbacks + Send)) { |
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.
Oh that's a nice convenience function. I wonder if we can upstream the non-sysroot part of it
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.
Yeah I wondered the same actually.
Any proposals for a name, given that rustc_driver::run_compiler
is already taken?
@bors r+ |
📌 Commit e65d87b has been approved by |
☀️ Test successful - checks-travis, status-appveyor |
cargo-miri: never invoke rustc Always go through 'MIRI_BE_RUSTC=1 miri' instead. This is based on @oli-obk's great idea to add a way to make Miri behave like rustc, which already helped us in #1405. Now it means in `cargo-miri` we run *all* crates through the same binary, and use the env var to determine if we compile or interpret them. This makes sure the compiler is consistent. The `rustc` binary of the current toolchain is now not used at all, only the `miri` binary is. In particular this means we can kill the sysroot consistency check. :)
cargo-miri: never invoke rustc Always go through 'MIRI_BE_RUSTC=1 miri' instead. This is based on @oli-obk's great idea to add a way to make Miri behave like rustc, which already helped us in #1405. Now it means in `cargo-miri` we run *all* crates through the same binary, and use the env var to determine if we compile or interpret them. This makes sure the compiler is consistent. The `rustc` binary of the current toolchain is now not used at all, only the `miri` binary is. In particular this means we can kill the sysroot consistency check. :)
Fixes rust-lang/rust#52856