Skip to content

Commit 67b12ea

Browse files
committed
For product_memberships, use the desc JSON filtered by the list of
actual products from the dump JSON.
1 parent 8d82d80 commit 67b12ea

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

swiftpkg/internal/pkginfos.bzl

+10-4
Original file line numberDiff line numberDiff line change
@@ -577,15 +577,21 @@ def _new_from_parsed_json(
577577
targets = []
578578
for target_map in dump_manifest["targets"]:
579579
tname = target_map["name"]
580+
tdesc_map = desc_targets_by_name[tname]
581+
582+
# Use the product_memberships from the desc_map, but only include
583+
# product names that actually exist in the dump products list. The
584+
# product_memberships from the desc JSON includes product inclusion that
585+
# we cannot determine using the conservative dump JSON.
580586
product_memberships = [
581-
product.name
582-
for product in products
583-
if lists.contains(product.targets, tname)
587+
prod_name
588+
for prod_name in tdesc_map.get("product_memberships", [])
589+
if lists.contains(products, lambda p: p.name == prod_name)
584590
]
585591
target = _new_target_from_json_maps(
586592
repository_ctx = repository_ctx,
587593
dump_map = target_map,
588-
desc_map = desc_targets_by_name[tname],
594+
desc_map = tdesc_map,
589595
product_memberships = product_memberships,
590596
pkg_path = pkg_path,
591597
collect_src_info = collect_src_info,

0 commit comments

Comments
 (0)