rustc/debian/patches/u-build-cargo-only-if-requested.patch

21 lines
699 B
Diff

--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -573,7 +573,16 @@
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<'_>) {