-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 has no effect #87805
Comments
I can't seem to fully reproduce this. My [build]
rustflags = ["--remap-path-prefix", "C:\\path\\to\\project=nothing_to_see_here"] I've also tried with the following and the results are the same: [build]
rustflags = ["--remap-path-prefix", "C:/path/to/project=nothing_to_see_here"] Building a lib results in a Building a binary however results in a Edit: I forgot to use the same anonymous path... well, nobody will care if I have a local |
Removing this requires an msvc linker flag. E.g. |
I can confirm that with either |
Maybe I had specified the flag in the wrong way. I've used |
@SkiFire13 Even with your invocation my rlib contains the follwing paths:
I've also tried:
|
After a couple of local tests I think the problem is that prefixes that end up inside the crate directory (like yours that end with |
You're right, stripping the src suffix caused the compiler to replace the paths. But as you mentioned this is not the case for executables build with msvc. (btw. the compiler produces debug symbols for release builds too without a manually added And I've (maybe) found a second bug. Originally my crate was a subcrate of another root crate. Both crates contained a .config/config.toml in their project root with |
I think that's expected behaviour, Cargo looks for Anyway I would suggest not to nest crates, instead use a workspace or just put them in the same folder.
I think it keeps a list and the first one to apply wins.
I think only the ones that apply to the final crate are used. Again, if you use a workspace or you put them in the same folder then you can just map that folder and it will work for the other crates as well.
There's work in progress to make Finally, if the original issue is solved this should be closed. If you need additional help you may ask on users.rust-lang.org or in https://discord.gg/rust-lang |
I would say it's not solved entirely or there should be a separate issue for this one:
|
This issue is already filled with discussions about other problems so I think it's better to open a separate issue. |
I tried this code: Not applicable
I expected to see this happen: --remap-path-prefix should rewrite paths to the new prefix, but fails.
Instead, this happened: Paths are still persistent in the binary or rlib
Meta
Steps to reproduce:
I tried C:\path\to\project and C:/path/to/project in the from path. Both failed to work.
rustc --version --verbose
:Backtrace: Not applicable
The text was updated successfully, but these errors were encountered: