When compiling a rust project via cargo, even in release mode, it generates a pdb file, and the full path (Including my username, which has my real name) can be found in it. Is there a way to truncate these file names, or even better, not use external files at all?
Asked
Active
Viewed 64 times
0
-
I assume you've already thought of some of the the more obvious methods, like working in a different path, adding a new user, using a generic VM / container, letting the binaries you intend to be published be built on CI, or just not publish that pdb file? – Caesar May 04 '23 at 11:35
1 Answers
3
To remove generation of PDB files, add this to your Cargo.toml
file:
[profile.release]
debug = false
If you want to generate the PDB file, but not to include debugging symbols in the PDB file, use debug = 1
instead of false.

Jishan Shaikh
- 1,572
- 2
- 13
- 31