bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.32k stars 4.1k forks source link

--fission yes does not work when using nested cc_library #22599

Open hoofk opened 6 months ago

hoofk commented 6 months ago

Description of the bug:

building with --fission yes should produce a .dwp file. When using a nested cc_library a real .lo file is created, but the final .dwp file is empty

Which category does this issue belong to?

C++ Rules

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

`load("@rules_cc//cc:defs.bzl", "cc_binary")

cc_library ( name = "main_lib-c", srcs = ["hello-world.cc"], alwayslink = 1, ) cc_library ( name = "main_lib", srcs = ['main_lib-c'], linkstatic = 1, ) cc_binary( name = "hello-world", deps = [':main_lib'], )`

and run : bazel-6.5.0-linux-x86_64 --output_base=base build //main:hello-world //main:hello-world.dwp -c dbg --fission yes

Which operating system are you running Bazel on?

Rocky Linux release 8.8 (Green Obsidian)

What is the output of bazel info release?

release 6.5.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

No response

Have you found anything relevant by searching the web?

No response

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

No response

comius commented 5 months ago

Checking the code, it looks like dwps are intentionally disabled with fission.

hoofk commented 5 months ago

https://bazel.build/rules/lib/providers/DebugPackageInfo#dwp_file says

File DebugPackageInfo.dwp_file Returns the .dwp file (for fission builds) or null if --fission=no. May return None. This indicates that .dwp files should be used with --fission=yes

If dwps are disabled with fission, how to enable them ?