about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-12-21 16:43:07 +0100
committerGitHub <noreply@github.com>2023-12-21 16:43:07 +0100
commitc644d002853fdaeafb4bce6b2ba0ea3d6bc1bbe1 (patch)
tree6f6890b4a1c7ee15bc186db483b50226b92a1783
parent1871f2b4a04428ad0228182fceb9385b0d0c3905 (diff)
parent1f141dc0b8635f17ce31d72e3328ad2b0dd6b084 (diff)
downloadrust-c644d002853fdaeafb4bce6b2ba0ea3d6bc1bbe1.tar.gz
rust-c644d002853fdaeafb4bce6b2ba0ea3d6bc1bbe1.zip
Rollup merge of #119124 - onur-ozkan:help-118861, r=Mark-Simulacrum
don't build `rust-analyzer-proc-macro-srv` on def config

Should be very easy to understand when reviewing commit-by-commit.

Blocker for #118861
-rw-r--r--config.example.toml1
-rw-r--r--src/bootstrap/src/core/build_steps/tool.rs13
-rw-r--r--src/bootstrap/src/core/builder.rs14
-rw-r--r--src/bootstrap/src/utils/change_tracker.rs5
4 files changed, 28 insertions, 5 deletions
diff --git a/config.example.toml b/config.example.toml
index a7d4df545a6..4cf7c1e8199 100644
--- a/config.example.toml
+++ b/config.example.toml
@@ -323,6 +323,7 @@
 #    "rustdoc",
 #    "rustfmt",
 #    "rust-analyzer",
+#    "rust-analyzer-proc-macro-srv",
 #    "analysis",
 #    "src",
 #    "rust-demangler",  # if profiler = true
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
index 9942f00a056..8e3941dbeda 100644
--- a/src/bootstrap/src/core/build_steps/tool.rs
+++ b/src/bootstrap/src/core/build_steps/tool.rs
@@ -671,11 +671,14 @@ impl Step for RustAnalyzerProcMacroSrv {
         // Allow building `rust-analyzer-proc-macro-srv` both as part of the `rust-analyzer` and as a stand-alone tool.
         run.path("src/tools/rust-analyzer")
             .path("src/tools/rust-analyzer/crates/proc-macro-srv-cli")
-            .default_condition(builder.config.tools.as_ref().map_or(true, |tools| {
-                tools
-                    .iter()
-                    .any(|tool| tool == "rust-analyzer" || tool == "rust-analyzer-proc-macro-srv")
-            }))
+            .default_condition(
+                builder.config.extended
+                    && builder.config.tools.as_ref().map_or(true, |tools| {
+                        tools.iter().any(|tool| {
+                            tool == "rust-analyzer" || tool == "rust-analyzer-proc-macro-srv"
+                        })
+                    }),
+            )
     }
 
     fn make_run(run: RunConfig<'_>) {
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index e1809644350..56bdc9aaef1 100644
--- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/src/core/builder.rs
@@ -289,6 +289,18 @@ impl PathSet {
     }
 }
 
+const PATH_REMAP: &[(&str, &str)] = &[("rust-analyzer-proc-macro-srv", "proc-macro-srv-cli")];
+
+fn remap_paths(paths: &mut Vec<&Path>) {
+    for path in paths.iter_mut() {
+        for &(search, replace) in PATH_REMAP {
+            if path.to_str() == Some(search) {
+                *path = Path::new(replace)
+            }
+        }
+    }
+}
+
 impl StepDescription {
     fn from<S: Step>(kind: Kind) -> StepDescription {
         StepDescription {
@@ -361,6 +373,8 @@ impl StepDescription {
         let mut paths: Vec<_> =
             paths.into_iter().map(|p| p.strip_prefix(".").unwrap_or(p)).collect();
 
+        remap_paths(&mut paths);
+
         // Handle all test suite paths.
         // (This is separate from the loop below to avoid having to handle multiple paths in `is_suite_path` somehow.)
         paths.retain(|path| {
diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs
index 8b53a61542e..1eadc036b5e 100644
--- a/src/bootstrap/src/utils/change_tracker.rs
+++ b/src/bootstrap/src/utils/change_tracker.rs
@@ -96,4 +96,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
         severity: ChangeSeverity::Info,
         summary: "Removed rust.run_dsymutil and dist.gpg_password_file config options, as they were unused.",
     },
+    ChangeInfo {
+        change_id: 119124,
+        severity: ChangeSeverity::Warning,
+        summary: "rust-analyzer-proc-macro-srv is no longer enabled by default. To build it, you must either enable it in the configuration or explicitly invoke it with x.py.",
+    },
 ];