Skip to content

Commit 6983cb3

Browse files
committed
Traverse CrateGroupInfo when gathering CcInfo linking_context entries for use_cc_common_link
This fixes rust_library_group and rust_prost_library for experimental_use_cc_common_link
1 parent cdaf15f commit 6983cb3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

rust/private/rustc.bzl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,9 +1580,12 @@ def rustc_compile_action(
15801580
toolchain.stdlib_linkflags.linking_context,
15811581
]
15821582

1583-
for dep in crate_info.deps.to_list():
1584-
if dep.cc_info:
1585-
linking_contexts.append(dep.cc_info.linking_context)
1583+
linking_contexts += [
1584+
ddep.cc_info.linking_context
1585+
for dep in crate_info.deps.to_list()
1586+
for ddep in (dep.crate_group_info.dep_variant_infos.to_list() if dep.crate_group_info else [dep])
1587+
if ddep.cc_info
1588+
]
15861589

15871590
# In the cc_common.link action we need to pass the name of the final
15881591
# binary (output) relative to the package of this target.

0 commit comments

Comments
 (0)