Skip to content

Commit 1350b29

Browse files
committed
Fix merge conflicts and remove const values gating
1 parent fe26e20 commit 1350b29

File tree

7 files changed

+7
-51
lines changed

7 files changed

+7
-51
lines changed

swift/internal/compiling.bzl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ load(
4949
"SWIFT_FEATURE_USE_EXPLICIT_SWIFT_MODULE_MAP",
5050
"SWIFT_FEATURE_VFSOVERLAY",
5151
"SWIFT_FEATURE__NUM_THREADS_0_IN_SWIFTCOPTS",
52-
"SWIFT_FEATURE__SUPPORTS_CONST_VALUE_EXTRACTION",
5352
"SWIFT_FEATURE__WMO_IN_SWIFTCOPTS",
5453
)
5554
load(
@@ -492,13 +491,7 @@ def compile(
492491
feature_name = SWIFT_FEATURE_EMIT_SWIFTSOURCEINFO,
493492
)
494493

495-
if is_feature_enabled(
496-
feature_configuration = feature_configuration,
497-
feature_name = SWIFT_FEATURE__SUPPORTS_CONST_VALUE_EXTRACTION,
498-
):
499-
const_protocols_to_gather_file = swift_toolchain.const_protocols_to_gather
500-
else:
501-
const_protocols_to_gather_file = []
494+
const_protocols_to_gather_file = swift_toolchain.const_protocols_to_gather
502495

503496
compile_outputs, other_outputs = _declare_compile_outputs(
504497
srcs = srcs,

swift/internal/feature_names.bzl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,6 @@ SWIFT_FEATURE_EMIT_SWIFTSOURCEINFO = "swift.emit_swiftsourceinfo"
336336
# multiple frameworks with different target name, but same module name.
337337
SWIFT_FEATURE_ADD_TARGET_NAME_TO_OUTPUT = "swift.add_target_name_to_output"
338338

339-
# A private feature that is set by the toolchain if it supports constant values
340-
# extraction (Swift 5.8 and above). Users should never manually enable, disable, or query this
341-
# feature.
342-
SWIFT_FEATURE__SUPPORTS_CONST_VALUE_EXTRACTION = "swift._supports_const_value_extraction"
343-
344339
# Enable thin LTO and update output-file-map correctly
345340
SWIFT_FEATURE_THIN_LTO = "swift.thin_lto"
346341

swift/internal/swift_autoconfiguration.bzl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ load(
4040
"SWIFT_FEATURE_USE_AUTOLINK_EXTRACT",
4141
"SWIFT_FEATURE_USE_MODULE_WRAP",
4242
"SWIFT_FEATURE_USE_OLD_DRIVER",
43-
"SWIFT_FEATURE__SUPPORTS_MACROS",
4443
)
4544

4645
def _scratch_file(repository_ctx, temp_dir, name, content = ""):
@@ -259,10 +258,6 @@ def _create_linux_toolchain(repository_ctx):
259258
feature_values.append(SWIFT_FEATURE_USE_AUTOLINK_EXTRACT)
260259
feature_values.append(SWIFT_FEATURE_USE_MODULE_WRAP)
261260

262-
swift_features_config = _fetch_supported_features(repository_ctx, path_to_swiftc)
263-
if "load-plugin-executable" in swift_features_config:
264-
feature_values.append(SWIFT_FEATURE__SUPPORTS_MACROS)
265-
266261
repository_ctx.file(
267262
"BUILD",
268263
"""

swift/swift_compiler_plugin.bzl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ load(
2424
load(
2525
"@build_bazel_rules_swift//swift/internal:feature_names.bzl",
2626
"SWIFT_FEATURE_ADD_TARGET_NAME_TO_OUTPUT",
27-
"SWIFT_FEATURE__SUPPORTS_MACROS",
2827
)
2928
load("//swift/internal:features.bzl", "is_feature_enabled")
3029
load(
@@ -59,12 +58,6 @@ def _swift_compiler_plugin_impl(ctx):
5958
unsupported_features = ctx.disabled_features,
6059
)
6160

62-
if not is_feature_enabled(
63-
feature_configuration = feature_configuration,
64-
feature_name = SWIFT_FEATURE__SUPPORTS_MACROS,
65-
):
66-
fail("Swift compiler plugins require Swift 5.9+")
67-
6861
deps = ctx.attr.deps
6962
srcs = ctx.files.srcs
7063
module_contexts = []

swift/toolchains/config/compile_config.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ load(
7575
"SWIFT_FEATURE_USE_PCH_OUTPUT_DIR",
7676
"SWIFT_FEATURE_VFSOVERLAY",
7777
"SWIFT_FEATURE__NUM_THREADS_0_IN_SWIFTCOPTS",
78-
"SWIFT_FEATURE__SUPPORTS_CONST_VALUE_EXTRACTION",
7978
"SWIFT_FEATURE__WMO_IN_SWIFTCOPTS",
8079
)
8180
load(":action_config.bzl", "ActionConfigInfo", "ConfigResultInfo", "add_arg")
@@ -253,7 +252,6 @@ def compile_action_configs(
253252
ActionConfigInfo(
254253
actions = [SWIFT_ACTION_COMPILE],
255254
configurators = [_constant_value_extraction_configurator],
256-
features = [SWIFT_FEATURE__SUPPORTS_CONST_VALUE_EXTRACTION],
257255
),
258256

259257
# Link Time Optimization (LTO).

swift/toolchains/xcode_swift_toolchain.bzl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ load(
4747
load("//swift/internal:attrs.bzl", "swift_toolchain_driver_attrs")
4848
load(
4949
"//swift/internal:feature_names.bzl",
50+
"SWIFT_FEATURE__FORCE_ALWAYSLINK_TRUE",
5051
"SWIFT_FEATURE_CACHEABLE_SWIFTMODULES",
51-
"SWIFT_FEATURE_COVERAGE",
5252
"SWIFT_FEATURE_COVERAGE_PREFIX_MAP",
53+
"SWIFT_FEATURE_COVERAGE",
5354
"SWIFT_FEATURE_DEBUG_PREFIX_MAP",
5455
"SWIFT_FEATURE_DISABLE_SWIFT_SANDBOX",
5556
"SWIFT_FEATURE_DISABLE_SYSTEM_INDEX",
@@ -62,8 +63,8 @@ load(
6263
"SWIFT_FEATURE_OBJC_LINK_FLAGS",
6364
"SWIFT_FEATURE_OPT_USES_WMO",
6465
"SWIFT_FEATURE_REMAP_XCODE_PATH",
66+
"SWIFT_FEATURE_SUPPORTS_BARE_SLASH_REGEX",
6567
"SWIFT_FEATURE_USE_GLOBAL_MODULE_CACHE",
66-
"SWIFT_FEATURE__FORCE_ALWAYSLINK_TRUE",
6768
)
6869
load("//swift/internal:features.bzl", "features_for_build_modes")
6970
load("//swift/internal:target_triples.bzl", "target_triples")
@@ -695,14 +696,16 @@ def _xcode_swift_toolchain_impl(ctx):
695696
SWIFT_FEATURE_CACHEABLE_SWIFTMODULES,
696697
SWIFT_FEATURE_COVERAGE_PREFIX_MAP,
697698
SWIFT_FEATURE_DEBUG_PREFIX_MAP,
699+
SWIFT_FEATURE_DISABLE_SYSTEM_INDEX,
698700
SWIFT_FEATURE_EMIT_SWIFTDOC,
699701
SWIFT_FEATURE_EMIT_SWIFTSOURCEINFO,
700702
SWIFT_FEATURE_ENABLE_BATCH_MODE,
701703
SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES,
702-
SWIFT_FEATURE_DISABLE_SYSTEM_INDEX,
704+
SWIFT_FEATURE_FILE_PREFIX_MAP,
703705
SWIFT_FEATURE_OBJC_LINK_FLAGS,
704706
SWIFT_FEATURE_OPT_USES_WMO,
705707
SWIFT_FEATURE_REMAP_XCODE_PATH,
708+
SWIFT_FEATURE_SUPPORTS_BARE_SLASH_REGEX,
706709
SWIFT_FEATURE_USE_GLOBAL_MODULE_CACHE,
707710
])
708711

test/const_values_tests.bzl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ load(
2626

2727
const_values_test = make_action_command_line_test_rule()
2828

29-
no_const_values_test = make_action_command_line_test_rule(
30-
config_settings = {
31-
"//command_line_option:features": [
32-
"-swift._supports_const_value_extraction",
33-
],
34-
},
35-
)
36-
3729
const_values_wmo_test = make_provider_test_rule(
3830
config_settings = {
3931
str(Label("@build_bazel_rules_swift//swift:copt")): [
@@ -98,19 +90,6 @@ def const_values_test_suite(name, tags = []):
9890
target_under_test = "@build_bazel_rules_swift//test/fixtures/basic:first",
9991
)
10092

101-
no_const_values_test(
102-
name = "{}_not_expected_argv".format(name),
103-
not_expected_argv = [
104-
"-Xfrontend -const-gather-protocols-file",
105-
"-Xfrontend swift/toolchains/config/const_protocols_to_gather.json",
106-
"-emit-const-values-path",
107-
"first.swift.swiftconstvalues",
108-
],
109-
mnemonic = "SwiftCompile",
110-
tags = all_tags,
111-
target_under_test = "@build_bazel_rules_swift//test/fixtures/basic:first",
112-
)
113-
11493
native.test_suite(
11594
name = name,
11695
tags = all_tags,

0 commit comments

Comments
 (0)