about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-08-07 15:59:37 +0200
committerGitHub <noreply@github.com>2024-08-07 15:59:37 +0200
commit37dfe41da0dad98bc240a5b8e5d9874bdb8fd4da (patch)
tree7a0a2ae2fbd1c7f2a2333802d6e2403359c65815 /src
parenta05f187b156f8002b13f4d60665403d2d1fba8b2 (diff)
parent2b584dc777f760803b1164e6a9524369a93e12cf (diff)
downloadrust-37dfe41da0dad98bc240a5b8e5d9874bdb8fd4da.tar.gz
rust-37dfe41da0dad98bc240a5b8e5d9874bdb8fd4da.zip
Rollup merge of #128683 - RalfJung:miri-ui-test-deps, r=onur-ozkan
bootstrap: clear miri's ui test deps when rustc changes

`@onur-ozkan` I hope this makes sense... it's quite hard to test this, but it did at least cause one rebuild of the right files for me, and then it doesn't seem to keep rebuilding, so at first sight this look at least better than the status quo.
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/src/core/build_steps/test.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index c40aa718e7c..597d7733abe 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -520,6 +520,14 @@ impl Step for Miri {
         builder.ensure(compile::Std::new(target_compiler, host));
         let host_sysroot = builder.sysroot(target_compiler);
 
+        // Miri has its own "target dir" for ui test dependencies. Make sure it gets cleared
+        // properly when rustc changes. Similar to `Builder::cargo`, we skip this in dry runs to
+        // make sure the relevant compiler has been set up properly.
+        if !builder.config.dry_run() {
+            let ui_test_dep_dir = builder.stage_out(host_compiler, Mode::ToolStd).join("miri_ui");
+            builder.clear_if_dirty(&ui_test_dep_dir, &builder.rustc(host_compiler));
+        }
+
         // Run `cargo test`.
         // This is with the Miri crate, so it uses the host compiler.
         let mut cargo = tool::prepare_tool_cargo(