Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace apple_common.multi_arch_split with new transition #2034

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ x_defaults:
test_flags:
- --test_tag_filters=-skipci
common_last_green: &common_last_green
bazel: d9939570353e21ba4d8b8e986b30b753a0f29c5d
bazel: last_green
test_flags:
- --test_tag_filters=-skipci

Expand Down
2 changes: 1 addition & 1 deletion apple/internal/apple_universal_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The `lipo` tool is used to combine built binaries of multiple architectures.
additional_attrs = {
"binary": attr.label(
mandatory = True,
cfg = apple_common.multi_arch_split,
cfg = transition_support.apple_platform_split_transition,
doc = "Target to generate a 'fat' binary from.",
),
"forced_cpus": attr.string_list(
Expand Down
12 changes: 6 additions & 6 deletions apple/internal/rule_factory.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ _COMMON_ATTRS = dicts.add(
apple_support.action_required_attrs(),
)

def _common_linking_api_attrs(*, cfg = apple_common.multi_arch_split):
def _common_linking_api_attrs(*, cfg = transition_support.apple_platform_split_transition):
"""Returns dictionary of required attributes for Bazel Apple linking API's.

These rule attributes are required by both Bazel Apple linking API's under apple_common module:
Expand All @@ -132,15 +132,15 @@ def _common_linking_api_attrs(*, cfg = apple_common.multi_arch_split):
),
}

def _link_multi_arch_static_library_attrs(*, cfg = apple_common.multi_arch_split):
def _link_multi_arch_static_library_attrs(*, cfg = transition_support.apple_platform_split_transition):
"""Returns dictionary of required attributes for apple_common.link_multi_arch_static_library.

Args:
cfg: Bazel split transition to use on attrs.
"""
return _common_linking_api_attrs(cfg = cfg)

def _link_multi_arch_binary_attrs(*, cfg = apple_common.multi_arch_split):
def _link_multi_arch_binary_attrs(*, cfg = transition_support.apple_platform_split_transition):
"""Returns dictionary of required attributes for apple_common.link_multi_arch_binary.

Args:
Expand Down Expand Up @@ -887,7 +887,7 @@ umbrella header will be generated under the same name as this target.
""",
),
"avoid_deps": attr.label_list(
cfg = apple_common.multi_arch_split,
cfg = transition_support.apple_platform_split_transition,
doc = """
A list of library targets on which this framework depends in order to compile, but the transitive
closure of which will not be linked into the framework's binary.
Expand Down Expand Up @@ -1158,7 +1158,7 @@ umbrella header will be generated under the same name as this target.
""",
),
"avoid_deps": attr.label_list(
cfg = apple_common.multi_arch_split,
cfg = transition_support.apple_platform_split_transition,
doc = """
A list of library targets on which this framework depends in order to compile, but the transitive
closure of which will not be linked into the framework's binary.
Expand Down Expand Up @@ -1344,7 +1344,7 @@ binaries/libraries will be created combining all architectures specified by
is_executable = False
if require_linking_attrs:
rule_attrs.append(_common_binary_linking_attrs(
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
product_type = None,
))
else:
Expand Down
62 changes: 31 additions & 31 deletions apple/internal/rule_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _describe_rule_type(
default_test_runner: Default test runner to set in the runner attribute. Only used for
tests.
deps_cfg: The configuration for the deps attribute. This should be None for rules that use
the apple_binary intermediate target, and apple_common.multi_arch_split for the rules
the apple_binary intermediate target, and transition_support.apple_platform_split_transition for the rules
that use the Starlark linking API.
expose_non_archive_relative_output: Whether or not to expose an output archive that ignores
the `archive_relative` bundle location, to permit embedding within another target. Has no
Expand Down Expand Up @@ -218,7 +218,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".app",
bundle_locations = _describe_bundle_locations(archive_relative = "Payload"),
bundle_package_type = bundle_package_type.application,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
has_alternate_icons = True,
has_launch_images = True,
has_settings_bundle = True,
Expand All @@ -242,7 +242,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".app",
bundle_locations = _describe_bundle_locations(archive_relative = "Payload"),
bundle_package_type = bundle_package_type.application,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
expose_non_archive_relative_output = True,
is_executable = True,
mandatory_families = True,
Expand All @@ -262,7 +262,7 @@ _RULE_TYPE_DESCRIPTORS = {
app_icon_extension = ".appiconset",
bundle_extension = ".appex",
bundle_package_type = bundle_package_type.extension_or_xpc,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-fapplication-extension",
"-e",
Expand All @@ -284,7 +284,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".framework",
bundle_package_type = bundle_package_type.framework,
codesigning_exceptions = _CODESIGNING_EXCEPTIONS.sign_with_provisioning_profile,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
mandatory_families = True,
product_type = apple_product_type.framework,
rpaths = [
Expand Down Expand Up @@ -321,7 +321,7 @@ _RULE_TYPE_DESCRIPTORS = {
app_icon_extension = ".stickersiconset",
bundle_extension = ".appex",
bundle_package_type = bundle_package_type.extension_or_xpc,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-fapplication-extension",
"-e",
Expand Down Expand Up @@ -369,7 +369,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_package_type = bundle_package_type.bundle,
default_infoplist = "@build_bazel_rules_apple//apple/testing:DefaultTestBundlePlist",
default_test_runner = "@build_bazel_rules_apple//apple/testing/default_runner:ios_default_runner",
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-framework",
"XCTest",
Expand All @@ -392,7 +392,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_package_type = bundle_package_type.bundle,
default_infoplist = "@build_bazel_rules_apple//apple/testing:DefaultTestBundlePlist",
default_test_runner = "@build_bazel_rules_apple//apple/testing/default_runner:ios_default_runner",
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-framework",
"XCTest",
Expand All @@ -419,7 +419,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".app",
bundle_locations = _DEFAULT_MACOS_BUNDLE_LOCATIONS,
bundle_package_type = bundle_package_type.application,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
is_executable = True,
product_type = apple_product_type.application,
provisioning_profile_extension = ".provisionprofile",
Expand All @@ -435,7 +435,7 @@ _RULE_TYPE_DESCRIPTORS = {
apple_product_type.tool: _describe_rule_type(
allowed_device_families = ["mac"],
bundle_extension = "",
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
is_executable = True,
product_type = apple_product_type.tool,
provisioning_profile_extension = ".provisionprofile",
Expand All @@ -446,7 +446,7 @@ _RULE_TYPE_DESCRIPTORS = {
apple_product_type.dylib: _describe_rule_type(
allowed_device_families = ["mac"],
bundle_extension = "",
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
product_type = apple_product_type.dylib,
requires_signing_for_device = False,
),
Expand All @@ -459,7 +459,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".appex",
bundle_locations = _DEFAULT_MACOS_BUNDLE_LOCATIONS,
bundle_package_type = bundle_package_type.extension_or_xpc,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-fapplication-extension",
"-e",
Expand All @@ -484,7 +484,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".qlgenerator",
bundle_locations = _DEFAULT_MACOS_BUNDLE_LOCATIONS,
bundle_package_type = bundle_package_type.extension_or_xpc,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
product_type = apple_product_type.quicklook_plugin,
provisioning_profile_extension = ".provisionprofile",
requires_deps = True,
Expand All @@ -498,7 +498,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".bundle",
bundle_locations = _DEFAULT_MACOS_BUNDLE_LOCATIONS,
bundle_package_type = bundle_package_type.bundle,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
product_type = apple_product_type.bundle,
provisioning_profile_extension = ".provisionprofile",
requires_signing_for_device = False,
Expand All @@ -516,7 +516,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".kext",
bundle_locations = _DEFAULT_MACOS_BUNDLE_LOCATIONS,
bundle_package_type = bundle_package_type.kernel_extension,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
# This was added for b/122473338, and should be removed eventually once symbol
# stripping is better-handled. It's redundant with an option added in the CROSSTOOL
# for the "kernel_extension" feature, but for now it's necessary to detect kext
Expand All @@ -535,7 +535,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".mdimporter",
bundle_locations = _DEFAULT_MACOS_BUNDLE_LOCATIONS,
bundle_package_type = bundle_package_type.extension_or_xpc,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
product_type = apple_product_type.spotlight_importer,
provisioning_profile_extension = ".provisionprofile",
requires_deps = True,
Expand All @@ -547,7 +547,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".xpc",
bundle_locations = _DEFAULT_MACOS_BUNDLE_LOCATIONS,
bundle_package_type = bundle_package_type.extension_or_xpc,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
product_type = apple_product_type.xpc_service,
provisioning_profile_extension = ".provisionprofile",
requires_deps = True,
Expand All @@ -570,7 +570,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_package_type = bundle_package_type.bundle,
default_infoplist = "@build_bazel_rules_apple//apple/testing:DefaultTestBundlePlist",
default_test_runner = "@build_bazel_rules_apple//apple/testing/default_runner:macos_default_runner",
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-framework",
"XCTest",
Expand All @@ -594,7 +594,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_package_type = bundle_package_type.bundle,
default_infoplist = "@build_bazel_rules_apple//apple/testing:DefaultTestBundlePlist",
default_test_runner = "@build_bazel_rules_apple//apple/testing/default_runner:macos_default_runner",
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-framework",
"XCTest",
Expand All @@ -616,7 +616,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".framework",
bundle_package_type = bundle_package_type.framework,
codesigning_exceptions = _CODESIGNING_EXCEPTIONS.sign_with_provisioning_profile,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
mandatory_families = True,
provisioning_profile_extension = ".provisionprofile",
product_type = apple_product_type.framework,
Expand All @@ -634,7 +634,7 @@ _RULE_TYPE_DESCRIPTORS = {
allowed_device_families = ["mac"],
bundle_extension = ".framework",
codesigning_exceptions = _CODESIGNING_EXCEPTIONS.skip_signing,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
has_infoplist = False,
product_type = apple_product_type.static_framework,
requires_bundle_id = False,
Expand All @@ -652,7 +652,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".app",
bundle_locations = _describe_bundle_locations(archive_relative = "Payload"),
bundle_package_type = bundle_package_type.application,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
has_launch_images = True,
has_settings_bundle = True,
is_executable = True,
Expand All @@ -670,7 +670,7 @@ _RULE_TYPE_DESCRIPTORS = {
allows_locale_trimming = True,
bundle_extension = ".appex",
bundle_package_type = bundle_package_type.extension_or_xpc,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-e",
"_TVExtensionMain",
Expand All @@ -693,7 +693,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".framework",
bundle_package_type = bundle_package_type.framework,
codesigning_exceptions = _CODESIGNING_EXCEPTIONS.sign_with_provisioning_profile,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
product_type = apple_product_type.framework,
rpaths = [
# Framework binaries live in
Expand Down Expand Up @@ -722,7 +722,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_package_type = bundle_package_type.bundle,
default_infoplist = "@build_bazel_rules_apple//apple/testing:DefaultTestBundlePlist",
default_test_runner = "@build_bazel_rules_apple//apple/testing/default_runner:tvos_default_runner",
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-framework",
"XCTest",
Expand All @@ -745,7 +745,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_package_type = bundle_package_type.bundle,
default_infoplist = "@build_bazel_rules_apple//apple/testing:DefaultTestBundlePlist",
default_test_runner = "@build_bazel_rules_apple//apple/testing/default_runner:tvos_default_runner",
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-framework",
"XCTest",
Expand Down Expand Up @@ -783,7 +783,7 @@ _RULE_TYPE_DESCRIPTORS = {
allows_locale_trimming = True,
bundle_extension = ".appex",
bundle_package_type = bundle_package_type.extension_or_xpc,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-fapplication-extension",
],
Expand All @@ -802,7 +802,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_extension = ".framework",
bundle_package_type = bundle_package_type.framework,
codesigning_exceptions = _CODESIGNING_EXCEPTIONS.sign_with_provisioning_profile,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
product_type = apple_product_type.framework,
rpaths = [
# Framework binaries live in
Expand All @@ -818,7 +818,7 @@ _RULE_TYPE_DESCRIPTORS = {
allowed_device_families = ["watch"],
bundle_extension = ".framework",
codesigning_exceptions = _CODESIGNING_EXCEPTIONS.skip_signing,
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
has_infoplist = False,
product_type = apple_product_type.static_framework,
requires_bundle_id = False,
Expand All @@ -831,7 +831,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_package_type = bundle_package_type.bundle,
default_infoplist = "@build_bazel_rules_apple//apple/testing:DefaultTestBundlePlist",
default_test_runner = "@build_bazel_rules_apple//apple/testing/default_runner:watchos_default_runner",
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-framework",
"XCTest",
Expand All @@ -854,7 +854,7 @@ _RULE_TYPE_DESCRIPTORS = {
bundle_package_type = bundle_package_type.bundle,
default_infoplist = "@build_bazel_rules_apple//apple/testing:DefaultTestBundlePlist",
default_test_runner = "@build_bazel_rules_apple//apple/testing/default_runner:watchos_default_runner",
deps_cfg = apple_common.multi_arch_split,
deps_cfg = transition_support.apple_platform_split_transition,
extra_linkopts = [
"-framework",
"XCTest",
Expand Down
4 changes: 2 additions & 2 deletions apple/internal/testing/build_test_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ number (for example, `"9.0"`).
""",
),
"targets": attr.label_list(
cfg = apple_common.multi_arch_split,
cfg = transition_support.apple_platform_split_transition,
doc = "The targets to check for successful build.",
# Since `CcInfo` is the currency provider for rules that
# propagate libraries for linking to Apple bundles, this is
Expand All @@ -89,7 +89,7 @@ number (for example, `"9.0"`).
providers = [[CcInfo]],
),
# This is a public attribute due to an implementation detail of
# `apple_common.multi_arch_split`. The private attribute of the
# `transition_support.apple_platform_split_transition`. The private attribute of the
# same name is used in the implementation function to verify that
# the user has not modified it.
"platform_type": attr.string(default = platform_type),
Expand Down