From 57bfbfa8979771a1054adad4ad0be46c531e1be0 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Tue, 19 Dec 2023 18:09:46 +0300 Subject: [PATCH 1/4] don't build `rust-analyzer-proc-macro-srv` on def config Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/tool.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs index 9942f00a0562b..8e3941dbedaca 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<'_>) { From bccac41db7cc894aeb9487bc97bc52698143145e Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Tue, 19 Dec 2023 18:27:08 +0300 Subject: [PATCH 2/4] update `build.tools` in config.example.toml Signed-off-by: onur-ozkan --- config.example.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config.example.toml b/config.example.toml index 14e0b9d521fde..f6e7eff3752ba 100644 --- a/config.example.toml +++ b/config.example.toml @@ -323,6 +323,7 @@ change-id = 118703 # "rustdoc", # "rustfmt", # "rust-analyzer", +# "rust-analyzer-proc-macro-srv", # "analysis", # "src", # "rust-demangler", # if profiler = true From 4ba1487e157c3d67ccac4e75b4a335494cbb3b3a Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Tue, 19 Dec 2023 18:28:41 +0300 Subject: [PATCH 3/4] implement remapper for build paths In config.toml we use `rust-analyzer-proc-macro-srv` for building `rust-analyzer-proc-macro-srv`, however, when we attempt to build it from the terminal, this cannot be used because we need to use the actual path, which is `proc-macro-srv-cli`. Remapping should end this confusion with improving the development experience. Signed-off-by: onur-ozkan --- src/bootstrap/src/core/builder.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index 28761a7ee4b26..df8e3e8fd2349 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(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| { From 1f141dc0b8635f17ce31d72e3328ad2b0dd6b084 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 21 Dec 2023 16:08:14 +0300 Subject: [PATCH 4/4] add a new change in change-tracker Signed-off-by: onur-ozkan --- src/bootstrap/src/utils/change_tracker.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index 8b53a61542e40..1eadc036b5e6e 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.", + }, ];