rules_cc icon indicating copy to clipboard operation
rules_cc copied to clipboard

Provide MSVC compiler PDB support

Open tomaszstrejczek opened this issue 5 years ago • 3 comments

Bazel already contains support for link-time .PDB files. The change uses fission to provide compile-time .PDB files support.

tomaszstrejczek avatar Sep 15 '20 15:09 tomaszstrejczek

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.

wrowe avatar Nov 12 '20 16:11 wrowe

@oquenchil do you have any thoughts on this?

sunjayBhatia avatar Dec 14 '20 21:12 sunjayBhatia

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

wrowe avatar Dec 14 '20 21:12 wrowe

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.

oquenchil avatar Mar 13 '23 11:03 oquenchil