Skip to content

Commit

Permalink
Rollup merge of #119124 - onur-ozkan:help-118861, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
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
  • Loading branch information
matthiaskrgr authored Dec 21, 2023
2 parents 1871f2b + 1f141dc commit c644d00
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
1 change: 1 addition & 0 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@
# "rustdoc",
# "rustfmt",
# "rust-analyzer",
# "rust-analyzer-proc-macro-srv",
# "analysis",
# "src",
# "rust-demangler", # if profiler = true
Expand Down
13 changes: 8 additions & 5 deletions src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<'_>) {
Expand Down
14 changes: 14 additions & 0 deletions src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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| {
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
},
];

0 comments on commit c644d00

Please sign in to comment.