-
Notifications
You must be signed in to change notification settings - Fork 13.4k
minor improvements on running miri #140898
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
Conversation
r? @clubby789 rustbot has assigned @clubby789. Use |
I assume Ralf uses this API a lot, it's worth pinging him to make sure he will be aware of this change (especially the second commit as the first one doesn't affect anything on the user side). cc @RalfJung |
I have no idea what the first commit does from a user perspective. The second commit looks good, except for the comment I added. :) |
Yes second commit also lgtm but I'm not sure of what the first is doing 😅 |
Sure. r? bootstrap |
// This compiler runs on the host, we'll just use it for the target. | ||
let target_compiler = builder.compiler(stage, host); | ||
let host_compiler = tool::get_tool_rustc_compiler(builder, target_compiler); | ||
let compiler = builder.compiler(stage, target); |
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.
The test
implementation for Miri
uses (stage, host)
here. Shouldn't it be unified with this change?
Also, could you please explain what this change does? And add a comment to the code to make it easier to understand in the future.
I tried this with ./x run miri --stage 1 --dry-run --host x86_64-unknown-linux-none
.
- On master, the build compiler for
miri
is stage0/-gnu, while the target compiler is stage1/-gnu. - With this PR, the build compiler for
miri
is stage 0/-gnu, while the target compiler is stage1/-none.
So it seems like this changes behavior.
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.
The test implementation for Miri uses (stage, host) here. Shouldn't it be unified with this change?
It's not really specific to Miri, this approach is used in other Rustc tools as well. It's fairly straightforward and I am not sure creating another function would make it any simpler.
Also, could you please explain what this change does? And add a comment to the code to make it easier to understand in the future.
I tried (17d27c9) to make it less complicated. Let me know if it's simpler to understand now.
I tried this with
./x run miri --stage 1 --dry-run --host x86_64-unknown-linux-none
.
- On master, the build compiler for
miri
is stage0/-gnu, while the target compiler is stage1/-gnu.- With this PR, the build compiler for
miri
is stage 0/-gnu, while the target compiler is stage1/-none.So it seems like this changes behavior.
You can use this patch and see that compilers are still the same:
diff --git a/src/bootstrap/src/core/build_steps/run.rs b/src/bootstrap/src/core/build_steps/run.rs
index 6cf88278d79..81d6218ccaa 100644
--- a/src/bootstrap/src/core/build_steps/run.rs
+++ b/src/bootstrap/src/core/build_steps/run.rs
@@ -133,8 +133,12 @@ fn run(self, builder: &Builder<'_>) {
}
let compiler = builder.compiler(stage, target);
+ let host_compiler = tool::get_tool_rustc_compiler(builder, compiler);
let miri_build = builder.ensure(tool::Miri { compiler, target });
+ assert_eq!(miri_build.target_compiler, compiler);
+ assert_eq!(miri_build.build_compiler, host_compiler);
+
// Get a target sysroot for Miri.
let miri_sysroot =
test::Miri::build_miri_sysroot(builder, miri_build.target_compiler, target);
It's just the stage shifting logic is now fully controlled by tool::Miri
. There may be some additional logic handled within tool::Miri
(which are mostly good to have), but the overall outcome should remain the same.
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
@bors r+ |
Rollup of 10 pull requests Successful merges: - #140898 (minor improvements on running miri) - #141392 (Avoid obligation construction dance with query region constraints) - #141431 (Emit dummy open drop for unsafe binder) - #141433 (Properly analyze captures from unsafe binders) - #141439 (Deduplicate dyn compatibility violations due to coercion) - #141449 (further deduplicate ast visitor code) - #141513 (interpret: add allocation parameters to `AllocBytes`) - #141516 (speed up charsearcher for ascii chars) - #141526 (add a dedicated section for compiler environment variables in the unstable book) - #141550 (Fix `unused_braces` lint suggestion when encountering attributes) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #140898 - onur-ozkan:miri-run, r=Kobzol minor improvements on running miri It should be clear from the commit messages when reviewing them one by one.
Rollup of 10 pull requests Successful merges: - rust-lang/rust#140898 (minor improvements on running miri) - rust-lang/rust#141392 (Avoid obligation construction dance with query region constraints) - rust-lang/rust#141431 (Emit dummy open drop for unsafe binder) - rust-lang/rust#141433 (Properly analyze captures from unsafe binders) - rust-lang/rust#141439 (Deduplicate dyn compatibility violations due to coercion) - rust-lang/rust#141449 (further deduplicate ast visitor code) - rust-lang/rust#141513 (interpret: add allocation parameters to `AllocBytes`) - rust-lang/rust#141516 (speed up charsearcher for ascii chars) - rust-lang/rust#141526 (add a dedicated section for compiler environment variables in the unstable book) - rust-lang/rust#141550 (Fix `unused_braces` lint suggestion when encountering attributes) r? `@ghost` `@rustbot` modify labels: rollup
It should be clear from the commit messages when reviewing them one by one.