Skip to content

Commit f66b6c2

Browse files
authored
Rollup merge of #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 ec0e0d1 + 15aad5f commit f66b6c2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/bootstrap/tool.rs

+8-1
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)