compiler-builtins: remap RUSTC_DEBUGINFO_MAP paths via -ffile-prefix-map#1236
compiler-builtins: remap RUSTC_DEBUGINFO_MAP paths via -ffile-prefix-map#1236paradoxicalguy wants to merge 1 commit into
Conversation
|
Failed to set assignee to
|
|
Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @Urgau (or someone else) some time within the next two weeks. |
96ccf23 to
9d57d70
Compare
| // | ||
| // Apply each mapping via -ffile-prefix-map, mirroring rustc_llvm's | ||
| // build.rs for the same env var. | ||
| if let Some(maps) = env::var_os("RUSTC_DEBUGINFO_MAP") |
There was a problem hiding this comment.
I am not a fan of this living outside of rust-lang/rust. That usually leads to confusion and pain when we want to change the interface.
Can you say more about what information is missing in Cargo to allow reproducible artifacts from compiler-builtins? If root.display() above is not enough, what would be enough?
Somewhat relatedly, if rust-lang/rust's bootstrap feels this should be threaded down, why can't it use CFLAGS / CXXFLAGS to do so, rather than a custom env variable?
There was a problem hiding this comment.
root.display() only covers the compiler-rt source root, it doesn't cover this crate's own directory (CARGO_MANIFEST_DIR), which is what DW_AT_comp_dir was leaking.
on CFLAGS/CXXFLAGS, i don't know why bootstrap uses a custom env var instead of that. i'll check with @Urgau , who was explaining the RUSTFLAGS-forwarding issue (rust-lang/cargo#4423) that led to RUSTC_DEBUGINFO_MAP existing in the first place. not sure if the same limitation applies to CFLAGS/CXXFLAGS.
happy to move this into rust-lang/rust directly if that's preferred. wasn't sure which repo was the right home for it given compiler-builtins is developed separately.
|
Sounds like this may be something to update elsewhere, rust-lang/rust#156570 (comment) |
|
closing this |
libcompiler_builtins.rlibleaks the local build path intoDW_AT_comp_dirfor C-compiled units (compiler-rt), even with rust-lang/rust'srust.remap-debuginfo = true.existing
-ffile-prefix-map={root}=.only covers the compiler-rt source root, notcomp_dir.fix: iterate
RUSTC_DEBUGINFO_MAPand apply each mapping via-ffile-prefix-map, mirroringrustc_llvm'sbuild.rs.before:
DW_AT_comp_dir ("/rustc/08f62523b1c3262cc2f0288a3369b760ab4bda45/library/compiler-builtins/compiler-builtins")after:
DW_AT_comp_dir ("/rustc/08f62523b1c3262cc2f0288a3369b760ab4bda45")see discussion
r? @Urgau
cc @tgross35