about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-06-19 00:17:12 +0200
committerGitHub <noreply@github.com>2022-06-19 00:17:12 +0200
commite6d28d2ea22f7a4985a1e5212aab58535a64ba15 (patch)
tree71361d17c63996676fa7903018bd966b1e870ee2
parent21e9336fe81a1fce364349bb7a35a0347c369f34 (diff)
parent37f9cdbd9be2504861bdafd59cbae9d1aebe24c4 (diff)
downloadrust-e6d28d2ea22f7a4985a1e5212aab58535a64ba15.tar.gz
rust-e6d28d2ea22f7a4985a1e5212aab58535a64ba15.zip
Rollup merge of #97511 - jyn514:faster-cargo-build, r=Mark-Simulacrum
Don't build the compiler before building rust-demangler

This saves a lot of time compiling, since rust-demangler doesn't actually use any unstable features.

This is not quite ideal because it uses ToolStd, not ToolBootstrap, so rust-demangler would be able to add unstable library features in the future. But it's a lot better than before, and `builder.cargo` doesn't currently know how to handle stages other than 0.
-rw-r--r--src/bootstrap/tool.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index b7abf6cc78d..905fa431d29 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -692,6 +692,7 @@ macro_rules! tool_extended {
        stable = $stable:expr,
        $(in_tree = $in_tree:expr,)?
        $(submodule = $submodule:literal,)?
+       $(tool_std = $tool_std:literal,)?
        $extra_deps:block;)+) => {
         $(
             #[derive(Debug, Clone, Hash, PartialEq, Eq)]
@@ -740,7 +741,7 @@ macro_rules! tool_extended {
                     compiler: $sel.compiler,
                     target: $sel.target,
                     tool: $tool_name,
-                    mode: Mode::ToolRustc,
+                    mode: if false $(|| $tool_std)? { Mode::ToolStd } else { Mode::ToolRustc },
                     path: $path,
                     extra_features: $sel.extra_features,
                     is_optional_tool: true,
@@ -774,7 +775,10 @@ tool_extended!((self, builder),
         });
         self.extra_features.push("clippy".to_owned());
     };
-    RustDemangler, rust_demangler, "src/tools/rust-demangler", "rust-demangler", stable=false, in_tree=true, {};
+    // FIXME: tool_std is not quite right, we shouldn't allow nightly features.
+    // But `builder.cargo` doesn't know how to handle ToolBootstrap in stages other than 0,
+    // and this is close enough for now.
+    RustDemangler, rust_demangler, "src/tools/rust-demangler", "rust-demangler", stable=false, in_tree=true, tool_std=true, {};
     Rustfmt, rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, in_tree=true, {};
     RustAnalyzer, rust_analyzer, "src/tools/rust-analyzer/crates/rust-analyzer", "rust-analyzer", stable=false, submodule="rust-analyzer", {};
 );