Skip to content

Add option to prevent including metadata in target name #6899

Closed
@wickerwaka

Description

@wickerwaka

Problem
When cargo builds a target is passes -C extra-filename=-... to rustc which produces an output file with a metadata suffix in the name. For windows targets this will produce foo-metadata.exe and foo-metadata.pdb files. It then copies and renames these files so the final result is foo.exe and foo.pdb.

However the debug data in a PE executable files stores the original name of the PDB file and this name is used when debuggers (Visual Studio, WinDbg or anything using dbghelp.dll) are searching for PDB files on symbol servers. So when looking for the PDB file for foo.exe, it will actually search for foo-metadata.pdb which has likely not been uploaded.

Possible Solution(s)
Ideally it would be possible to specify in the Cargo.toml that extra-filename should not be used for certain profiles, e.g.:

[profile.release]
add-extra-filename = false

Notes
Output of cargo version: cargo 1.33.0 (f099fe9 2019-02-12)

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`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions