-
-
Notifications
You must be signed in to change notification settings - Fork 15k
--remap-path-prefix doesn't map paths to .pdb files, even in release mode #87825
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)A-reproducibilityArea: Reproducible / deterministic buildsArea: Reproducible / deterministic buildsC-bugCategory: This is a bug.Category: This is a bug.O-windows-msvcToolchain: MSVC, Operating system: WindowsToolchain: MSVC, Operating system: WindowsP-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)A-reproducibilityArea: Reproducible / deterministic buildsArea: Reproducible / deterministic buildsC-bugCategory: This is a bug.Category: This is a bug.O-windows-msvcToolchain: MSVC, Operating system: WindowsToolchain: MSVC, Operating system: WindowsP-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Spawned off of #87805 (comment)
When passing
--remap-path-prefix C:\\path\\to\\project=nothing_to_see_hereto rustc I would expect all paths that start withC:\path\to\projectto be replaced withnothing_to_see_here, instead aC:\path\to\project\target\release\deps\crate_name.pdbis still present.Note that this happens even in release mode, because rustc always tells the msvc linker to generate
.pdbfiles.This can be "fixed" by passing either
-Clink-arg=/PDBALTPATH:%_PDB%,-Clink-arg=/DEBUG:NONEor-Zstrip=debuginfoto rustc, but doing so will break backtraces withRUST_BACKTRACE='full'(RUST_BACKTRACE=1already prints almost nothing in release mode). As a sidenote, do we really need backtraces in release mode, and by consequence.pdbfiles? They will break anyway if only the.exeis distributed or thetargetdirectory is deleted.Moreover this shouldn't be needed in the first place since
--remap-path-prefixpromises to "remap source names in all output (compiler messages and output files)" (from the output ofrustc --help -v), "including [...] debug information" (from the rustc book here). Also note that neitherrustc --help -vnor the rustc book mention the need to pass one of those arguments to rustc to remap/remove the path to the.pdbfile, which makes it harder for non-experts to know how to remove them.rustc --version --verbose: