Always output pdb_file when enabled
It seems that with the java implementation of cc_binary, the pdb_file was always output even if the explicit output group wasn't requested because of:
https://github.com/bazelbuild/bazel/blob/a67c823938dcc426952d25b3a68b825cbe5f6586/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java#L809-L811
This mirrors that behavior. If folks don't want this to be generated they can pass --features=-generate_pdb_file
I don't feel strongly about this, but I figured I would flag it since it appears to be a behavior change. More context: https://bazelbuild.slack.com/archives/CGA9QFQ8H/p1667257515473869
cc @meteorcloudy (since it's a behavior change)
im sure this test is fixable, i don't have a windows machine to test on so this iteration cycle is annoying. if there's interest in landing this lmk
/cc @oquenchil @buildbreaker2021
Hey Keith,
Thanks for bringing this up.
Considering that Java implementation of CcBinary is deleted this might be a bit tough, but have you checked if for Java version of cc_binary pdb_file was generated while it was not for Starlark one?
The reason for asking this is that I would not expect a behavior change here because link call in cc_binary: https://github.com/bazelbuild/bazel/blob/master/src/main/starlark/builtins_bzl/common/cc/cc_binary.bzl#L500-L524 is setting pdb_file attribute. That Starlark link call calls into: https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/cpp/CcModule.java#L2609
Which in itself will call the code you linked. That's why I don't think anything should have changed, though this is from skimming through codebase and I might have missed something.
It's possible I linked the wrong change. But somehow this changed in the wild for us https://github.com/envoyproxy/envoy/pull/23678/files
im just going to ignore, feel free to pick this up if it's something you want fixed!