From 2a02a423c072a3363a361dd57d7f5c620e94c169 Mon Sep 17 00:00:00 2001 From: Tim Morgan Date: Fri, 4 Sep 2026 01:19:49 -0700 Subject: [PATCH] Normalize Swift toolchain settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shared `upcomingFeatures` array turns on ImmutableWeakCaptures, MemberImportVisibility, ExistentialAny, and InternalImportsByDefault alongside the two approachable-concurrency flags, and the executable target adopts it. Tools-version stays at 6.3 with `swiftLanguageModes: [.v6]`, since this package is a build tool for the site rather than a published library and has no older-toolchain consumers to support. InternalImportsByDefault produced no fallout — the target exposes no public API — leaving one `any Encoder` fix-it from the ExistentialAny migrator as the only source change. CI pins one toolchain everywhere: Swift 6.3 on macos-26 with an unpinned `latest-stable` Xcode, and the Linux swift-format job runs in `swift:6.3`. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01EtA5RwfPWtcxu2NfAHfjAr --- .github/workflows/ci.yml | 6 +++--- .github/workflows/periphery.yml | 2 +- Package.swift | 10 +++++++--- Sources/lib/Games.swift | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a82ef7c..2fa5321 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v6 - uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: "26.4" + xcode-version: "latest-stable" - uses: SwiftyLab/setup-swift@latest with: swift-version: "6.3" @@ -45,7 +45,7 @@ jobs: name: Run swift-format runs-on: ubuntu-latest container: - image: swift:latest + image: swift:6.3 steps: - uses: actions/checkout@v6 - name: Download .swift-format config @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@v6 - uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: "26.4" + xcode-version: "latest-stable" - uses: SwiftyLab/setup-swift@latest with: swift-version: "6.3" diff --git a/.github/workflows/periphery.yml b/.github/workflows/periphery.yml index 64e9c4f..8c89b18 100644 --- a/.github/workflows/periphery.yml +++ b/.github/workflows/periphery.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v6 - uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: "26.4" + xcode-version: "latest-stable" - uses: SwiftyLab/setup-swift@latest with: swift-version: "6.3" diff --git a/Package.swift b/Package.swift index c07137d..8ac9e48 100644 --- a/Package.swift +++ b/Package.swift @@ -3,9 +3,13 @@ import PackageDescription -let approachableConcurrency: [SwiftSetting] = [ +let upcomingFeatures: [SwiftSetting] = [ .enableUpcomingFeature("NonisolatedNonsendingByDefault"), - .enableUpcomingFeature("InferIsolatedConformances") + .enableUpcomingFeature("InferIsolatedConformances"), + .enableUpcomingFeature("ImmutableWeakCaptures"), + .enableUpcomingFeature("MemberImportVisibility"), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault") ] let package = Package( @@ -28,7 +32,7 @@ let package = Package( .product(name: "Algorithms", package: "swift-algorithms"), .product(name: "Progress", package: "Progress.swift") ], - swiftSettings: approachableConcurrency + swiftSettings: upcomingFeatures ) ], swiftLanguageModes: [.v6] diff --git a/Sources/lib/Games.swift b/Sources/lib/Games.swift index dc769d1..74b2e91 100644 --- a/Sources/lib/Games.swift +++ b/Sources/lib/Games.swift @@ -12,7 +12,7 @@ struct Game: Codable { /// All other words that can be formed by combinations of the tiles. let otherWords: Set - func encode(to encoder: Encoder) throws { + func encode(to encoder: any Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(tiles.shuffled(), forKey: .tiles)