Skip to content

Commit

Permalink
Fix duplicate files issue, remove 32 bit device arch
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Jul 15, 2022
1 parent 27eeb52 commit 40f7be2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
14 changes: 14 additions & 0 deletions apple/internal/transition_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,19 @@ def _command_line_options(

output_dictionary["@build_bazel_rules_swift//swift:emit_swiftinterface"] = emit_swiftinterface

# Without handling this flag our transition differs from what we get
# from bazel when the dependency tree contains a rule inheriting bazel's
# built in transitions. This flag should not be used, we can remove this
# once https://github.com/bazelbuild/bazel/pull/13872 is merged
if platform_type == "ios":
output_dictionary["//command_line_option:ios_cpu"] = _cpu_string(
cpu = cpu,
platform_type = platform_type,
settings = settings,
)
else:
output_dictionary["//command_line_option:ios_cpu"] = ""

return output_dictionary

def _xcframework_split_attr_key(*, cpu, environment, platform_type):
Expand Down Expand Up @@ -358,6 +371,7 @@ _apple_rule_base_transition_outputs = [
"//command_line_option:apple_split_cpu",
"//command_line_option:compiler",
"//command_line_option:cpu",
"//command_line_option:ios_cpu",
"//command_line_option:crosstool_top",
"//command_line_option:fission",
"//command_line_option:grte_top",
Expand Down
26 changes: 24 additions & 2 deletions test/starlark_tests/apple_xcframework_import_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,21 @@ def apple_xcframework_import_test_suite(name):
)

apple_verification_test(
name = "{}_xcfmwk_bundling_static_xcfmwks_codesign_test".format(name),
name = "{}_xcfmwk_bundling_static_xcfmwks_codesign_test_simulator".format(name),
build_type = "simulator",
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_imported_xcfmwk_bundling_static_fmwks",
verifier_script = "verifier_scripts/codesign_verifier.sh",
tags = [name],
)

apple_verification_test(
name = "{}_xcfmwk_bundling_static_xcfmwks_codesign_test_device".format(name),
build_type = "device",
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_imported_xcfmwk_bundling_static_fmwks",
verifier_script = "verifier_scripts/codesign_verifier.sh",
tags = [name],
)

# Test that apple_static_xcframework_import can import XCFrameworks
# bundling static libraries and make them usable from objc_library
analysis_target_outputs_test(
Expand All @@ -83,7 +91,7 @@ def apple_xcframework_import_test_suite(name):
)

archive_contents_test(
name = "{}_static_xcfw_binary_not_bundled".format(name),
name = "{}_static_xcfw_binary_not_bundled_simulator".format(name),
build_type = "simulator",
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_imported_xcfmwk_bundling_static_fmwks_with_resources",
contains = [
Expand All @@ -96,6 +104,20 @@ def apple_xcframework_import_test_suite(name):
tags = [name],
)

archive_contents_test(
name = "{}_static_xcfw_binary_not_bundled_device".format(name),
build_type = "device",
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_imported_xcfmwk_bundling_static_fmwks_with_resources",
contains = [
"$BUNDLE_ROOT/resource_bundle.bundle/custom_apple_resource_info.out",
"$BUNDLE_ROOT/resource_bundle.bundle/Info.plist",
],
not_contains = [
"$BUNDLE_ROOT/Frameworks/ios_static_xcframework_with_resources.framework/ios_static_xcframework_with_resources",
],
tags = [name],
)

analysis_target_outputs_test(
name = "{}_static_xcfw_import_with_lib_ids_ipa_test".format(name),
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_imported_static_xcfmwk_with_lib_ids",
Expand Down
2 changes: 1 addition & 1 deletion test/starlark_tests/rules/apple_verification_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _apple_verification_transition_impl(settings, attr):
})
else:
output_dictionary.update({
"//command_line_option:ios_multi_cpus": "arm64,armv7",
"//command_line_option:ios_multi_cpus": "arm64",
"//command_line_option:tvos_cpus": "arm64",
"//command_line_option:watchos_cpus": "arm64_32,armv7k",
})
Expand Down

0 comments on commit 40f7be2

Please sign in to comment.