Browse Source

Raise minimum Swift version to 5.9 (#2064)

Motivation:

We support the last three released versions of Swift. Now that Swift 6.0
has been released that's 6.0, 5.10, and 5.9. We no longer need to
support Swift 5.8.

Modifications:

- Update CI
- Update docs
- Remove swift-testing package dependency for Swift 6 as it's now
included in the toolchain

Result:

Swift 5.8 is no longer supported
George Barnett 1 year ago
parent
commit
78da46d618
4 changed files with 7 additions and 35 deletions
  1. 4 21
      .github/workflows/ci.yaml
  2. 1 1
      Package.swift
  3. 0 12
      Package@swift-6.swift
  4. 2 1
      Sources/GRPC/Docs.docc/index.md

+ 4 - 21
.github/workflows/ci.yaml

@@ -9,7 +9,7 @@ jobs:
     name: License Header and Formatting Checks
     runs-on: ubuntu-latest
     container:
-      image: swiftlang/swift:nightly-6.0-jammy
+      image: swift:6.0-jammy
     steps:
     - name: "Checkout repository"
       uses: actions/checkout@v4
@@ -28,7 +28,7 @@ jobs:
           - image: swiftlang/swift:nightly-jammy
             # No TSAN because of: https://github.com/apple/swift/issues/59068
             # swift-test-flags: "--sanitize=thread"
-          - image: swiftlang/swift:nightly-6.0-jammy
+          - image: swift:6.0-jammy
             # No TSAN because of: https://github.com/apple/swift/issues/59068
             # swift-test-flags: "--sanitize=thread"
           - image: swift:5.10.1-noble
@@ -37,9 +37,6 @@ jobs:
           - image: swift:5.9-jammy
             # No TSAN because of: https://github.com/apple/swift/issues/59068
             # swift-test-flags: "--sanitize=thread"
-          - image: swift:5.8-focal
-            # No TSAN because of: https://github.com/apple/swift/issues/59068
-            # swift-test-flags: "--sanitize=thread"
     name: Build and Test on ${{ matrix.image }}
     runs-on: ubuntu-latest
     container:
@@ -68,7 +65,7 @@ jobs:
               MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
               MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
               MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
-          - image: swiftlang/swift:nightly-6.0-jammy
+          - image: swift:6.0-jammy
             swift-version: '6.0'
             env:
               MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
@@ -101,17 +98,6 @@ jobs:
               MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
               MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
               MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
-          - image: swift:5.8-focal
-            swift-version: 5.8
-            env:
-              MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
-              MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
-              MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
-              MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
-              MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
-              MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
-              MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
-              MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
     name: Performance Tests on ${{ matrix.image }}
     runs-on: ubuntu-latest
     container:
@@ -139,7 +125,7 @@ jobs:
           - image: swiftlang/swift:nightly-jammy
             swift-tools-version: '6.0'
             supports-v2: true
-          - image: swiftlang/swift:nightly-6.0-jammy
+          - image: swift:6.0-jammy
             swift-tools-version: '6.0'
             supports-v2: true
           - image: swift:5.10.1-noble
@@ -148,9 +134,6 @@ jobs:
           - image: swift:5.9-jammy
             swift-tools-version: '5.9'
             supports-v2: false
-          - image: swift:5.8-focal
-            swift-tools-version: '5.8'
-            supports-v2: false
     name: Integration Tests on ${{ matrix.image }}
     runs-on: ubuntu-latest
     container:

+ 1 - 1
Package.swift

@@ -1,4 +1,4 @@
-// swift-tools-version:5.8
+// swift-tools-version:5.9
 /*
  * Copyright 2017, gRPC Authors All rights reserved.
  *

+ 0 - 12
Package@swift-6.swift

@@ -72,10 +72,6 @@ let packageDependencies: [Package.Dependency] = [
     url: "https://github.com/apple/swift-distributed-tracing.git",
     from: "1.0.0"
   ),
-  .package(
-    url: "https://github.com/swiftlang/swift-testing.git",
-    branch: "release/6.0"
-  ),
 ].appending(
   .package(
     url: "https://github.com/apple/swift-nio-ssl.git",
@@ -151,13 +147,6 @@ extension Target.Dependency {
   static var dequeModule: Self { .product(name: "DequeModule", package: "swift-collections") }
   static var atomics: Self { .product(name: "Atomics", package: "swift-atomics") }
   static var tracing: Self { .product(name: "Tracing", package: "swift-distributed-tracing") }
-  static var testing: Self {
-    .product(
-      name: "Testing",
-      package: "swift-testing",
-      condition: .when(platforms: [.linux]) // Already included in the toolchain on Darwin
-    )
-  }
 
   static var grpcCore: Self { .target(name: "GRPCCore") }
   static var grpcInProcessTransport: Self { .target(name: "GRPCInProcessTransport") }
@@ -413,7 +402,6 @@ extension Target {
         .grpcInProcessTransport,
         .dequeModule,
         .protobuf,
-        .testing,
       ],
       resources: [
         .copy("Configuration/Inputs")

+ 2 - 1
Sources/GRPC/Docs.docc/index.md

@@ -29,7 +29,8 @@ gRPC Swift Version | Earliest Swift Version
 `1.11.0..< 1.16.0`.| 5.5
 `1.16.0..< 1.20.0` | 5.6
 `1.20.0..< 1.22.0` | 5.7
-`1.22.0...`        | 5.8
+`1.22.0..< 1.24.0` | 5.8
+`1.24.0...`        | 5.9
 
 Versions of clients and services which are use Swift's Concurrency support
 are available from gRPC Swift 1.8.0 and require Swift 5.6 and newer.