Skip to content

Commit d7106d2

Browse files
Rollup merge of #122110 - WaffleLapkin:miri-temp, r=RalfJung
Make `x t miri` respect `MIRI_TEMP` (I don't want to override `TMPDIR`, as that might affect other things) r? ``@RalfJung``
2 parents 6b04518 + 9891d6a commit d7106d2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: src/tools/miri/tests/compiletest.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
8181

8282
// Add a test env var to do environment communication tests.
8383
program.envs.push(("MIRI_ENV_VAR_TEST".into(), Some("0".into())));
84+
8485
// Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
85-
program.envs.push(("MIRI_TEMP".into(), Some(env::temp_dir().into())));
86+
let miri_temp = env::var_os("MIRI_TEMP").unwrap_or_else(|| env::temp_dir().into());
87+
program.envs.push(("MIRI_TEMP".into(), Some(miri_temp)));
8688

8789
let mut config = Config {
8890
target: Some(target.to_owned()),

Diff for: src/tools/miri/tests/pass/shims/fs.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
//@ignore-target-windows: File handling is not implemented yet
22
//@compile-flags: -Zmiri-disable-isolation
33

4+
// If this test is failing for you locally, you can try
5+
// 1. Deleting the files `/tmp/miri_*`
6+
// 2. Setting `MIRI_TEMP` or `TMPDIR` to a different directory, without the `miri_*` files
7+
48
#![feature(io_error_more)]
59
#![feature(io_error_uncategorized)]
610

0 commit comments

Comments
 (0)