Skip to content

Windows feature generate_pdb_file should be applicable to opt builds #94

@sunjayBhatia

Description

@sunjayBhatia

Description of the problem / feature request:

We would like to generate .pdb files for release builds of Envoy for Windows for use debugging potential production issues. This works well with Bazel building locally as all intermediate/compiler/linker generated files live on the host. We use opt mode, the MSVC cl /Z7 option, and linker options /DEBUG:FULL. However, building Envoy with RBE in CI, the expected .pdb file output is not accessible. It is not an explicit output of the cc_binary rule on Windows and is not downloaded to the host running the build (or presumably any rules that were to depend on the binary target, not sure if a genrule workaround could work to grab the relevant file). This is in contrast to Linux where cc_binary rules create an implicit <target>.dwp target that can be used to access debug info. Using --remote_download_outputs=all (the default) or --features=generate_pdb_file does not work as the feature is only enabled for dbg and fastbuild compilation modes.

It would be great if the restriction of the feature to dbg and fastbuild modes was relaxed

Feature requests: what underlying problem are you trying to solve with this feature?

See above, generate .pdb files as when building Envoy with RBE in opt compilation mode.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Build a cc_binary rule in opt compilation mode and link with MSVC link /DEBUG options to generate a .pdb file in RBE on Windows. See that no .pdb file is downloaded even when using --features=generate_pdb_file or --remote_download_outputs=all.

What operating system are you running Bazel on?

Windows (2019)

What's the output of bazel info release?

release 3.6.0

What version of rules_cc do you use? Can you paste the workspace rule used to fetch rules_cc? What other relevant dependencies does your project have?

https://github.com/envoyproxy/envoy/blob/d382fa60412b1bf3c8b1d82883119c15216d69fc/bazel/repository_locations.bzl#L535-L546

What Bazel options do you use to trigger the issue? What C++ toolchain do you use?

C++ toolchain: https://github.com/envoyproxy/envoy-build-tools/tree/master/toolchains/configs/windows/msvc-cl/bazel_3.6.0 (generated via bazel-toolchains)

Have you found anything relevant by searching the web?

Not as of yet

Any other information, logs, or outputs that you want to share?

Not as of yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions