@@ -58,7 +58,7 @@ impl MiriEnv {
58
58
impl Command {
59
59
fn auto_actions ( ) -> Result < ( ) > {
60
60
let miri_dir = miri_dir ( ) ?;
61
- let auto_everything = path ! ( miri_dir / ".auto_everything " ) . exists ( ) ;
61
+ let auto_everything = path ! ( miri_dir / ".auto-everything " ) . exists ( ) ;
62
62
let auto_toolchain = auto_everything || path ! ( miri_dir / ".auto-toolchain" ) . exists ( ) ;
63
63
let auto_fmt = auto_everything || path ! ( miri_dir / ".auto-fmt" ) . exists ( ) ;
64
64
let auto_clippy = auto_everything || path ! ( miri_dir / ".auto-clippy" ) . exists ( ) ;
@@ -78,6 +78,21 @@ impl Command {
78
78
}
79
79
80
80
pub fn exec ( self ) -> Result < ( ) > {
81
+ match & self {
82
+ Command :: Install { .. }
83
+ | Command :: Build { .. }
84
+ | Command :: Check { .. }
85
+ | Command :: Test { .. }
86
+ | Command :: Run { .. }
87
+ | Command :: Fmt { .. }
88
+ | Command :: Clippy { .. }
89
+ | Command :: Cargo { .. } => Self :: auto_actions ( ) ?,
90
+ | Command :: ManySeeds { .. }
91
+ | Command :: Toolchain { .. }
92
+ | Command :: RustcPull { .. }
93
+ | Command :: Bench { .. }
94
+ | Command :: RustcPush { .. } => { }
95
+ }
81
96
match self {
82
97
Command :: Install { flags } => Self :: install ( flags) ,
83
98
Command :: Build { flags } => Self :: build ( flags) ,
@@ -328,31 +343,27 @@ impl Command {
328
343
}
329
344
330
345
fn install ( flags : Vec < OsString > ) -> Result < ( ) > {
331
- Self :: auto_actions ( ) ?;
332
346
let e = MiriEnv :: new ( ) ?;
333
347
e. install_to_sysroot ( e. miri_dir . clone ( ) , & flags) ?;
334
348
e. install_to_sysroot ( path ! ( e. miri_dir / "cargo-miri" ) , & flags) ?;
335
349
Ok ( ( ) )
336
350
}
337
351
338
352
fn build ( flags : Vec < OsString > ) -> Result < ( ) > {
339
- Self :: auto_actions ( ) ?;
340
353
let e = MiriEnv :: new ( ) ?;
341
354
e. build ( path ! ( e. miri_dir / "Cargo.toml" ) , & flags, /* quiet */ false ) ?;
342
355
e. build ( path ! ( e. miri_dir / "cargo-miri" / "Cargo.toml" ) , & flags, /* quiet */ false ) ?;
343
356
Ok ( ( ) )
344
357
}
345
358
346
359
fn check ( flags : Vec < OsString > ) -> Result < ( ) > {
347
- Self :: auto_actions ( ) ?;
348
360
let e = MiriEnv :: new ( ) ?;
349
361
e. check ( path ! ( e. miri_dir / "Cargo.toml" ) , & flags) ?;
350
362
e. check ( path ! ( e. miri_dir / "cargo-miri" / "Cargo.toml" ) , & flags) ?;
351
363
Ok ( ( ) )
352
364
}
353
365
354
366
fn clippy ( flags : Vec < OsString > ) -> Result < ( ) > {
355
- Self :: auto_actions ( ) ?;
356
367
let e = MiriEnv :: new ( ) ?;
357
368
e. clippy ( path ! ( e. miri_dir / "Cargo.toml" ) , & flags) ?;
358
369
e. clippy ( path ! ( e. miri_dir / "cargo-miri" / "Cargo.toml" ) , & flags) ?;
@@ -361,7 +372,6 @@ impl Command {
361
372
}
362
373
363
374
fn cargo ( flags : Vec < OsString > ) -> Result < ( ) > {
364
- Self :: auto_actions ( ) ?;
365
375
let e = MiriEnv :: new ( ) ?;
366
376
let toolchain = & e. toolchain ;
367
377
// We carefully kept the working dir intact, so this will run cargo *on the workspace in the
@@ -371,7 +381,6 @@ impl Command {
371
381
}
372
382
373
383
fn test ( bless : bool , flags : Vec < OsString > ) -> Result < ( ) > {
374
- Self :: auto_actions ( ) ?;
375
384
let mut e = MiriEnv :: new ( ) ?;
376
385
// Prepare a sysroot.
377
386
e. build_miri_sysroot ( /* quiet */ false ) ?;
@@ -386,7 +395,6 @@ impl Command {
386
395
}
387
396
388
397
fn run ( dep : bool , flags : Vec < OsString > ) -> Result < ( ) > {
389
- Self :: auto_actions ( ) ?;
390
398
let mut e = MiriEnv :: new ( ) ?;
391
399
// Scan for "--target" to overwrite the "MIRI_TEST_TARGET" env var so
392
400
// that we set the MIRI_SYSROOT up the right way.
@@ -424,7 +432,6 @@ impl Command {
424
432
}
425
433
426
434
fn fmt ( flags : Vec < OsString > ) -> Result < ( ) > {
427
- Self :: auto_actions ( ) ?;
428
435
let e = MiriEnv :: new ( ) ?;
429
436
let toolchain = & e. toolchain ;
430
437
let config_path = path ! ( e. miri_dir / "rustfmt.toml" ) ;
0 commit comments