Skip to content

Commit 81d9d6f

Browse files
authored
[6.0] Set environment variable to disable building swift-syntax in Swift 6 mode (#7500)
Companion of swiftlang/swift-syntax#2627 - **Explanation**: This allows us to work around the following issue in CI: The self-hosted SwiftPM job has Xcode 15.3 (Swift 5.10) installed and builds a Swift 6 SwiftPM from source. It then tries to build itself as a fat binary using the just-built Swift 6 SwiftPM, which uses xcbuild from Xcode as the build system. But the xcbuild in the installed Xcode is too old and doesn't know about Swift 6 mode, so it fails with: SWIFT_VERSION '6' is unsupported, supported versions are: 4.0, 4.2, 5.0 (rdar://126952308). This is fixed by setting `SWIFTSYNTAX_DISABLE_SWIFT_6_MODE` in `build-using-self`. The source compat suite is seeing the same issue, just by using `bootstrap`, so set it there as well. - **Scope**: The build of SwiftPM using the `bootstrap` and `build-using-self` scripts - **Risk**: All issues that might have been caused by this will be found at build time - **Testing**: Verified that both the self hosted Swift CI job and the source compat suite build fine with #7495 - **Issue**: rdar://125579439 - **Reviewer**: @MaxDesiatov on #7495
1 parent a131c58 commit 81d9d6f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Utilities/bootstrap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,8 @@ def get_swiftpm_env_cmd(args):
744744
env_cmd.append("SWIFTPM_LLBUILD_FWK=1")
745745
env_cmd.append("SWIFTCI_USE_LOCAL_DEPS=1")
746746
env_cmd.append("SWIFTPM_MACOS_DEPLOYMENT_TARGET=%s" % g_macos_deployment_target)
747+
# Disable Swift 6 mode in swift-syntax to work around rdar://126952308
748+
env_cmd.append("SWIFTSYNTAX_DISABLE_SWIFT_6_MODE=1")
747749

748750
if not '-macosx' in args.build_target and args.command == 'install':
749751
env_cmd.append("SWIFTCI_INSTALL_RPATH_OS=%s" % args.platform_path.group(2))

Utilities/build-using-self

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ echo "Current directory is ${PWD}"
2020

2121
CONFIGURATION=debug
2222
export SWIFTCI_IS_SELF_HOSTED=1
23+
# Disable Swift 6 mode in swift-syntax to work around rdar://126952308
24+
export SWIFTSYNTAX_DISABLE_SWIFT_6_MODE=1
2325

2426
set -x
2527

0 commit comments

Comments
 (0)