bazelbuild / rules_cc

C++ Rules for Bazel
https://bazel.build
Apache License 2.0
186 stars 93 forks source link

Provide MSVC compiler PDB support #78

Closed tomaszstrejczek closed 1 year ago

tomaszstrejczek commented 4 years ago

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

wrowe commented 3 years 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.

sunjayBhatia commented 3 years ago

@oquenchil do you have any thoughts on this?

wrowe commented 3 years ago

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

oquenchil commented 1 year ago

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.