Skip to content

cc_proto_library doesn't get linked for binary with dynamic_deps #17091

@eagleonhill

Description

@eagleonhill

Description of the bug:

Because cc_proto_library doesn't use deps for linking dependencies, it's never part of GraphNodeInfo.
This happens even the cc_binary has empty list of dynamic_deps

As a result,

(link_statically_labels, link_dynamically_labels) = _separate_static_and_dynamic_link_libraries(graph_structure_aspect_nodes, can_be_linked_dynamically)
it's not statically nor dynamically linked.

if owner not in link_dynamically_labels and (owner in link_statically_labels or str(ctx.label) == owner):
Such libraries are excluded for build.

I made a local workaround by removing the 2nd term, that assumes all unknown targets are staticaly linked.

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

No response

Which operating system are you running Bazel on?

ubuntu

What is the output of bazel info release?

5.2.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 master; git rev-parse HEAD ?

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

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)team-Rules-CPPIssues for C++ rulestype: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions