-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--remap-path-prefix
does not remap all path prefixes
#83635
Comments
will this also help with similar cargo issue rust-lang/cargo#9311 ? |
@chemsaf3 Could you try setting
Then do:
|
i tried that and in my case it did not work |
Do you maybe have the rust-src component installed? There's a known issue with it (#73167). |
Ah, that would be it then. I somehow missed that when searching for issues. I'll close this in favour of that issue. |
i do not have rust-src installed via rustup when i list components |
@ehuss can you reopen please? i dont have rust-src installed and have this issue |
@chemsaf3 I recommend opening a new issue. Please try to include very exact steps on how to reproduce. |
@ehuss @ChrisDenton already provide exact steps |
@chemsaf3 I'm unable to reproduce this issue without the |
I'm using the
x86_64-pc-windows-msvc
toolchain and target.My system environment variables:
CARGO_HOME
=C:\Users\Chris\AppData\Local\Programs\Cargo
RUSTUP_HOME
=C:\Users\Chris\AppData\Local\Programs\Rust
CARGO_TARGET_DIR
=Z:\target
Without setting
--remap-path-prefix
the final binary has source paths fromCARGO_HOME
andRUSTUP_HOME
. It also has a.pdb
file (Windows debug file) inCARGO_TARGET_DIR
.When setting
--remap-path-prefix
I had to be careful with path separators as the replacement is documented as being "purely textual" (which is honestly a bit scary considering Rust will freely mix path separators on Windows, though hopefully it's not an issue in this case).Ok so I set
RUSTFLAGS
:Then, after cleaning the target directory, I built ripgrep (as a presumably representative project). I used the command:
As expected, this replaced the
CARGO_HOME
prefix in the final binary. However it did not replace all theRUSTUP_HOME
path prefixes. Specifically with this prefix:C:\Users\Chris\AppData\Local\Programs\Rust\toolchains\nightly-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\
It also didn't remap the path to the
.pdb
file. This is somewhat expected as changing that requires setting a linker argument.Meta
rustc --version --verbose
:Notes
--remap-path-prefix
to a single common base directory didn't help.The text was updated successfully, but these errors were encountered: