From 422176572831f396fb69e9b7c624df0f76f6b73b Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 11 Jan 2025 19:42:47 +0100 Subject: [PATCH] avoid issues due to MIRI_TEST_TARGET being set from the outside --- src/tools/miri/miri-script/src/commands.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tools/miri/miri-script/src/commands.rs b/src/tools/miri/miri-script/src/commands.rs index be2517aa6d34..17a7c06b5253 100644 --- a/src/tools/miri/miri-script/src/commands.rs +++ b/src/tools/miri/miri-script/src/commands.rs @@ -564,6 +564,10 @@ impl Command { if bless { e.sh.set_var("RUSTC_BLESS", "Gesundheit"); } + if e.sh.var("MIRI_TEST_TARGET").is_ok() { + // Avoid trouble due to an incorrectly set env var. + bail!("MIRI_TEST_TARGET must not be set when invoking `./miri test`"); + } if let Some(target) = target { // Tell the harness which target to test. e.sh.set_var("MIRI_TEST_TARGET", target);