Run a build with a particular toolchain:
env DEVELOPER_DIR=/Applications/Xcode-15.3.0.app xcrun --toolchain org.swift.600202404221a swift build
This will run the build in language mode 5 and not show any concurrency warnings.
In order to show concurrency warnings, run
env DEVELOPER_DIR=/Applications/Xcode-15.3.0.app xcrun --toolchain org.swift.600202404221a swift build -Xswiftc -strict-concurrency=complete
In order to run in Swift 6 language mode, add swiftLanguageVersions: [.version("6")]
to the Package.swift
manifest (see branch language-mode-6
):
let package = Package(
name: "ReadyForSwift6Test",
products: [
.library(name: "ReadyForSwift6Test", targets: ["ReadyForSwift6Test"]),
],
targets: [
.target(name: "ReadyForSwift6Test"),
],
swiftLanguageVersions: [.version("6")]
)
This will raise concurrency errors instead of warnings.
There does not seem to be a way to run in Swift 6 language mode without modifying the package manifest.