Skip to content

Commit da0388d

Browse files
authored
Rollup merge of rust-lang#85297 - infinity0:master, r=Mark-Simulacrum
bootstrap: build cargo only if requested in tools In Debian we'd like to build rustfmt and clippy alongside rustc, but we're still excluding cargo from the rustc build and doing that separately. This patch makes that possible.
2 parents 9e20d98 + 15aad5f commit da0388d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/bootstrap/tool.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,14 @@ impl Step for Cargo {
593593

594594
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
595595
let builder = run.builder;
596-
run.path("src/tools/cargo").default_condition(builder.config.extended)
596+
run.path("src/tools/cargo").default_condition(
597+
builder.config.extended
598+
&& builder.config.tools.as_ref().map_or(
599+
true,
600+
// If `tools` is set, search list for this tool.
601+
|tools| tools.iter().any(|tool| tool == "cargo"),
602+
),
603+
)
597604
}
598605

599606
fn make_run(run: RunConfig<'_>) {

0 commit comments

Comments
 (0)