Skip to content

Commit d090cf4

Browse files
authored
Drop Swift 5.6 (#1657)
Motivation: Now that Swift 5.9 has been released we can drop support for Swift 5.6. Modifications: - Update CI - Update minimum tools version - Remove code conditioned on Swift version - Update README Result: Swift 5.7 is the minimum supported Swift version
1 parent 5ea1768 commit d090cf4

File tree

7 files changed

+23
-39
lines changed

7 files changed

+23
-39
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
include:
27-
- image: swiftlang/swift:nightly-focal
27+
- image: swiftlang/swift:nightly-jammy
2828
# No TSAN because of: https://github.com/apple/swift/issues/59068
2929
# swift-test-flags: "--sanitize=thread"
30-
- image: swift:5.8-jammy
30+
- image: swift:5.9-jammy
3131
# No TSAN because of: https://github.com/apple/swift/issues/59068
3232
# swift-test-flags: "--sanitize=thread"
33-
- image: swift:5.7-jammy
33+
- image: swift:5.8-focal
3434
# No TSAN because of: https://github.com/apple/swift/issues/59068
3535
# swift-test-flags: "--sanitize=thread"
36-
- image: swift:5.6-focal
36+
- image: swift:5.7-focal
3737
# No TSAN because of: https://github.com/apple/swift/issues/59068
3838
# swift-test-flags: "--sanitize=thread"
3939
name: Build and Test on ${{ matrix.image }}
@@ -46,16 +46,14 @@ jobs:
4646
run: swift build ${{ matrix.swift-build-flags }}
4747
timeout-minutes: 20
4848
- name: 🧪 Test
49-
# Skip tests on 5.6: https://bugs.swift.org/browse/SR-15955
50-
if: ${{ matrix.image != 'swift:5.6-focal' }}
5149
run: swift test ${{ matrix.swift-test-flags }}
5250
timeout-minutes: 20
5351
performance-tests:
5452
strategy:
5553
fail-fast: false
5654
matrix:
5755
include:
58-
- image: swiftlang/swift:nightly-focal
56+
- image: swiftlang/swift:nightly-jammy
5957
env:
6058
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
6159
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
@@ -65,7 +63,7 @@ jobs:
6563
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
6664
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
6765
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
68-
- image: swift:5.8-jammy
66+
- image: swift:5.9-jammy
6967
env:
7068
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
7169
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
@@ -75,7 +73,7 @@ jobs:
7573
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
7674
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
7775
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
78-
- image: swift:5.7-jammy
76+
- image: swift:5.8-focal
7977
env:
8078
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
8179
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
@@ -85,16 +83,16 @@ jobs:
8583
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
8684
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
8785
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
88-
- image: swift:5.6-focal
86+
- image: swift:5.7-focal
8987
env:
90-
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 324000
91-
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 162000
88+
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
89+
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
9290
MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
9391
MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
9492
MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
95-
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 164000
96-
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 171000
97-
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 171000
93+
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
94+
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
95+
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
9896
name: Performance Tests on ${{ matrix.image }}
9997
runs-on: ubuntu-latest
10098
container:
@@ -110,10 +108,10 @@ jobs:
110108
fail-fast: false
111109
matrix:
112110
include:
113-
- image: swiftlang/swift:nightly-focal
114-
- image: swift:5.8-jammy
115-
- image: swift:5.7-jammy
116-
- image: swift:5.6-focal
111+
- image: swiftlang/swift:nightly-jammy
112+
- image: swift:5.9-jammy
113+
- image: swift:5.8-focal
114+
- image: swift:5.7-focal
117115
name: Integration Tests on ${{ matrix.image }}
118116
runs-on: ubuntu-latest
119117
container:

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.6
1+
// swift-tools-version:5.7
22
/*
33
* Copyright 2017, gRPC Authors All rights reserved.
44
*

Performance/QPSBenchmark/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.6
1+
// swift-tools-version:5.7
22
/*
33
* Copyright 2020, gRPC Authors All rights reserved.
44
*

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ gRPC Swift Version | Earliest Swift Version
4242
`1.0.0 ..< 1.8.0` | 5.2
4343
`1.8.0 ..< 1.11.0` | 5.4
4444
`1.11.0..< 1.16.0`.| 5.5
45-
`1.16.0...` | 5.6
45+
`1.16.0..< 1.20.0` | 5.6
46+
`1.20.0...` | 5.7
4647

4748
Versions of clients and services which are use Swift's Concurrency support
4849
are available from gRPC Swift 1.8.0 and require Swift 5.6 and newer.

Sources/GRPC/Docs.docc/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ gRPC Swift Version | Earliest Swift Version
2727
`1.0.0 ..< 1.8.0` | 5.2
2828
`1.8.0 ..< 1.11.0` | 5.4
2929
`1.11.0..< 1.16.0`.| 5.5
30-
`1.16.0...` | 5.6
30+
`1.16.0..< 1.20.0` | 5.6
31+
`1.20.0...` | 5.7
3132

3233
Versions of clients and services which are use Swift's Concurrency support
3334
are available from gRPC Swift 1.8.0 and require Swift 5.6 and newer.

Sources/GRPC/PlatformSupport.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,8 @@ public protocol ClientBootstrapProtocol {
123123
func connectTimeout(_ timeout: TimeAmount) -> Self
124124
func channelOption<T>(_ option: T, value: T.Value) -> Self where T: ChannelOption
125125

126-
#if swift(>=5.7)
127126
@preconcurrency
128127
func channelInitializer(_ handler: @escaping @Sendable (Channel) -> EventLoopFuture<Void>) -> Self
129-
#else
130-
func channelInitializer(_ handler: @escaping (Channel) -> EventLoopFuture<Void>) -> Self
131-
#endif
132128
}
133129

134130
extension ClientBootstrapProtocol {
@@ -161,24 +157,16 @@ public protocol ServerBootstrapProtocol {
161157
func withBoundSocket(_ connectedSocket: NIOBSDSocket.Handle) -> EventLoopFuture<Channel>
162158
func bind(to vsockAddress: VsockAddress) -> EventLoopFuture<Channel>
163159

164-
#if swift(>=5.7)
165160
@preconcurrency
166161
func serverChannelInitializer(
167162
_ handler: @escaping @Sendable (Channel) -> EventLoopFuture<Void>
168163
) -> Self
169-
#else
170-
func serverChannelInitializer(_ handler: @escaping (Channel) -> EventLoopFuture<Void>) -> Self
171-
#endif
172164

173165
func serverChannelOption<T>(_ option: T, value: T.Value) -> Self where T: ChannelOption
174166

175-
#if swift(>=5.7)
176167
@preconcurrency
177168
func childChannelInitializer(_ handler: @escaping @Sendable (Channel) -> EventLoopFuture<Void>)
178169
-> Self
179-
#else
180-
func childChannelInitializer(_ handler: @escaping (Channel) -> EventLoopFuture<Void>) -> Self
181-
#endif
182170

183171
func childChannelOption<T>(_ option: T, value: T.Value) -> Self where T: ChannelOption
184172
}

Sources/GRPC/Server.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,7 @@ extension Server.Configuration.CORS.AllowedOrigins {
569569
struct AnyCustomCORSAllowedOrigin: GRPCCustomCORSAllowedOrigin {
570570
private var checkOrigin: @Sendable (String) -> String?
571571
private let hashInto: @Sendable (inout Hasher) -> Void
572-
#if swift(>=5.7)
573572
private let isEqualTo: @Sendable (any GRPCCustomCORSAllowedOrigin) -> Bool
574-
#else
575-
private let isEqualTo: @Sendable (Any) -> Bool
576-
#endif
577573

578574
init<W: GRPCCustomCORSAllowedOrigin>(_ wrap: W) {
579575
self.checkOrigin = { wrap.check(origin: $0) }

0 commit comments

Comments
 (0)