-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-reproducibilityArea: Reproducible / deterministic buildsArea: Reproducible / deterministic buildsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
It appears that if multiple--remap-path-prefix
arguments are supplied on the CLI, they will be applied in the reverse order, rather than in the CLI-occurence order.
To reproduce:
$ mkdir -p apple/banana
$ echo 'fn main(){ panic!() }' > apple/banana/chaenomeles.rs
$ rustc apple/banana/chaenomeles.rs --remap-path-prefix=apple/banana/=/first/ --remap-path-prefix=apple/=/second/
$ ./chaenomeles
thread 'main' panicked at 'explicit panic', /second/banana/chaenomeles.rs:1:12
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Note that only the latter --remap-path-prefix
got invoked and the panic path became /second/banana/chaenomeles.rs
. Instead users need to specify the order of remappings in reverse:
$ rustc apple/banana/chaenomeles.rs --remap-path-prefix=apple/=/first/ --remap-path-prefix=apple/banana/=/second/
$ ./chaenomeles
thread 'main' panicked at 'explicit panic', /second/chaenomeles.rs:1:12
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
(in contrast clang/gcc will apply remappings front-to-back)
Metadata
Metadata
Assignees
Labels
A-reproducibilityArea: Reproducible / deterministic buildsArea: Reproducible / deterministic buildsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.