Skip to content

Commit 0fb1b0f

Browse files
allevatoswiple-rules-gardener
authored andcommitted
Use the new driver on Xcode 14.x since it contains the fixes in swiftlang/swift-driver#1036.
PiperOrigin-RevId: 474288510
1 parent c2099d6 commit 0fb1b0f

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

swift/toolchains/xcode_swift_toolchain.bzl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ load(
4444
"SWIFT_FEATURE_DEBUG_PREFIX_MAP",
4545
"SWIFT_FEATURE_ENABLE_BATCH_MODE",
4646
"SWIFT_FEATURE_MODULE_MAP_HOME_IS_CWD",
47+
"SWIFT_FEATURE_USE_OLD_DRIVER",
4748
"SWIFT_FEATURE_USE_RESPONSE_FILES",
4849
)
4950
load(
@@ -577,10 +578,13 @@ def _all_tool_configs(
577578
if custom_toolchain:
578579
env["TOOLCHAINS"] = custom_toolchain
579580

580-
# Starting with Xcode 13.3 (Swift 5.6), the legacy driver prints a warning
581-
# if it is used. Suppress it, since we still have to use it due to response
582-
# file bugs.
583-
if _is_xcode_at_least_version(xcode_config, "13.3"):
581+
# In Xcode 13.3 and 13.4 (Swift 5.6), the legacy driver prints a warning
582+
# if it is used. Suppress it, since we still have to use it on those
583+
# specific versions due to response file bugs.
584+
if (
585+
_is_xcode_at_least_version(xcode_config, "13.3") and
586+
not _is_xcode_at_least_version(xcode_config, "14.0")
587+
):
584588
env["SWIFT_AVOID_WARNING_USING_OLD_DRIVER"] = "1"
585589

586590
def _driver_config(*, mode):
@@ -730,6 +734,11 @@ def _xcode_swift_toolchain_impl(ctx):
730734
SWIFT_FEATURE_DEBUG_PREFIX_MAP,
731735
])
732736

737+
# The new driver had response file bugs in Xcode 13.x that are fixed in
738+
# Xcode 14.
739+
if not _is_xcode_at_least_version(xcode_config, "14.0"):
740+
requested_features.append(SWIFT_FEATURE_USE_OLD_DRIVER)
741+
733742
env = _xcode_env(target_triple = target_triple, xcode_config = xcode_config)
734743
execution_requirements = xcode_config.execution_info()
735744
generated_header_rewriter = resolve_optional_tool(

0 commit comments

Comments
 (0)