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

Remove more bitcode support #2362

Merged
merged 1 commit into from
Jan 12, 2024
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
8 changes: 0 additions & 8 deletions apple/internal/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,6 @@ bzl_library(
],
)

bzl_library(
name = "bitcode_support",
srcs = ["bitcode_support.bzl"],
visibility = [
"//apple:__subpackages__",
],
)

bzl_library(
name = "partials",
srcs = ["partials.bzl"],
Expand Down
38 changes: 0 additions & 38 deletions apple/internal/bitcode_support.bzl

This file was deleted.

1 change: 0 additions & 1 deletion apple/internal/partials/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ bzl_library(
],
deps = [
"//apple:providers",
"//apple/internal:bitcode_support",
"//apple/internal:codesigning_support",
"//apple/internal:intermediates",
"//apple/internal:processor",
Expand Down
7 changes: 1 addition & 6 deletions apple/internal/partials/framework_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ load(
"@build_bazel_rules_apple//apple:providers.bzl",
"AppleFrameworkImportInfo",
)
load(
"@build_bazel_rules_apple//apple/internal:bitcode_support.bzl",
"bitcode_support",
)
load(
"@build_bazel_rules_apple//apple/internal:codesigning_support.bzl",
"codesigning_support",
Expand Down Expand Up @@ -154,8 +150,7 @@ def _framework_import_partial_impl(

args.add_all(build_archs_found, before_each = "--slice")

if bitcode_support.bitcode_mode_string(platform_prerequisites.apple_fragment) == "none":
args.add("--strip_bitcode")
args.add("--strip_bitcode")

args.add("--output_zip", framework_zip.path)

Expand Down
50 changes: 19 additions & 31 deletions apple/internal/partials/swift_dylibs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ load(
"@build_bazel_apple_support//lib:apple_support.bzl",
"apple_support",
)
load(
"@build_bazel_rules_apple//apple/internal:bitcode_support.bzl",
"bitcode_support",
)
load(
"@build_bazel_rules_apple//apple/internal:intermediates.bzl",
"intermediates",
Expand Down Expand Up @@ -156,8 +152,6 @@ def _swift_dylibs_partial_impl(
transitive = transitive_binary_sets,
)

strip_bitcode = bitcode_support.bitcode_mode_string(platform_prerequisites.apple_fragment) == "none"

swift_support_requested = defines.bool_value(
config_vars = platform_prerequisites.config_vars,
define_name = "apple.package_swift_support",
Expand All @@ -184,36 +178,30 @@ def _swift_dylibs_partial_impl(
platform_name = platform_name,
platform_prerequisites = platform_prerequisites,
resolved_swift_stdlib_tool = apple_mac_toolchain_info.resolved_swift_stdlib_tool,
strip_bitcode = strip_bitcode,
strip_bitcode = True,
)

bundle_files.append((processor.location.framework, None, depset([output_dir])))

if needs_swift_support:
if strip_bitcode:
# We're not allowed to modify stdlibs that are used for
# Swift Support, so we register another action for copying
# them without stripping bitcode.
swift_support_output_dir = intermediates.directory(
actions = actions,
target_name = label_name,
output_discriminator = output_discriminator,
dir_name = "swiftlibs_for_swiftsupport",
)
_swift_dylib_action(
actions = actions,
binary_files = binaries_to_check,
output_dir = swift_support_output_dir,
platform_name = platform_name,
platform_prerequisites = platform_prerequisites,
resolved_swift_stdlib_tool = apple_mac_toolchain_info.resolved_swift_stdlib_tool,
strip_bitcode = False,
)
else:
# When not building with bitcode, we can reuse Swift dylibs
# for bundling in both SwiftSupport and in the app bundle's
# "Frameworks" directory.
swift_support_output_dir = output_dir
# We're not allowed to modify stdlibs that are used for
# Swift Support, so we register another action for copying
# them without stripping bitcode.
swift_support_output_dir = intermediates.directory(
actions = actions,
target_name = label_name,
output_discriminator = output_discriminator,
dir_name = "swiftlibs_for_swiftsupport",
)
_swift_dylib_action(
actions = actions,
binary_files = binaries_to_check,
output_dir = swift_support_output_dir,
platform_name = platform_name,
platform_prerequisites = platform_prerequisites,
resolved_swift_stdlib_tool = apple_mac_toolchain_info.resolved_swift_stdlib_tool,
strip_bitcode = False,
)

swift_support_file = (platform_name, swift_support_output_dir)
transitive_swift_support_files.append(swift_support_file)
Expand Down