@@ -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,7 +427,7 @@ 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, stringify!($name), $path, $source_type );
430
+ run_tool_check_step(builder, target, stringify!($name), $path);
432
431
}
433
432
}
434
433
}
@@ -440,7 +439,6 @@ fn run_tool_check_step(
440
439
target: TargetSelection,
441
440
step_type_name: &str,
442
441
path: &str,
443
- source_type: SourceType,
444
442
) {
445
443
let display_name = path.rsplit('/').next().unwrap();
446
444
let compiler = builder.compiler(builder.top_stage, builder.config.build);
@@ -454,7 +452,11 @@ fn run_tool_check_step(
454
452
target,
455
453
builder.kind,
456
454
path,
457
- source_type,
455
+ // Currently, all of the tools that use this macro/function are in-tree.
456
+ // If support for out-of-tree tools is re-added in the future, those
457
+ // steps should probably be marked non-default so that the default
458
+ // checks aren't affected by toolstate being broken.
459
+ SourceType::InTree,
458
460
&[],
459
461
);
460
462
@@ -472,23 +474,23 @@ fn run_tool_check_step(
472
474
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
473
475
}
474
476
475
- tool_check_step!(Rustdoc, "src/tools/rustdoc", "src/librustdoc", SourceType::InTree );
477
+ tool_check_step!(Rustdoc, "src/tools/rustdoc", alt_path: "src/librustdoc");
476
478
// Clippy, miri and Rustfmt are hybrids. They are external tools, but use a git subtree instead
477
479
// of a submodule. Since the SourceType only drives the deny-warnings
478
480
// behavior, treat it as in-tree so that any new warnings in clippy will be
479
481
// rejected.
480
- tool_check_step!(Clippy, "src/tools/clippy", SourceType::InTree );
481
- tool_check_step!(Miri, "src/tools/miri", SourceType::InTree );
482
- tool_check_step!(CargoMiri, "src/tools/miri/cargo-miri", SourceType::InTree );
483
- tool_check_step!(Rls, "src/tools/rls", SourceType::InTree );
484
- tool_check_step!(Rustfmt, "src/tools/rustfmt", SourceType::InTree );
485
- tool_check_step!(MiroptTestTools, "src/tools/miropt-test-tools", SourceType::InTree );
486
- tool_check_step!(TestFloatParse, "src/etc/test-float-parse", SourceType::InTree );
487
-
488
- tool_check_step!(Bootstrap, "src/bootstrap", SourceType::InTree, false);
482
+ tool_check_step!(Clippy, "src/tools/clippy");
483
+ tool_check_step!(Miri, "src/tools/miri");
484
+ tool_check_step!(CargoMiri, "src/tools/miri/cargo-miri");
485
+ tool_check_step!(Rls, "src/tools/rls");
486
+ tool_check_step!(Rustfmt, "src/tools/rustfmt");
487
+ tool_check_step!(MiroptTestTools, "src/tools/miropt-test-tools");
488
+ tool_check_step!(TestFloatParse, "src/etc/test-float-parse");
489
+
490
+ tool_check_step!(Bootstrap, "src/bootstrap", default: false);
489
491
// Compiletest is implicitly "checked" when it gets built in order to run tests,
490
492
// so this is mainly for people working on compiletest to run locally.
491
- tool_check_step!(Compiletest, "src/tools/compiletest", SourceType::InTree, false);
493
+ tool_check_step!(Compiletest, "src/tools/compiletest", default: false);
492
494
493
495
/// Cargo's output path for the standard library in a given stage, compiled
494
496
/// by a particular compiler for the specified target.
0 commit comments