Skip to content

Commit 2f6ffa9

Browse files
committed
fix MIRI_AUTO_OPS not having an effect any more
1 parent 5615562 commit 2f6ffa9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/tools/miri/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ Some native rustc `-Z` flags are also very relevant for Miri:
458458
Moreover, Miri recognizes some environment variables:
459459

460460
* `MIRI_AUTO_OPS` indicates whether the automatic execution of rustfmt, clippy and toolchain setup
461-
should be skipped. If it is set to any value, they are skipped. This is used for avoiding infinite
462-
recursion in `./miri` and to allow automated IDE actions to avoid the auto ops.
461+
should be skipped. If it is set to `no`, they are skipped. This is used to allow automated IDE
462+
actions to avoid the auto ops.
463463
* `MIRI_LOG`, `MIRI_BACKTRACE` control logging and backtrace printing during
464464
Miri executions, also [see "Testing the Miri driver" in `CONTRIBUTING.md`][testing-miri].
465465
* `MIRIFLAGS` (recognized by `cargo miri` and the test suite) defines extra

src/tools/miri/miri-script/src/commands.rs

+6
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ impl MiriEnv {
5757

5858
impl Command {
5959
fn auto_actions() -> Result<()> {
60+
if env::var_os("MIRI_AUTO_OPS").is_some_and(|x| x == "no") {
61+
return Ok(());
62+
}
63+
6064
let miri_dir = miri_dir()?;
6165
let auto_everything = path!(miri_dir / ".auto-everything").exists();
6266
let auto_toolchain = auto_everything || path!(miri_dir / ".auto-toolchain").exists();
@@ -78,6 +82,7 @@ impl Command {
7882
}
7983

8084
pub fn exec(self) -> Result<()> {
85+
// First, and crucially only once, run the auto-actions -- but not for all commands.
8186
match &self {
8287
Command::Install { .. }
8388
| Command::Build { .. }
@@ -93,6 +98,7 @@ impl Command {
9398
| Command::Bench { .. }
9499
| Command::RustcPush { .. } => {}
95100
}
101+
// Then run the actual command.
96102
match self {
97103
Command::Install { flags } => Self::install(flags),
98104
Command::Build { flags } => Self::build(flags),

0 commit comments

Comments
 (0)