From 5b7c929ec4f3618a3f558c7ccae64f155f2646b7 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Fri, 5 May 2023 08:16:26 -0700 Subject: [PATCH] Remove bitcode support (#1534) Now that Xcode 14.1 is the minimum supported to the App Store, and Xcode 14.0 dropped support for bitcode, we don't need to handle these flags anymore. Closes https://github.com/bazelbuild/rules_apple/issues/1956 --- apple/internal/BUILD | 1 - apple/internal/ios_rules.bzl | 50 ------ apple/internal/linking_support.bzl | 10 +- apple/internal/partials.bzl | 5 - apple/internal/partials/BUILD | 14 -- apple/internal/partials/bitcode_symbols.bzl | 157 ------------------ apple/internal/tvos_rules.bzl | 33 ---- apple/internal/watchos_rules.bzl | 30 ---- apple/internal/xcframework_rules.bzl | 55 +----- test/apple_shell_testutils.sh | 66 -------- test/configurations.bzl | 17 -- test/ios_application_test.sh | 5 - .../apple_xcframework_tests.bzl | 59 ------- test/starlark_tests/ios_app_clip_tests.bzl | 13 -- test/starlark_tests/ios_application_tests.bzl | 10 -- test/starlark_tests/ios_extension_tests.bzl | 13 -- .../ios_sticker_pack_extension_tests.bzl | 11 -- .../rules/apple_verification_test.bzl | 11 -- .../rules/common_verification_tests.bzl | 42 ----- .../rules/infoplist_contents_test.bzl | 8 - .../starlark_tests/tvos_application_tests.bzl | 10 -- test/starlark_tests/tvos_extension_tests.bzl | 13 -- .../verifier_scripts/bitcode_verifier.sh | 24 --- .../watchos_extension_tests.bzl | 14 -- 24 files changed, 9 insertions(+), 662 deletions(-) delete mode 100644 apple/internal/partials/bitcode_symbols.bzl delete mode 100644 test/starlark_tests/verifier_scripts/bitcode_verifier.sh diff --git a/apple/internal/BUILD b/apple/internal/BUILD index 352a92eaca..23ca701de8 100644 --- a/apple/internal/BUILD +++ b/apple/internal/BUILD @@ -388,7 +388,6 @@ bzl_library( "//apple/internal/partials:apple_bundle_info", "//apple/internal/partials:apple_symbols_file", "//apple/internal/partials:binary", - "//apple/internal/partials:bitcode_symbols", "//apple/internal/partials:clang_rt_dylibs", "//apple/internal/partials:codesigning_dossier", "//apple/internal/partials:debug_symbols", diff --git a/apple/internal/ios_rules.bzl b/apple/internal/ios_rules.bzl index 86cd88293e..8d0077136e 100644 --- a/apple/internal/ios_rules.bzl +++ b/apple/internal/ios_rules.bzl @@ -228,15 +228,6 @@ def _ios_application_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = embeddable_targets, - label_name = label.name, - package_bitcode = True, - platform_prerequisites = platform_prerequisites, - ), partials.codesigning_dossier_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, @@ -520,15 +511,6 @@ def _ios_app_clip_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = embeddable_targets, - label_name = label.name, - package_bitcode = True, - platform_prerequisites = platform_prerequisites, - ), partials.codesigning_dossier_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, @@ -781,14 +763,6 @@ def _ios_framework_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = ctx.attr.frameworks, - label_name = label.name, - platform_prerequisites = platform_prerequisites, - ), partials.codesigning_dossier_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, @@ -1016,14 +990,6 @@ def _ios_extension_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = ctx.attr.frameworks, - label_name = label.name, - platform_prerequisites = platform_prerequisites, - ), partials.codesigning_dossier_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, @@ -1267,14 +1233,6 @@ def _ios_dynamic_framework_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = ctx.attr.frameworks, - label_name = label.name, - platform_prerequisites = platform_prerequisites, - ), partials.codesigning_dossier_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, @@ -1817,14 +1775,6 @@ def _ios_imessage_extension_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = ctx.attr.frameworks, - label_name = label.name, - platform_prerequisites = platform_prerequisites, - ), partials.codesigning_dossier_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, diff --git a/apple/internal/linking_support.bzl b/apple/internal/linking_support.bzl index 5992e0d522..b638a17a76 100644 --- a/apple/internal/linking_support.bzl +++ b/apple/internal/linking_support.bzl @@ -34,24 +34,19 @@ def _debug_outputs_by_architecture(link_outputs): Returns: A `struct` containing three fields: - * `bitcode_symbol_maps`: A mapping of architectures to Files representing bitcode symbol - maps for each architecture. * `dsym_binaries`: A mapping of architectures to Files representing dSYM binary outputs for each architecture. * `linkmaps`: A mapping of architectures to Files representing linkmaps for each architecture. """ - bitcode_symbol_maps = {} dsym_binaries = {} linkmaps = {} for link_output in link_outputs: - bitcode_symbol_maps[link_output.architecture] = link_output.bitcode_symbols dsym_binaries[link_output.architecture] = link_output.dsym_binary linkmaps[link_output.architecture] = link_output.linkmap return struct( - bitcode_symbol_maps = bitcode_symbol_maps, dsym_binaries = dsym_binaries, linkmaps = linkmaps, ) @@ -306,10 +301,9 @@ def _link_multi_arch_binary( with minimal support for linking multiple architecture binaries from split dependencies. Specifically, this lacks support for: - - Generating Apple DSYMs binaries. - - Generating Apple bitcode symbols. + - Generating Apple dSYM binaries. - Generating Objective-C linkmaps. - - Avoid linking Objective-C(++) dependencies symbols (ie. avoid_deps). + - Avoid linking symbols from Objective-C(++) dependencies (i.e. avoid_deps). Args: actions: The actions provider from `ctx.actions`. diff --git a/apple/internal/partials.bzl b/apple/internal/partials.bzl index d0ce72b7f5..7b646ddfe5 100644 --- a/apple/internal/partials.bzl +++ b/apple/internal/partials.bzl @@ -30,10 +30,6 @@ load( "@build_bazel_rules_apple//apple/internal/partials:binary.bzl", _binary_partial = "binary_partial", ) -load( - "@build_bazel_rules_apple//apple/internal/partials:bitcode_symbols.bzl", - _bitcode_symbols_partial = "bitcode_symbols_partial", -) load( "@build_bazel_rules_apple//apple/internal/partials:clang_rt_dylibs.bzl", _clang_rt_dylibs_partial = "clang_rt_dylibs_partial", @@ -111,7 +107,6 @@ partials = struct( app_assets_validation_partial = _app_assets_validation_partial, apple_bundle_info_partial = _apple_bundle_info_partial, binary_partial = _binary_partial, - bitcode_symbols_partial = _bitcode_symbols_partial, clang_rt_dylibs_partial = _clang_rt_dylibs_partial, codesigning_dossier_partial = _codesigning_dossier_partial, debug_symbols_partial = _debug_symbols_partial, diff --git a/apple/internal/partials/BUILD b/apple/internal/partials/BUILD index a26c6dd8e1..bf4d53040b 100644 --- a/apple/internal/partials/BUILD +++ b/apple/internal/partials/BUILD @@ -61,20 +61,6 @@ bzl_library( ], ) -bzl_library( - name = "bitcode_symbols", - srcs = ["bitcode_symbols.bzl"], - visibility = [ - "//apple/internal:__pkg__", - ], - deps = [ - "//apple/internal:intermediates", - "//apple/internal:processor", - "@bazel_skylib//lib:partial", - "@build_bazel_apple_support//lib:apple_support", - ], -) - bzl_library( name = "clang_rt_dylibs", srcs = ["clang_rt_dylibs.bzl"], diff --git a/apple/internal/partials/bitcode_symbols.bzl b/apple/internal/partials/bitcode_symbols.bzl deleted file mode 100644 index 813966e4a5..0000000000 --- a/apple/internal/partials/bitcode_symbols.bzl +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Partial implementation for bitcode symbol file processing.""" - -load( - "@build_bazel_apple_support//lib:apple_support.bzl", - "apple_support", -) -load( - "@build_bazel_rules_apple//apple/internal:intermediates.bzl", - "intermediates", -) -load( - "@build_bazel_rules_apple//apple/internal:processor.bzl", - "processor", -) -load( - "@bazel_skylib//lib:partial.bzl", - "partial", -) - -_AppleBitcodeInfo = provider( - doc = "Private provider to propagate the transitive bitcode `File`s.", - fields = { - "bitcode": "Depset of `File`s containing the transitive dependency bitcode files.", - }, -) - -def _bitcode_symbols_partial_impl( - *, - actions, - binary_artifact, - bitcode_symbol_maps, - dependency_targets, - label_name, - output_discriminator, - package_bitcode, - platform_prerequisites): - """Implementation for the bitcode symbols processing partial.""" - - bitcode_dirs = [] - - bitcode_symbols = {} - if bitcode_symbol_maps: - bitcode_symbols.update(bitcode_symbol_maps) - - if binary_artifact and bitcode_symbols: - bitcode_files = [] - copy_commands = [] - for arch in bitcode_symbols: - bitcode_file = bitcode_symbols[arch] - if not bitcode_file: - continue - bitcode_files.append(bitcode_file) - - # Get the UUID of the arch slice and use that to name the bcsymbolmap file. - copy_commands.append( - ("cp {bitcode_file} " + - "${{OUTPUT_DIR}}/$(dwarfdump -u {binary} " + - "| grep \"({arch})\" | cut -d' ' -f2).bcsymbolmap").format( - arch = arch, - binary = binary_artifact.path, - bitcode_file = bitcode_file.path, - ), - ) - - if bitcode_files: - bitcode_dir = intermediates.directory( - actions = actions, - target_name = label_name, - output_discriminator = output_discriminator, - dir_name = "bitcode_files", - ) - bitcode_dirs.append(bitcode_dir) - - apple_support.run_shell( - actions = actions, - apple_fragment = platform_prerequisites.apple_fragment, - inputs = [binary_artifact] + bitcode_files, - outputs = [bitcode_dir], - command = "mkdir -p ${OUTPUT_DIR} && " + " && ".join(copy_commands), - env = {"OUTPUT_DIR": bitcode_dir.path}, - mnemonic = "BitcodeSymbolsCopy", - xcode_config = platform_prerequisites.xcode_version_config, - ) - - transitive_bitcode_files = depset( - direct = bitcode_dirs, - transitive = [ - x[_AppleBitcodeInfo].bitcode - for x in dependency_targets - if _AppleBitcodeInfo in x - ], - ) - - if package_bitcode: - bundle_files = [(processor.location.archive, "BCSymbolMaps", transitive_bitcode_files)] - else: - bundle_files = [] - - return struct( - bundle_files = bundle_files, - providers = [_AppleBitcodeInfo(bitcode = transitive_bitcode_files)], - ) - -def bitcode_symbols_partial( - *, - actions, - binary_artifact = None, - bitcode_symbol_maps = {}, - dependency_targets = [], - label_name, - output_discriminator = None, - package_bitcode = False, - platform_prerequisites): - """Constructor for the bitcode symbols processing partial. - - Args: - actions: Actions defined for the current build context. - binary_artifact: The main binary artifact for this target. - bitcode_symbol_maps: A mapping of architectures to Files representing bitcode symbol maps for - each architecture. - dependency_targets: List of targets that should be checked for bitcode files that need to be - bundled.. - label_name: Name of the target being built - output_discriminator: A string to differentiate between different target intermediate files - or `None`. - package_bitcode: Whether the partial should package the bitcode files for all dependency - binaries. - platform_prerequisites: Struct containing information on the platform being targeted. - - Returns: - A partial that returns the bitcode files to propagate or bundle, if any were requested. - """ - return partial.make( - _bitcode_symbols_partial_impl, - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = bitcode_symbol_maps, - dependency_targets = dependency_targets, - label_name = label_name, - output_discriminator = output_discriminator, - package_bitcode = package_bitcode, - platform_prerequisites = platform_prerequisites, - ) diff --git a/apple/internal/tvos_rules.bzl b/apple/internal/tvos_rules.bzl index 849ded7d21..0633c44558 100644 --- a/apple/internal/tvos_rules.bzl +++ b/apple/internal/tvos_rules.bzl @@ -200,15 +200,6 @@ def _tvos_application_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = embeddable_targets, - label_name = label.name, - package_bitcode = True, - platform_prerequisites = platform_prerequisites, - ), partials.clang_rt_dylibs_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, @@ -483,14 +474,6 @@ def _tvos_dynamic_framework_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = ctx.attr.frameworks, - label_name = label.name, - platform_prerequisites = platform_prerequisites, - ), partials.codesigning_dossier_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, @@ -730,14 +713,6 @@ def _tvos_framework_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = ctx.attr.frameworks, - label_name = label.name, - platform_prerequisites = platform_prerequisites, - ), # TODO(kaipi): Check if clang_rt dylibs are needed in Frameworks, or if # the can be skipped. partials.clang_rt_dylibs_partial( @@ -951,14 +926,6 @@ def _tvos_extension_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = ctx.attr.frameworks, - label_name = label.name, - platform_prerequisites = platform_prerequisites, - ), partials.clang_rt_dylibs_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, diff --git a/apple/internal/watchos_rules.bzl b/apple/internal/watchos_rules.bzl index 39bbcbd000..c2298712a0 100644 --- a/apple/internal/watchos_rules.bzl +++ b/apple/internal/watchos_rules.bzl @@ -211,14 +211,6 @@ def _watchos_framework_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = ctx.attr.frameworks, - label_name = label.name, - platform_prerequisites = platform_prerequisites, - ), partials.codesigning_dossier_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, @@ -460,14 +452,6 @@ def _watchos_dynamic_framework_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = ctx.attr.frameworks, - label_name = label.name, - platform_prerequisites = platform_prerequisites, - ), partials.codesigning_dossier_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, @@ -710,12 +694,6 @@ def _watchos_application_impl(ctx): executable_name = executable_name, label_name = label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - dependency_targets = [ctx.attr.extension], - label_name = label.name, - platform_prerequisites = platform_prerequisites, - ), partials.clang_rt_dylibs_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, @@ -944,14 +922,6 @@ def _watchos_extension_impl(ctx): executable_name = executable_name, label_name = ctx.label.name, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = debug_outputs.bitcode_symbol_maps, - dependency_targets = embeddable_targets, - label_name = label.name, - platform_prerequisites = platform_prerequisites, - ), partials.clang_rt_dylibs_partial( actions = actions, apple_mac_toolchain_info = apple_mac_toolchain_info, diff --git a/apple/internal/xcframework_rules.bzl b/apple/internal/xcframework_rules.bzl index 3917e6410e..e7c4b0bba3 100644 --- a/apple/internal/xcframework_rules.bzl +++ b/apple/internal/xcframework_rules.bzl @@ -123,11 +123,10 @@ def _group_link_outputs_by_library_identifier( A list of structs with the following fields; `architectures` containing a list of the architectures that the binary was built with, `binary` referencing the output binary linked with the `lipo` tool if necessary, or referencing a symlink to the original binary if not, - `bitcode_symbol_maps` which is a mapping of architectures to bitcode symbol maps if any were - created, `dsym_binaries` which is a mapping of architectures to dsym binaries if any were - created, `environment` to reference the target environment the binary was built for, - `linkmaps` which is a mapping of architectures to linkmaps if any were created, and - `platform` to reference the target platform the binary was built for. + `dsym_binaries` which is a mapping of architectures to dsym binaries if any were created, + `environment` to reference the target environment the binary was built for, `linkmaps` which + is a mapping of architectures to linkmaps if any were created, and `platform` to reference + the target platform the binary was built for. """ linking_type = None for attr_name in ["binary", "library"]: @@ -154,9 +153,8 @@ def _group_link_outputs_by_library_identifier( link_outputs_by_library_identifier = {} # Iterate through the structure again, this time creating a structure equivalent to link_result - # .outputs but with .architecture replaced with .architectures, .bitcode_symbols replaced with - # .bitcode_symbol_maps, .dsym_binary replaced with .dsym_binaries, and .linkmap replaced with - # .linkmaps + # .outputs but with .architecture replaced with .architectures, .dsym_binary replaced with + # .dsym_binaries, and .linkmap replaced with .linkmaps for framework_key, link_outputs in link_outputs_by_framework.items(): inputs = [getattr(output, linking_type) for output in link_outputs] filename = "{}_{}".format(label_name, framework_key) @@ -173,7 +171,6 @@ def _group_link_outputs_by_library_identifier( ) architectures = [] - bitcode_symbol_maps = {} dsym_binaries = {} linkmaps = {} split_attr_keys = [] @@ -197,9 +194,8 @@ def _group_link_outputs_by_library_identifier( if SwiftInfo in dep: swift_infos[link_output.architecture] = dep[SwiftInfo] - # static library linking does not support bitcode, dsym, and linkmaps yet. + # static library linking does not support dsym, and linkmaps yet. if linking_type == "binary": - bitcode_symbol_maps[link_output.architecture] = link_output.bitcode_symbols dsym_binaries[link_output.architecture] = link_output.dsym_binary linkmaps[link_output.architecture] = link_output.linkmap @@ -215,7 +211,6 @@ def _group_link_outputs_by_library_identifier( link_outputs_by_library_identifier[library_identifier] = struct( architectures = architectures, binary = fat_binary, - bitcode_symbol_maps = bitcode_symbol_maps, dsym_binaries = dsym_binaries, environment = environment, linkmaps = linkmaps, @@ -276,7 +271,6 @@ def _unioned_attrs(*, attr_names, split_attr, split_attr_keys): def _available_library_dictionary( *, architectures, - bitcode_symbol_maps, environment, headers_path, library_identifier, @@ -287,8 +281,6 @@ def _available_library_dictionary( Args: architectures: The architectures of the target that was built. For example, `x86_64` or `arm64`. - bitcode_symbol_maps: A mapping of architectures to Files representing bitcode symbol maps - for each architecture. environment: The environment of the target that was built, which corresponds to the toolchain's target triple values as reported by `apple_common` linking APIs. Typically `device` or `simulator`. @@ -313,17 +305,6 @@ def _available_library_dictionary( "SupportedPlatform": platform, } - # If there are any bitcode symbol maps for this library, indicate that they are in the - # BCSymbolMaps subdir. - # - # The `BitcodeSymbolMapsPath` is relative to the `LibraryIdentifier`. If `LibraryIdentifier` is - # `ios-arm64_armv7`, then the path in the xcframework bundle to the bitcode symbol maps will be - # `ios-arm64_armv7/BCSymbolMaps` - for bitcode_symbol_map in bitcode_symbol_maps.values(): - if bitcode_symbol_map: - available_library["BitcodeSymbolMapsPath"] = "BCSymbolMaps" - break - if headers_path: available_library["HeadersPath"] = headers_path @@ -595,14 +576,6 @@ def _apple_xcframework_impl(ctx): label_name = label.name, output_discriminator = library_identifier, ), - partials.bitcode_symbols_partial( - actions = actions, - binary_artifact = binary_artifact, - bitcode_symbol_maps = link_output.bitcode_symbol_maps, - label_name = label.name, - output_discriminator = library_identifier, - platform_prerequisites = platform_prerequisites, - ), partials.debug_symbols_partial( actions = actions, bundle_extension = nested_bundle_extension, @@ -696,18 +669,6 @@ def _apple_xcframework_impl(ctx): # Save a reference to those archives as file-friendly inputs to the bundler action. framework_archive_files.append(depset([provider.archive])) - # Save the bitcode maps. - if getattr(provider, "bitcode", None): - bitcode_files = provider.bitcode.to_list() - for bitcode_file in bitcode_files: - framework_archive_merge_files.append( - struct( - src = bitcode_file.path, - dest = paths.join(library_identifier, "BCSymbolMaps"), - ), - ) - framework_archive_files.append(provider.bitcode) - # Save the dSYMs. if getattr(provider, "dsyms", None): framework_output_files.append(depset(transitive = [provider.dsyms])) @@ -721,7 +682,6 @@ def _apple_xcframework_impl(ctx): # Save additional library details for the XCFramework's root info plist. available_libraries.append(_available_library_dictionary( architectures = link_output.architectures, - bitcode_symbol_maps = link_output.bitcode_symbol_maps, environment = link_output.environment, headers_path = None, library_identifier = library_identifier, @@ -1015,7 +975,6 @@ def _apple_static_xcframework_impl(ctx): available_libraries.append( _available_library_dictionary( architectures = link_output.architectures, - bitcode_symbol_maps = {}, environment = link_output.environment, headers_path = None, library_identifier = library_identifier, diff --git a/test/apple_shell_testutils.sh b/test/apple_shell_testutils.sh index 5adfe385ed..12357714dc 100755 --- a/test/apple_shell_testutils.sh +++ b/test/apple_shell_testutils.sh @@ -499,26 +499,6 @@ function do_action() { } -# Usage: is_bitcode_build -# -# Returns a success code if the --apple_bitcode flag is set to either -# "embedded" or "embedded_markers"; otherwise, it returns a failure exit code. -function is_bitcode_build() { - for option in "${EXTRA_BUILD_OPTIONS[@]-}"; do - case "$option" in - --apple-bitcode=none) - return 1 - ;; - --apple_bitcode=*) - return 0 - ;; - esac - done - - return 1 -} - - # Usage: is_device_build # # Returns a success exit code if the current architectures correspond to a @@ -641,52 +621,6 @@ function assert_objdump_not_contains() { "contents were: $contents" } -# Usage: assert_contains_bitcode_maps -# -# Asserts that the IPA at `archive` contains bitcode symbol map of the binary -# at `path` for each architecture being built for the `platform`. -# -# To support legacy shell tests and newer Starlark tests, this function can take -# the `archive` and `binary_path` arguments in two forms: -# -# - If `archive` is a directory, then `binary_path` is assumed to be the -# path to the binary relative to `archive`. -# - If `archive` is a file, it is assumed to be an .ipa or .zip archive and -# `binary_path` is treated as the relative path to the binary inside that -# archive. -function assert_ipa_contains_bitcode_maps() { - local platform="$1" ; shift - local archive_zip_or_dir="$1" ; shift - local bc_symbol_maps_root="$1" ; shift - local bc_symbol_maps_dir="${bc_symbol_maps_root}/BCSymbolMaps" - - for binary in "$@" ; do - if [[ -d "$archive_zip_or_dir" ]] ; then - assert_exists "$archive_zip_or_dir/$binary" - ln -s "$archive_zip_or_dir/$binary" "$TEST_TMPDIR"/tmp_bin - else - assert_zip_contains "$archive_zip_or_dir" "$binary" - unzip_single_file "$archive_zip_or_dir" "$binary" > "$TEST_TMPDIR"/tmp_bin - fi - - # Verify that there is a Bitcode symbol map for each UUID in the DWARF info. - dwarfdump -u "$TEST_TMPDIR"/tmp_bin | while read line ; do - local -a uuid_and_arch=( - $(echo "$line" | sed -e 's/UUID: \([^ ]*\) (\([^)]*\)).*/\1 \2/') ) - local uuid=${uuid_and_arch[0]} - - if [[ -d "$archive_zip_or_dir" ]] ; then - assert_exists "${archive_zip_or_dir}/${bc_symbol_maps_dir}/${uuid}.bcsymbolmap" - else - assert_zip_contains "$archive_zip_or_dir" \ - "${bc_symbol_maps_dir}/${uuid}.bcsymbolmap" - fi - done - - rm "$TEST_TMPDIR"/tmp_bin - done -} - # Usage: assert_plist_is_binary # # Asserts that the IPA/zip at `archive` contains a binary plist file at diff --git a/test/configurations.bzl b/test/configurations.bzl index 98de60959c..93ccd04b73 100644 --- a/test/configurations.bzl +++ b/test/configurations.bzl @@ -21,7 +21,6 @@ COMPILATION_MODE_OPTIONS = ["--compilation_mode opt"] # Configuration options used with `apple_shell_test` to run tests for # iOS simulator and device builds. # -# TODO(b/35091927): Here and below, switch to Bitcode mode "embedded". IOS_DEVICE_OPTIONS = COMPILATION_MODE_OPTIONS + ["--ios_multi_cpus=arm64,armv7"] IOS_SIMULATOR_OPTIONS = COMPILATION_MODE_OPTIONS + [ "--ios_multi_cpus=i386,x86_64", @@ -29,10 +28,6 @@ IOS_SIMULATOR_OPTIONS = COMPILATION_MODE_OPTIONS + [ IOS_CONFIGURATIONS = { "device": IOS_DEVICE_OPTIONS, - # Blocked on b/73546952 - # "device_bitcode": IOS_DEVICE_OPTIONS + [ - # "--apple_bitcode=embedded_markers", - #], "simulator": IOS_SIMULATOR_OPTIONS, } @@ -41,10 +36,6 @@ IOS_CONFIGURATIONS = { # simulator architecture test, so instead create a special configuration for the sanitizer tests. IOS_64BIT_SIMULATOR_FAT_DEVICE_CONFIGURATIONS = { "device": IOS_DEVICE_OPTIONS, - # Blocked on b/73546952 - # "device_bitcode": IOS_DEVICE_OPTIONS + [ - # "--apple_bitcode=embedded_markers", - #], "simulator": COMPILATION_MODE_OPTIONS + ["--ios_multi_cpus=x86_64"], } @@ -66,10 +57,6 @@ TVOS_SIMULATOR_OPTIONS = COMPILATION_MODE_OPTIONS + ["--tvos_cpus=x86_64"] TVOS_CONFIGURATIONS = { "device": TVOS_DEVICE_OPTIONS, - # Blocked on b/73546952 - # "device_bitcode": TVOS_DEVICE_OPTIONS + [ - # "--apple_bitcode=embedded_markers", - #], "simulator": TVOS_SIMULATOR_OPTIONS, } @@ -93,9 +80,5 @@ WATCHOS_SIMULATOR_OPTIONS = COMPILATION_MODE_OPTIONS + [ WATCHOS_CONFIGURATIONS = { "device": WATCHOS_DEVICE_OPTIONS, - # Blocked on b/73546952 - # "device_bitcode": WATCHOS_DEVICE_OPTIONS + [ - # "--apple_bitcode=embedded_markers", - #], "simulator": WATCHOS_SIMULATOR_OPTIONS, } diff --git a/test/ios_application_test.sh b/test/ios_application_test.sh index 7a614971f4..1a2dafc5db 100755 --- a/test/ios_application_test.sh +++ b/test/ios_application_test.sh @@ -245,11 +245,6 @@ EOF # Tests that linkopts get passed to the underlying apple_binary target. function test_linkopts_passed_to_binary() { - # Bail out early if this is a Bitcode build; the -alias flag we use to test - # this isn't compatible with Bitcode. That's ok; as long as the test passes - # for non-Bitcode builds, we're good. - is_bitcode_build && return 0 - create_common_files cat >> app/BUILD <