Skip to content

Commit

Permalink
For product_memberships, use the desc JSON filtered by the list of
Browse files Browse the repository at this point in the history
actual products from the dump JSON.
  • Loading branch information
cgrindel committed May 14, 2024
1 parent 3626d31 commit 8ac2c18
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions swiftpkg/internal/pkginfos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -577,15 +577,21 @@ def _new_from_parsed_json(
targets = []
for target_map in dump_manifest["targets"]:
tname = target_map["name"]
tdesc_map = desc_targets_by_name[tname]

# Use the product_memberships from the desc_map, but only include
# product names that actually exist in the dump products list. The
# product_memberships from the desc JSON includes product inclusion that
# we cannot determine using the conservative dump JSON.
product_memberships = [
product.name
for product in products
if lists.contains(product.targets, tname)
prod_name
for prod_name in tdesc_map.get("product_memberships", [])
if lists.contains(products, lambda p: p.name == prod_name)
]
target = _new_target_from_json_maps(
repository_ctx = repository_ctx,
dump_map = target_map,
desc_map = desc_targets_by_name[tname],
desc_map = tdesc_map,
product_memberships = product_memberships,
pkg_path = pkg_path,
collect_src_info = collect_src_info,
Expand Down

0 comments on commit 8ac2c18

Please sign in to comment.