From 986c1687f868e7839f4e967bba32aeec6b2df5da Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 10 Apr 2022 16:37:24 -0500 Subject: [PATCH 1/2] Remove duplicate aliases for `codegen_{cranelift,gcc}` Bootstrap already allows selecting these in `PathSet::has`, which allows any string that matches the end of a full path. I found these by adding `assert!(path.exists())` in `StepDescription::paths`. I think ideally we wouldn't have any aliases that aren't paths, but I've held off on enforcing that here since it may be controversial, I'll open a separate PR. --- src/bootstrap/check.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index 28e7f1fdca7a1..432a6c34ed584 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -243,12 +243,7 @@ impl Step for CodegenBackend { const DEFAULT: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.paths(&[ - "compiler/rustc_codegen_cranelift", - "rustc_codegen_cranelift", - "compiler/rustc_codegen_gcc", - "rustc_codegen_gcc", - ]) + run.paths(&["compiler/rustc_codegen_cranelift", "compiler/rustc_codegen_gcc"]) } fn make_run(run: RunConfig<'_>) { From 4c1438332be229ee1d1e1dbc02181a03678e04f9 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 10 Apr 2022 16:41:21 -0500 Subject: [PATCH 2/2] Add `build compiler/rustc_codegen_gcc` as an alias for `CodegenBackend` These paths (`_cranelift` and `_gcc`) are somewhat misleading, since they actually tell bootstrap to build *all* codegen backends. But this seems like a useful improvement in the meantime. --- src/bootstrap/compile.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index afc333b5048ce..45991381dc0fe 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -795,7 +795,7 @@ impl Step for CodegenBackend { const DEFAULT: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.path("compiler/rustc_codegen_cranelift") + run.paths(&["compiler/rustc_codegen_cranelift", "compiler/rustc_codegen_gcc"]) } fn make_run(run: RunConfig<'_>) {