Skip to content

Commit 4ba1487

Browse files
committed
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 <[email protected]>
1 parent bccac41 commit 4ba1487

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/bootstrap/src/core/builder.rs

+14
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,18 @@ impl PathSet {
289289
}
290290
}
291291

292+
const PATH_REMAP: &[(&str, &str)] = &[("rust-analyzer-proc-macro-srv", "proc-macro-srv-cli")];
293+
294+
fn remap_paths(paths: &mut Vec<&Path>) {
295+
for path in paths.iter_mut() {
296+
for &(search, replace) in PATH_REMAP {
297+
if path.to_str() == Some(search) {
298+
*path = Path::new(replace)
299+
}
300+
}
301+
}
302+
}
303+
292304
impl StepDescription {
293305
fn from<S: Step>(kind: Kind) -> StepDescription {
294306
StepDescription {
@@ -361,6 +373,8 @@ impl StepDescription {
361373
let mut paths: Vec<_> =
362374
paths.into_iter().map(|p| p.strip_prefix(".").unwrap_or(p)).collect();
363375

376+
remap_paths(&mut paths);
377+
364378
// Handle all test suite paths.
365379
// (This is separate from the loop below to avoid having to handle multiple paths in `is_suite_path` somehow.)
366380
paths.retain(|path| {

0 commit comments

Comments
 (0)