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 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<'_>) { 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| { 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.", + }, ];