From fdd7e2f414d5db67cc8f88dc5f08f64e63fe88c6 Mon Sep 17 00:00:00 2001 From: Si Beaumont Date: Fri, 20 Dec 2024 08:44:25 +0000 Subject: [PATCH] Use StrictConcurrency=complete in Package.swift and add Swift 6 language mode CI (#44) ### Motivation We're trying to lock in strict concurrency across the package ecosystem and standardise on how that's tested. ### Modifications - Add `StrictConcurrency=complete` feature flag to all targets in the package manifest - Remove now superfluous strict concurrency compiler flag in CI runs - Add a new CI pipeline that tests the package with Swift 6 language mode. ### Result - Package configuration consistent with others adopting strict concurrency. - Swift 6 language mode pipeline established to catch regressions. --- .github/workflows/pull_request.yml | 9 ++++++--- Package.swift | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 50e00f8..aad89ae 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -15,13 +15,16 @@ jobs: name: Unit tests uses: apple/swift-nio/.github/workflows/unit_tests.yml@main with: - linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -strict-concurrency=complete" - # TODO: `enable -Xswiftc -strict-concurrency=complete` + linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error" linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error" - linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable -Xswiftc -strict-concurrency=complete" + linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable" linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable" linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable" cxx-interop: name: Cxx interop uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main + + swift-6-language-mode: + name: Cxx interop + uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main diff --git a/Package.swift b/Package.swift index 6cce1a8..46e38fe 100644 --- a/Package.swift +++ b/Package.swift @@ -19,7 +19,8 @@ import PackageDescription let swiftSettings: [SwiftSetting] = [ // https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md // Require `any` for existential types. - .enableUpcomingFeature("ExistentialAny") + .enableUpcomingFeature("ExistentialAny"), + .enableExperimentalFeature("StrictConcurrency=complete"), ] let package = Package(