Skip to content

Commit

Permalink
Rollup merge of #122110 - WaffleLapkin:miri-temp, r=RalfJung
Browse files Browse the repository at this point in the history
Make `x t miri` respect `MIRI_TEMP`

(I don't want to override `TMPDIR`, as that might affect other things)

r? ``@RalfJung``
  • Loading branch information
GuillaumeGomez authored Mar 7, 2024
2 parents 6b04518 + 9891d6a commit d7106d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tools/miri/tests/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->

// Add a test env var to do environment communication tests.
program.envs.push(("MIRI_ENV_VAR_TEST".into(), Some("0".into())));

// Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
program.envs.push(("MIRI_TEMP".into(), Some(env::temp_dir().into())));
let miri_temp = env::var_os("MIRI_TEMP").unwrap_or_else(|| env::temp_dir().into());
program.envs.push(("MIRI_TEMP".into(), Some(miri_temp)));

let mut config = Config {
target: Some(target.to_owned()),
Expand Down
4 changes: 4 additions & 0 deletions src/tools/miri/tests/pass/shims/fs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
//@ignore-target-windows: File handling is not implemented yet
//@compile-flags: -Zmiri-disable-isolation

// If this test is failing for you locally, you can try
// 1. Deleting the files `/tmp/miri_*`
// 2. Setting `MIRI_TEMP` or `TMPDIR` to a different directory, without the `miri_*` files

#![feature(io_error_more)]
#![feature(io_error_uncategorized)]

Expand Down

0 comments on commit d7106d2

Please sign in to comment.