1
Fork 0

bootstrap: build cargo only if requested in tools

This commit is contained in:
Ximin Luo 2021-05-14 19:22:41 +01:00
parent 75da570d78
commit 15aad5fcdb

View file

@ -593,7 +593,14 @@ impl Step for Cargo {
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
run.path("src/tools/cargo").default_condition(builder.config.extended)
run.path("src/tools/cargo").default_condition(
builder.config.extended
&& builder.config.tools.as_ref().map_or(
true,
// If `tools` is set, search list for this tool.
|tools| tools.iter().any(|tool| tool == "cargo"),
),
)
}
fn make_run(run: RunConfig<'_>) {