@@ -402,10 +402,9 @@ impl Step for RustAnalyzer {
402
402
macro_rules! tool_check_step {
403
403
(
404
404
$name: ident,
405
- $path: literal,
406
- $( $alias: literal, ) *
407
- $source_type: path
408
- $( , $default: literal ) ?
405
+ $path: literal
406
+ $( , alt_path: $alt_path: literal ) *
407
+ $( , default : $default: literal ) ?
409
408
) => {
410
409
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
411
410
pub struct $name {
@@ -415,11 +414,11 @@ macro_rules! tool_check_step {
415
414
impl Step for $name {
416
415
type Output = ( ) ;
417
416
const ONLY_HOSTS : bool = true ;
418
- /// don't ever check out-of-tree tools by default, they'll fail when toolstate is broken
419
- const DEFAULT : bool = matches! ( $source_type , SourceType :: InTree ) $( && $default ) ?;
417
+ /// Most of the tool-checks using this macro are run by default.
418
+ const DEFAULT : bool = true $( && $default ) ?;
420
419
421
420
fn should_run( run: ShouldRun <' _>) -> ShouldRun <' _> {
422
- run. paths( & [ $path, $( $alias ) ,* ] )
421
+ run. paths( & [ $path, $( $alt_path ) ,* ] )
423
422
}
424
423
425
424
fn make_run( run: RunConfig <' _>) {
@@ -428,19 +427,14 @@ macro_rules! tool_check_step {
428
427
429
428
fn run( self , builder: & Builder <' _>) {
430
429
let Self { target } = self ;
431
- run_tool_check_step( builder, target, $path, $source_type ) ;
430
+ run_tool_check_step( builder, target, $path) ;
432
431
}
433
432
}
434
433
}
435
434
}
436
435
437
436
/// Used by the implementation of `Step::run` in `tool_check_step!`.
438
- fn run_tool_check_step (
439
- builder : & Builder < ' _ > ,
440
- target : TargetSelection ,
441
- path : & str ,
442
- source_type : SourceType ,
443
- ) {
437
+ fn run_tool_check_step ( builder : & Builder < ' _ > , target : TargetSelection , path : & str ) {
444
438
let display_name = path. rsplit ( '/' ) . next ( ) . unwrap ( ) ;
445
439
let compiler = builder. compiler ( builder. top_stage , builder. config . build ) ;
446
440
@@ -453,7 +447,11 @@ fn run_tool_check_step(
453
447
target,
454
448
builder. kind ,
455
449
path,
456
- source_type,
450
+ // Currently, all of the tools that use this macro/function are in-tree.
451
+ // If support for out-of-tree tools is re-added in the future, those
452
+ // steps should probably be marked non-default so that the default
453
+ // checks aren't affected by toolstate being broken.
454
+ SourceType :: InTree ,
457
455
& [ ] ,
458
456
) ;
459
457
@@ -471,23 +469,23 @@ fn run_tool_check_step(
471
469
run_cargo ( builder, cargo, builder. config . free_args . clone ( ) , & stamp, vec ! [ ] , true , false ) ;
472
470
}
473
471
474
- tool_check_step ! ( Rustdoc , "src/tools/rustdoc" , "src/librustdoc" , SourceType :: InTree ) ;
472
+ tool_check_step ! ( Rustdoc , "src/tools/rustdoc" , alt_path : "src/librustdoc" ) ;
475
473
// Clippy, miri and Rustfmt are hybrids. They are external tools, but use a git subtree instead
476
474
// of a submodule. Since the SourceType only drives the deny-warnings
477
475
// behavior, treat it as in-tree so that any new warnings in clippy will be
478
476
// rejected.
479
- tool_check_step ! ( Clippy , "src/tools/clippy" , SourceType :: InTree ) ;
480
- tool_check_step ! ( Miri , "src/tools/miri" , SourceType :: InTree ) ;
481
- tool_check_step ! ( CargoMiri , "src/tools/miri/cargo-miri" , SourceType :: InTree ) ;
482
- tool_check_step ! ( Rls , "src/tools/rls" , SourceType :: InTree ) ;
483
- tool_check_step ! ( Rustfmt , "src/tools/rustfmt" , SourceType :: InTree ) ;
484
- tool_check_step ! ( MiroptTestTools , "src/tools/miropt-test-tools" , SourceType :: InTree ) ;
485
- tool_check_step ! ( TestFloatParse , "src/etc/test-float-parse" , SourceType :: InTree ) ;
486
-
487
- tool_check_step ! ( Bootstrap , "src/bootstrap" , SourceType :: InTree , false ) ;
477
+ tool_check_step ! ( Clippy , "src/tools/clippy" ) ;
478
+ tool_check_step ! ( Miri , "src/tools/miri" ) ;
479
+ tool_check_step ! ( CargoMiri , "src/tools/miri/cargo-miri" ) ;
480
+ tool_check_step ! ( Rls , "src/tools/rls" ) ;
481
+ tool_check_step ! ( Rustfmt , "src/tools/rustfmt" ) ;
482
+ tool_check_step ! ( MiroptTestTools , "src/tools/miropt-test-tools" ) ;
483
+ tool_check_step ! ( TestFloatParse , "src/etc/test-float-parse" ) ;
484
+
485
+ tool_check_step ! ( Bootstrap , "src/bootstrap" , default : false ) ;
488
486
// Compiletest is implicitly "checked" when it gets built in order to run tests,
489
487
// so this is mainly for people working on compiletest to run locally.
490
- tool_check_step ! ( Compiletest , "src/tools/compiletest" , SourceType :: InTree , false ) ;
488
+ tool_check_step ! ( Compiletest , "src/tools/compiletest" , default : false ) ;
491
489
492
490
/// Cargo's output path for the standard library in a given stage, compiled
493
491
/// by a particular compiler for the specified target.
0 commit comments