bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Always output pdb_file when enabled

Open keith opened this issue 3 years ago • 6 comments

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

keith avatar Nov 07 '22 16:11 keith

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

keith avatar Nov 07 '22 16:11 keith

cc @meteorcloudy (since it's a behavior change)

brentleyjones avatar Dec 13 '22 19:12 brentleyjones

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

keith avatar Dec 13 '22 20:12 keith

/cc @oquenchil @buildbreaker2021

meteorcloudy avatar Dec 14 '22 09:12 meteorcloudy

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.

buildbreaker2021 avatar Dec 14 '22 10:12 buildbreaker2021

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

keith avatar Dec 14 '22 17:12 keith

im just going to ignore, feel free to pick this up if it's something you want fixed!

keith avatar Jan 10 '23 01:01 keith