Support different paths remapping for different scopes
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I want to raise that I think it should be possible to apply different remapping to the same path for different scopes. It seems like remap-path-prefix was too generic in remapping across many different use cases, and now the scope argument is being introduced to limit the scope, but that doesn't deal with the situation where you want to remap the same path differently across scopes.
E.g. imagine I want to remap
/home/cameron/code/projectto"."formacro, but to""forsplit-debuginfo. This would be necessary on macOS, where OSO stabs cannot use relative paths (see #132143).You could imagine doing something like:
rustc ... --remap-path-scope=split-debuginfo \ --remap-path-prefix=/home/cameron/code/project=. \ --remap-path-scope=macro \ --remap-path-prefix=/home/cameron/code/project=But repeated usage of these flags are independently aggregated, rather than ordered, so that wouldn't work.
Not sure on the right design here, but I do think being able to express ^ is worthwhile.
Originally posted by @csmulhern in #111540
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing rustc's existing --remap-path-scope and --remap-path-prefix handling, including the behavior described in issue #132143. Define how repeated flags should associate a path remapping with each scope, then verify that the example distinguishes macro and split-debuginfo remappings without changing unrelated scopes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100