test(trim-paths): re-enable more symbols trimming check#15610
test(trim-paths): re-enable more symbols trimming check#15610weihanglo wants to merge 1 commit intorust-lang:masterfrom
Conversation
| if memchr::memmem::find(line, b"DW_AT_comp_dir").is_some() { | ||
| continue; | ||
| } | ||
| if memchr::memmem::find(line, b"DW_AT_GNU_dwo_name").is_some() { |
There was a problem hiding this comment.
When all the conditions are met:
split-debuginfo=packed|unpacked, and-Zremap-path-scope=objectis used,- have at least one extern crate (dependency)
In the binary, DW_AT_GNU_dwo_name symbols from extern crates are not remapped. I haven't traced down why yet.
cc @Urgau, let me know if you need a better repro.
There was a problem hiding this comment.
For the record: I tried reproducing the issue with rustc and failed to do. Maybe a Cargo specific thing.
$ rustc +nightly -C split-debuginfo=unpacked -g --remap-path-prefix=/tmp/split-rustc/=/remapped/path dep.rs --out-dir /tmp/split-rustc/target/ --crate-type lib -Zremap-path-scope=object
$ rustc +nightly -C split-debuginfo=unpacked -g --remap-path-prefix=/tmp/split-rustc/=/remapped/path main.rs --out-dir /tmp/split-rustc/target/ --extern=dep=/tmp/split-rustc/target/libdep.rlib -Zremap-path-scope=object
$ llvm-dwarfdump target/main | rg DW_AT_GNU_dwo_name
DW_AT_GNU_dwo_name ("/remapped/path/target/main.main.62a074bc4c4ee7d3-cgu.0.rcgu.dwo")
DW_AT_GNU_dwo_name ("/remapped/path/target/dep.dep.45866446ec9e29d2-cgu.0.rcgu.dwo")There was a problem hiding this comment.
I see something interesting in the Cargo test regarding the dependency, I don't think you are remapping the --out-dir, which would explain why the path isn't remapped, as I assume that the dwo/dwp would be in the target/ directory which isn't covered by those --remap-path-prefix (in the dependency rustc args).
--remap-path-prefix=[ROOT]/home/.cargo/registry/src= \
--remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..]
To me it seems like you are missing a --remap-path-prefix for the build.build-dir.
There was a problem hiding this comment.
Really thank you very much Urgau! Excellent debugging skill!
|
Close in favor of #15614 |
What does this PR try to resolve?
rust-lang/rust#117652 has been fixed, so re-enable those skipped.
How should we test and review this PR?
NOT READY FOR REVIEW.
Additional information