Skip to content
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

Merged
merged 3 commits into from
May 9, 2020
Merged

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented May 9, 2020

@RalfJung
Copy link
Member Author

RalfJung commented May 9, 2020

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.

@RalfJung RalfJung force-pushed the stage-0 branch 2 times, most recently from 03abe59 to 49a3a86 Compare May 9, 2020 11:38
@RalfJung
Copy link
Member Author

RalfJung commented May 9, 2020

This now works locally, and should also still work during bootstrap.

r? @oli-obk

README.md Outdated Show resolved Hide resolved
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)) {
Copy link
Contributor

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

Copy link
Member Author

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?

@RalfJung
Copy link
Member Author

RalfJung commented May 9, 2020

@bors r+

@bors
Copy link
Contributor

bors commented May 9, 2020

📌 Commit e65d87b has been approved by RalfJung

@bors
Copy link
Contributor

bors commented May 9, 2020

⌛ Testing commit e65d87b with merge 8a6396f...

@bors
Copy link
Contributor

bors commented May 9, 2020

☀️ Test successful - checks-travis, status-appveyor
Approved by: RalfJung
Pushing 8a6396f to master...

@bors bors merged commit 8a6396f into rust-lang:master May 9, 2020
@RalfJung RalfJung deleted the stage-0 branch May 9, 2020 12:33
bors added a commit that referenced this pull request May 10, 2020
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. :)
bors added a commit that referenced this pull request May 10, 2020
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. :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make miri usable as stage 0/1 tool
3 participants