Skip to content

Commit

Permalink
Remove Bitcode support, since Apple no longer allows submissions with…
Browse files Browse the repository at this point in the history
… it.

PiperOrigin-RevId: 527571721
  • Loading branch information
allevato authored and swiple-rules-gardener committed Apr 27, 2023
1 parent 48384f9 commit 797660a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
6 changes: 0 additions & 6 deletions swift/internal/feature_names.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ SWIFT_FEATURE_OPT = "swift.opt"
# compilation actions, even when building with explicit modules.
SWIFT_FEATURE_HEADERS_ALWAYS_ACTION_INPUTS = "swift.headers_always_action_inputs"

# These features correspond to the current Bitcode mode as specified by the
# `apple` configuration fragment when targeting Apple platforms. At most one of
# these will be enabled by the toolchain.
SWIFT_FEATURE_BITCODE_EMBEDDED = "swift.bitcode_embedded"
SWIFT_FEATURE_BITCODE_EMBEDDED_MARKERS = "swift.bitcode_embedded_markers"

# This feature is enabled if coverage collection is enabled for the build. (See
# the note above about not depending on the C++ features.)
SWIFT_FEATURE_COVERAGE = "swift.coverage"
Expand Down
50 changes: 0 additions & 50 deletions swift/toolchains/xcode_swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ load(
)
load(
"@build_bazel_rules_swift//swift/internal:feature_names.bzl",
"SWIFT_FEATURE_BITCODE_EMBEDDED",
"SWIFT_FEATURE_BITCODE_EMBEDDED_MARKERS",
"SWIFT_FEATURE_MODULE_MAP_HOME_IS_CWD",
)
load(
Expand Down Expand Up @@ -296,29 +294,6 @@ def _swift_linkopts_cc_info(
),
)

def _features_for_bitcode_mode(bitcode_mode):
"""Gets the list of features to enable for the selected Bitcode mode.
Args:
bitcode_mode: The `bitcode_mode` value from the C++ configuration
fragment.
Returns:
A list containing the features to enable.
"""
bitcode_mode_string = str(bitcode_mode)
if bitcode_mode_string == "embedded":
return [SWIFT_FEATURE_BITCODE_EMBEDDED]
elif bitcode_mode_string == "embedded_markers":
return [SWIFT_FEATURE_BITCODE_EMBEDDED_MARKERS]
elif bitcode_mode_string == "none":
return []

fail("Internal error: expected bitcode_mode to be one of: " +
"['embedded', 'embedded_markers', 'none'], but got '{}'".format(
bitcode_mode_string,
))

def _make_resource_directory_configurator(developer_dir):
"""Makes a configurator for resource-directory-related compiler flags.
Expand Down Expand Up @@ -442,28 +417,6 @@ def _all_action_configs(
),
)

action_configs.extend([
# Bitcode-related flags.
ActionConfigInfo(
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_COMPILE_MODULE_INTERFACE,
SWIFT_ACTION_PRECOMPILE_C_MODULE,
],
configurators = [add_arg("-embed-bitcode")],
features = [SWIFT_FEATURE_BITCODE_EMBEDDED],
),
ActionConfigInfo(
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_COMPILE_MODULE_INTERFACE,
SWIFT_ACTION_PRECOMPILE_C_MODULE,
],
configurators = [add_arg("-embed-bitcode-marker")],
features = [SWIFT_FEATURE_BITCODE_EMBEDDED_MARKERS],
),
])

if needs_resource_directory:
# If the user is using a custom driver but not a complete custom
# toolchain, provide the original toolchain's resources as the resource
Expand Down Expand Up @@ -721,9 +674,6 @@ def _xcode_swift_toolchain_impl(ctx):
cpp_fragment = cpp_fragment,
) + wmo_features_from_swiftcopts(swiftcopts = ctx.fragments.swift.copts())
requested_features.extend(ctx.features)
requested_features.extend(
_features_for_bitcode_mode(cpp_fragment.apple_bitcode_mode),
)
requested_features.extend(default_features_for_toolchain(
ctx = ctx,
target_triple = target_triple,
Expand Down

1 comment on commit 797660a

@keith
Copy link
Member

@keith keith commented on 797660a May 4, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.