Skip to content

Commit 2b584dc

Browse files
committed
bootstrap: clear miri's ui test deps when rustc changes
1 parent 6a2cd0d commit 2b584dc

File tree

1 file changed

+8
-0
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+8
-0
lines changed

src/bootstrap/src/core/build_steps/test.rs

+8
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,14 @@ impl Step for Miri {
520520
builder.ensure(compile::Std::new(target_compiler, host));
521521
let host_sysroot = builder.sysroot(target_compiler);
522522

523+
// Miri has its own "target dir" for ui test dependencies. Make sure it gets cleared
524+
// properly when rustc changes. Similar to `Builder::cargo`, we skip this in dry runs to
525+
// make sure the relevant compiler has been set up properly.
526+
if !builder.config.dry_run() {
527+
let ui_test_dep_dir = builder.stage_out(host_compiler, Mode::ToolStd).join("miri_ui");
528+
builder.clear_if_dirty(&ui_test_dep_dir, &builder.rustc(host_compiler));
529+
}
530+
523531
// Run `cargo test`.
524532
// This is with the Miri crate, so it uses the host compiler.
525533
let mut cargo = tool::prepare_tool_cargo(

0 commit comments

Comments
 (0)