Closed tomaszstrejczek closed 1 year ago
We have been force-setting /Z7 on opt builds, in order to feed symbolic debugging information through the .obj files. This proposal looks very interesting! Our concern would revolve around being able to toggle it for opt builds.
Or second concern is carrying a massive amount of debugging weight on dbg builds in a typical //test/... scenario of a thousand tests. Those don't necessarily need symbolic debug info, so being able to toggle this off for specific groups of objects would be helpful. But all these comments are enhancement requests, looking forward to testing it out in practice at envoy.
@oquenchil do you have any thoughts on this?
I have one new thought. What if we introduced logic at cl command construction time to rewind over the earlier args, if /Z0 (zero) is presented, and delete all /Z[7Ii] arguments encounter (along with the /Z0 and any which incidently trigger those flags)? This might even work for constructing the rules_foreign_cc copts.
It would just be a matter of not taking the absence of a resulting .pdb as an error, then this patch would seamlessly work for objects generated Z7, Zi, or Z0
Closing this stale PR. In general we have been considering recently taking the current state of these duplicated files from bazel_tools, taking bazel_tools as the current correct state but making rules_cc the only source of truth.
Bazel already contains support for link-time .PDB files. The change uses fission to provide compile-time .PDB files support.