Skip to content

[Windows] Output exe's debuginfo points to PDB with out+hash.pdb instead of out.pdb #7358

Closed
@snf

Description

@snf

Describe the problem you are trying to solve

Whenever cargo build is run, it creates the files name+hash.exe and name+hash.pdb in the directory target/xxx/deps/. Then when the files are copied to target/xxx/, the .exe still references to the .pdb in the deps directory which also includes the hash in the name.

Then there are problems if the .pdb is distributed along the .exe. When someone tries to debug the program without the deps/ folder, the debugger doesn't find the symbols. I understand this is only a one-time issue per person (once they educate themselves on this behaviour) but it's not a good default.

Describe the solution you'd like

I tried looking up if there were previous discussions about it but couldn't find anything.

The only solution I could think of was creating the exe and pdb with the same name that should go into target/ and then copy them to deps/. I believe it's not a common practice to debug the files in deps/ so it shouldn't be an issue if the pdb link in that folder mismatches the name.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`O-windowsOS: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions