Skip to content

Removed ios_static_framework and tvos_static_framework macros.#1447

Merged
keith merged 6 commits intomasterfrom
ks/removed-ios_static_framework-and-tvos_static_framework-macros
Jul 7, 2022
Merged

Removed ios_static_framework and tvos_static_framework macros.#1447
keith merged 6 commits intomasterfrom
ks/removed-ios_static_framework-and-tvos_static_framework-macros

Conversation

@keith
Copy link
Copy Markdown
Member

@keith keith commented Apr 25, 2022

This change refactors current ios/tvos static framework macros that are
currently wrapping dependencies under a apple_static_library target to
link static libraries, to use apple_common.link_multi_arch_static_library
API instead.

Additionally, deps cfg was set to use apple_common.multi_arch_split,
and the static_framework_transition was deprecated, and setting the
emit_swiftinterface setting is now done at rule level using the
apple_rule_transition using a rule private attribute.

Finally, this change deprecates swift_static_framework aspect to use
the swift_framework partial instead. Since this partial requires a hash
of SwiftInfo providers keyed by architecture, the _cpu_string method
from transition_support was exposed to transform link output target
triplets to apple_common.multi_arch_split transition keys.

PiperOrigin-RevId: 440942096
(cherry picked from commit 624efd5)

keith referenced this pull request Apr 25, 2022
This change refactors current ios/tvos static framework macros that are
currently wrapping dependencies under a `apple_static_library` target to
link static libraries, to use `apple_common.link_multi_arch_static_library`
API instead.

Additionally, `deps` cfg was set to use `apple_common.multi_arch_split`,
and the `static_framework_transition` was deprecated, and setting the
`emit_swiftinterface` setting is now done at rule level using the
`apple_rule_transition` using a rule private attribute.

Finally, this change deprecates `swift_static_framework` aspect to use
the `swift_framework` partial instead. Since this partial requires a hash
of SwiftInfo providers keyed by architecture, the `_cpu_string` method
from `transition_support` was exposed to transform link output target
triplets to `apple_common.multi_arch_split` transition keys.

PiperOrigin-RevId: 440942096
@keith
Copy link
Copy Markdown
Member Author

keith commented Apr 25, 2022

this was rolled back on upstream here 26cf688 so i think it'll need some fixes later. either way it's blocked on bazel releases probably

@lyft-lint-bot
Copy link
Copy Markdown

Lyft integration job started: https://buildkite.com/lyft/rules-apple/builds/535 (must be Lyft employee to view)

keith referenced this pull request May 2, 2022
PiperOrigin-RevId: 441017420
keith referenced this pull request May 2, 2022
PiperOrigin-RevId: 444695728
@lyft-lint-bot
Copy link
Copy Markdown

Lyft integration job started: https://buildkite.com/lyft/rules-apple/builds/563 (must be Lyft employee to view)

@keith keith force-pushed the ks/removed-ios_static_framework-and-tvos_static_framework-macros branch from 48644f7 to e1d96d6 Compare May 18, 2022 04:01
@lyft-lint-bot
Copy link
Copy Markdown

Lyft integration job started: https://buildkite.com/lyft/rules-apple/builds/609 (must be Lyft employee to view)

@lyft-lint-bot
Copy link
Copy Markdown

Lyft integration job started: https://buildkite.com/lyft/rules-apple/builds/610 (must be Lyft employee to view)

@keith
Copy link
Copy Markdown
Member Author

keith commented May 18, 2022

I was wrong about the rollback order, everything was done again

keith referenced this pull request May 18, 2022
Recent macro removal for `ios_static_framework` and `tvos_static_framework`
introduced a method to map `apple_common.link_multi_arch_static_library`
to split transition keys for `apple_common.multi_arch_split` that didn't support
`sim_arm64` cpu redirection.

Additionally, this change introduces `cpus` attribute to `apple_verification_test`,
to be able to override cpu flags on target under tests (and removed previously
introduced `macos_cpus` attribute introduced by apple_universal_binary).

PiperOrigin-RevId: 445191710
keith referenced this pull request May 18, 2022
…Mach-O load command tests.

PiperOrigin-RevId: 446810307
@keith
Copy link
Copy Markdown
Member Author

keith commented May 23, 2022

this uses the new api that requires bazel 6.x+

@keith keith force-pushed the ks/removed-ios_static_framework-and-tvos_static_framework-macros branch from a16abc8 to 5488d90 Compare July 7, 2022 00:49
keith added a commit that referenced this pull request Jul 7, 2022
This is a partial commit of
#1447 which includes some
more changes removing macros that would break bazel 5.x compat. So with
this change we retain the `_static_framework_transition` for now, and we
can delete it as part of merging that PR
keith added a commit that referenced this pull request Jul 7, 2022
This is a partial cherry pick from
#1447 which we're delaying
merging temporarily until we only support 6.x
keith added a commit that referenced this pull request Jul 7, 2022
This is a partial cherry pick from
#1447 which we're delaying
merging temporarily until we only support 6.x
keith added a commit that referenced this pull request Jul 7, 2022
This is a partial cherry pick from
#1447 which we're delaying
merging temporarily until we only support 6.x
keith added a commit that referenced this pull request Jul 7, 2022
This is a partial cherry pick from
#1447 which we're delaying
merging temporarily until we only support 6.x
stravinskii and others added 6 commits July 7, 2022 10:50
This change refactors current ios/tvos static framework macros that are
currently wrapping dependencies under a `apple_static_library` target to
link static libraries, to use `apple_common.link_multi_arch_static_library`
API instead.

Additionally, `deps` cfg was set to use `apple_common.multi_arch_split`,
and the `static_framework_transition` was deprecated, and setting the
`emit_swiftinterface` setting is now done at rule level using the
`apple_rule_transition` using a rule private attribute.

Finally, this change deprecates `swift_static_framework` aspect to use
the `swift_framework` partial instead. Since this partial requires a hash
of SwiftInfo providers keyed by architecture, the `_cpu_string` method
from `transition_support` was exposed to transform link output target
triplets to `apple_common.multi_arch_split` transition keys.

PiperOrigin-RevId: 440942096
(cherry picked from commit 624efd5)
PiperOrigin-RevId: 441017420
(cherry picked from commit 26cf688)
PiperOrigin-RevId: 444695728
(cherry picked from commit 52d7b37)
Recent macro removal for `ios_static_framework` and `tvos_static_framework`
introduced a method to map `apple_common.link_multi_arch_static_library`
to split transition keys for `apple_common.multi_arch_split` that didn't support
`sim_arm64` cpu redirection.

Additionally, this change introduces `cpus` attribute to `apple_verification_test`,
to be able to override cpu flags on target under tests (and removed previously
introduced `macos_cpus` attribute introduced by apple_universal_binary).

PiperOrigin-RevId: 445191710
(cherry picked from commit 94b3ad9)
…Mach-O load command tests.

PiperOrigin-RevId: 446810307
(cherry picked from commit 0fa0426)
@keith keith force-pushed the ks/removed-ios_static_framework-and-tvos_static_framework-macros branch from 5488d90 to 7b13e06 Compare July 7, 2022 17:50
@keith keith marked this pull request as ready for review July 7, 2022 17:50
@keith keith enabled auto-merge (rebase) July 7, 2022 17:50
@keith keith disabled auto-merge July 7, 2022 17:50
@keith keith enabled auto-merge (squash) July 7, 2022 17:51
Comment on lines +1384 to 1396
avoid_deps = ctx.attr.avoid_deps
deps = ctx.attr.deps
label = ctx.label
predeclared_outputs = ctx.outputs
split_deps = ctx.split_attr.deps
bundle_name, bundle_extension = bundling_support.bundle_full_name_from_rule_ctx(ctx)
executable_name = bundling_support.executable_name(ctx)
features = features_support.compute_enabled_features(
requested_features = ctx.features,
unsupported_features = ctx.disabled_features,
)
label = ctx.label
platform_prerequisites = platform_support.platform_prerequisites_from_rule_ctx(ctx)
predeclared_outputs = ctx.outputs
resource_deps = ctx.attr.deps + ctx.attr.resources
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorta annoying that these are moved around, and are no longer alphabetical.

Copy link
Copy Markdown
Member Author

@keith keith Jul 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙃

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not worth fixing and hitting more conflicts ¯_(ツ)_/¯

@keith keith deleted the ks/removed-ios_static_framework-and-tvos_static_framework-macros branch July 7, 2022 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants