-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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: Fix duplicated path components in debuginfo #96867
Conversation
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 0e4a86f545d8550091c07a262e64967fa3de70af with merge ba1281089ae9e873f5ff73dd7d8eac4a8f460404... |
☀️ Try build successful - checks-actions |
Queued ba1281089ae9e873f5ff73dd7d8eac4a8f460404 with parent e013f9e, future comparison URL. |
Finished benchmarking commit (ba1281089ae9e873f5ff73dd7d8eac4a8f460404): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Footnotes |
Perf looks good. |
r? rust-lang/compiler I won't be able to get to reviewing things for the upcoming next couple weeks. |
not exactly my wheelhouse, so reassigning r? rust-lang/compiler |
@bors r+ |
📌 Commit 0e4a86f545d8550091c07a262e64967fa3de70af has been approved by |
⌛ Testing commit 0e4a86f545d8550091c07a262e64967fa3de70af with merge 5e5d0801988be7475a5df68a44b1ecde2bac7673... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
0e4a86f
to
6411fef
Compare
It looks like |
@bors r=davidtwco (assuming that test fix does not need a separate review) |
📌 Commit 6411fef has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (936eba3): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
This PR fixes an issue with
--remap-path-prefix
where path components could appear twice in the remapped version of the path (e.g. #78479). The underlying problem was that--remap-path-prefix
is often used to map an absolute path to something that looks like a relative path, e.g.:and relative paths in debuginfo are interpreted as being relative to the compilation directory. So if Cargo invokes the compiler with
/home/calvin/.cargo/registry/src/github.com-1ecc6299db9ec823/some_crate-0.1.0/src/lib.rs
as input and/home/calvin/.cargo/registry/src/github.com-1ecc6299db9ec823/some_crate-0.1.0
as the compiler's working directory, then debuginfo will state that the working directory wascrates.io/some_crate-0.1.0
and the file is question wascrates.io/some_crate-0.1.0/src/lib.rs
, which combined gives the path:With this PR the compiler will detect this situation and set up debuginfo in LLVM in a way that makes it strip the duplicated path components when emitting DWARF.
The PR also extracts the logic for making remapped paths absolute into a common helper function that is now used by debuginfo too (instead of just during crate metadata generation).