Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc_library doesn't collect debug_context(s) from implementation_deps #19146

Closed
anhlinh123 opened this issue Aug 2, 2023 · 1 comment
Closed
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-CPP Issues for C++ rules type: bug

Comments

@anhlinh123
Copy link

anhlinh123 commented Aug 2, 2023

Description of the bug:

Currently, cc_library only merges debug_context(s) from deps and forward them to its dependents.
Consequently, cc_binary can't generate a dwp file containing sufficient debug info.

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.

cc_library(
name = "lib",
implementation_deps = ["impl_dep1, impl_dep2"],
)

# the file ":bin.dwp" doesn't have all the debug info from "impl_dep1", "impl_dep2"
cc_binary(
name = "bin",
deps = ["lib"],
)

Which operating system are you running Bazel on?

Ubuntu

What is the output of bazel info release?

release 6.1.1

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 master; 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?

I believe this line https://github.com/bazelbuild/bazel/blob/master/src/main/starlark/builtins_bzl/common/cc/cc_library.bzl#L309C123-L309C123
should be changed to:
debug_context = cc_helper.merge_cc_debug_contexts(compilation_outputs, cc_helper.get_providers(ctx.attr.deps + ctx.attr.implementation_deps, CcInfo))

@Pavank1992 Pavank1992 added the team-Rules-CPP Issues for C++ rules label Aug 2, 2023
@buildbreaker2021 buildbreaker2021 self-assigned this Aug 16, 2023
@buildbreaker2021 buildbreaker2021 added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Aug 16, 2023
iancha1992 pushed a commit to iancha1992/bazel that referenced this issue Oct 16, 2023
Fixes bazelbuild#19146

Closes bazelbuild#19725.

PiperOrigin-RevId: 573751305
Change-Id: I9b5df85dc5e52822b3a0b44fc42d90b727a5abf0
iancha1992 pushed a commit to iancha1992/bazel that referenced this issue Oct 16, 2023
Fixes bazelbuild#19146

Closes bazelbuild#19725.

PiperOrigin-RevId: 573751305
Change-Id: I9b5df85dc5e52822b3a0b44fc42d90b727a5abf0
iancha1992 pushed a commit to iancha1992/bazel that referenced this issue Oct 16, 2023
Fixes bazelbuild#19146

Closes bazelbuild#19725.

PiperOrigin-RevId: 573751305
Change-Id: I9b5df85dc5e52822b3a0b44fc42d90b727a5abf0
keertk pushed a commit that referenced this issue Oct 16, 2023
Fixes #19146

Closes #19725.

Commit
e55fee2

PiperOrigin-RevId: 573751305
Change-Id: I9b5df85dc5e52822b3a0b44fc42d90b727a5abf0

Co-authored-by: Thi Don <t@thi.im>
@iancha1992
Copy link
Member

A fix for this issue has been included in Bazel 6.4.0 RC4. Please test out the release candidate and report any issues as soon as possible. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-CPP Issues for C++ rules type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants