Skip to content

Commit

Permalink
Add validation for platform type attribute in `apple_{,static}_xcfram…
Browse files Browse the repository at this point in the history
…ework` rules (#2313)

The platform type attributes (`ios`, `tvos`,...) aren't mandatory, but
at least one of them has to be set. It wasn't clear in the documentation
that one of these is required, because there is another attribute
`minimum_os_versions` which also mentions platform types.

Previously not setting any of these led to an error in:

```
Error in link_multi_arch_static_library: unexpected empty key in split transition
```

which wasn't that much useful.
  • Loading branch information
thii authored Oct 30, 2023
1 parent bba2dc7 commit 17f4203
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apple/internal/transition_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,11 @@ def _xcframework_transition_impl(settings, attr):
target_environments = target_environments,
)
output_dictionary = dicts.add(command_line_options, output_dictionary)

if not output_dictionary:
fail("Missing a platform type attribute. At least one of 'ios', " +
"'tvos', 'visionos', 'watchos', or 'macos' attribute is mandatory.")

return output_dictionary

_xcframework_transition = transition(
Expand Down

0 comments on commit 17f4203

Please sign in to comment.