Skip to content

Commit

Permalink
Fix missing ownership (#1747)
Browse files Browse the repository at this point in the history
  • Loading branch information
mccorkill1 authored Nov 4, 2022
1 parent c17af58 commit f8b14ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions apple/internal/partials/resources.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ def _resources_partial_impl(
infoplists.extend(result.infoplists)

resources.deduplicate(
default_owner = str(rule_label),
resources_provider = final_provider,
avoid_providers = avoid_providers,
field_handler = _deduplicated_field_handler,
Expand Down
3 changes: 2 additions & 1 deletion apple/internal/resources.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -880,12 +880,13 @@ def _deduplicate_field(

return deduped_tuples

def _deduplicate(*, resources_provider, avoid_providers, field_handler):
def _deduplicate(*, resources_provider, avoid_providers, field_handler, default_owner = None):
avoid_provider = None
if avoid_providers:
# Call merge_providers with validate_all_resources_owned set, to ensure that all the
# resources from dependency bundles have an owner.
avoid_provider = _merge_providers(
default_owner = default_owner,
providers = avoid_providers,
validate_all_resources_owned = True,
)
Expand Down
3 changes: 2 additions & 1 deletion doc/rules-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ A list with all the collected resources for the target represented by attr.
## resources_common.deduplicate

<pre>
resources_common.deduplicate(<a href="#resources_common.deduplicate-resources_provider">resources_provider</a>, <a href="#resources_common.deduplicate-avoid_providers">avoid_providers</a>, <a href="#resources_common.deduplicate-field_handler">field_handler</a>)
resources_common.deduplicate(<a href="#resources_common.deduplicate-resources_provider">resources_provider</a>, <a href="#resources_common.deduplicate-avoid_providers">avoid_providers</a>, <a href="#resources_common.deduplicate-field_handler">field_handler</a>, <a href="#resources_common.deduplicate-default_owner">default_owner</a>)
</pre>


Expand All @@ -391,6 +391,7 @@ resources_common.deduplicate(<a href="#resources_common.deduplicate-resources_pr
| <a id="resources_common.deduplicate-resources_provider"></a>resources_provider | <p align="center"> - </p> | none |
| <a id="resources_common.deduplicate-avoid_providers"></a>avoid_providers | <p align="center"> - </p> | none |
| <a id="resources_common.deduplicate-field_handler"></a>field_handler | <p align="center"> - </p> | none |
| <a id="resources_common.deduplicate-default_owner"></a>default_owner | <p align="center"> - </p> | <code>None</code> |


<a id="resources_common.merge_providers"></a>
Expand Down

0 comments on commit f8b14ce

Please sign in to comment.