Skip to content

Commit ae08a1c

Browse files
authored
Merge pull request #2621 from ahoppen/enable-swift-6-again
Enable Swift 6 mode unless we are in a self-hosted Swift CI job
2 parents 14ff9b3 + fc903cf commit ae08a1c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Package.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,12 @@ let package = Package(
298298
exclude: ["Inputs"]
299299
),
300300
],
301-
swiftLanguageVersions: [.v5]
301+
// Disable Swift 6 mode when the `SWIFTSYNTAX_DISABLE_SWIFT_6_MODE` environment variable is set. This works around the following
302+
// issue: The self-hosted SwiftPM job has Xcode 15.3 (Swift 5.10) installed and builds a Swift 6 SwiftPM from source.
303+
// It then tries to build itself as a fat binary using the just-built Swift 6 SwiftPM, which uses xcbuild from Xcode
304+
// as the build system. But the xcbuild in the installed Xcode is too old and doesn't know about Swift 6 mode, so it
305+
// fails with: SWIFT_VERSION '6' is unsupported, supported versions are: 4.0, 4.2, 5.0 (rdar://126952308)
306+
swiftLanguageVersions: hasEnvironmentVariable("SWIFTSYNTAX_DISABLE_SWIFT_6_MODE") ? [.v5] : [.v5, .version("6")]
302307
)
303308

304309
// This is a fake target that depends on all targets in the package.

0 commit comments

Comments
 (0)