diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2025-07-13 07:21:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-13 07:21:24 +0200 |
| commit | 2cbd0bc27cc51d985ff625059bcb011976bcd048 (patch) | |
| tree | bfd2b691099a588daae73cab27fa59e52b8535f7 /src | |
| parent | 886ad3a9477b58953d314d9ac44768c323ae5370 (diff) | |
| parent | b0e4c3594f4d52ffde5281bae752e5ff05bd029c (diff) | |
| download | rust-2cbd0bc27cc51d985ff625059bcb011976bcd048.tar.gz rust-2cbd0bc27cc51d985ff625059bcb011976bcd048.zip | |
Rollup merge of #143822 - RalfJung:miri-ui-clean, r=jieyouxu
./x test miri: fix cleaning the miri_ui directory Fixes https://github.com/rust-lang/rust/issues/143680
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/test.rs | 9 | ||||
| -rw-r--r-- | src/tools/miri/tests/ui.rs | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 716bef3f38c..5dbfd522844 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -556,8 +556,13 @@ impl Step for Miri { // Miri has its own "target dir" for ui test dependencies. Make sure it gets cleared when // the sysroot gets rebuilt, to avoid "found possibly newer version of crate `std`" errors. if !builder.config.dry_run() { - let ui_test_dep_dir = - builder.stage_out(miri.build_compiler, Mode::ToolStd).join("miri_ui"); + // This has to match `CARGO_TARGET_TMPDIR` in Miri's `ui.rs`. + // This means we need `host` here as that's the target `ui.rs` is built for. + let ui_test_dep_dir = builder + .stage_out(miri.build_compiler, Mode::ToolStd) + .join(host) + .join("tmp") + .join("miri_ui"); // The mtime of `miri_sysroot` changes when the sysroot gets rebuilt (also see // <https://github.com/RalfJung/rustc-build-sysroot/commit/10ebcf60b80fe2c3dc765af0ff19fdc0da4b7466>). // We can hence use that directly as a signal to clear the ui test dir. diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs index 5239f8338ee..43f855d57dd 100644 --- a/src/tools/miri/tests/ui.rs +++ b/src/tools/miri/tests/ui.rs @@ -97,6 +97,8 @@ fn miri_config( let mut config = Config { target: Some(target.to_owned()), program, + // When changing this, remember to also adjust the logic in bootstrap, in Miri's test step, + // that deletes the `miri_ui` dir when it needs a rebuild. out_dir: PathBuf::from(env!("CARGO_TARGET_TMPDIR")).join("miri_ui"), threads: std::env::var("MIRI_TEST_THREADS") .ok() |
