This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -458,8 +458,8 @@ Some native rustc `-Z` flags are also very relevant for Miri:
458458Moreover, 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
Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ impl MiriEnv {
5757
5858impl 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) ,
You can’t perform that action at this time.
0 commit comments