Skip to content

Commit de7c84a

Browse files
authored
Bump minimum Swift version to 5.7 (#712)
Motivation: Now that Swift 5.9 is GM we should update the supported versions and remove 5.6 Modifications: * Update `Package.swift` * Remove `#if swift(>=5.7)` guards * Delete the 5.6 docker compose file and make a 5.10 one * Update docs Result: Remove support for Swift 5.6, add 5.10
1 parent 4e74fef commit de7c84a

File tree

8 files changed

+26
-47
lines changed

8 files changed

+26
-47
lines changed

Package.swift

+1-1
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
//
44
// This source file is part of the AsyncHTTPClient open source project

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -328,4 +328,5 @@ AsyncHTTPClient | Minimum Swift Version
328328
`1.5.0 ..< 1.10.0` | 5.2
329329
`1.10.0 ..< 1.13.0` | 5.4
330330
`1.13.0 ..< 1.18.0` | 5.5.2
331-
`1.18.0 ...` | 5.6
331+
`1.18.0 ..< 1.20.0` | 5.6
332+
`1.20.0 ...` | 5.7

Sources/AsyncHTTPClient/HTTPClient.swift

-11
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,13 @@ public class HTTPClient {
166166
}
167167
}
168168

169-
#if swift(>=5.7)
170169
/// Shuts down the client and `EventLoopGroup` if it was created by the client.
171170
///
172171
/// This method blocks the thread indefinitely, prefer using ``shutdown()-96ayw``.
173172
@available(*, noasync, message: "syncShutdown() can block indefinitely, prefer shutdown()", renamed: "shutdown()")
174173
public func syncShutdown() throws {
175174
try self.syncShutdown(requiresCleanClose: false)
176175
}
177-
#else
178-
/// Shuts down the client and `EventLoopGroup` if it was created by the client.
179-
///
180-
/// This method blocks the thread indefinitely, prefer using ``shutdown()-96ayw``.
181-
public func syncShutdown() throws {
182-
try self.syncShutdown(requiresCleanClose: false)
183-
}
184-
#endif
185176

186177
/// Shuts down the client and `EventLoopGroup` if it was created by the client.
187178
///
@@ -921,9 +912,7 @@ extension HTTPClient {
921912
}
922913
}
923914

924-
#if swift(>=5.7)
925915
extension HTTPClient.Configuration: Sendable {}
926-
#endif
927916

928917
extension HTTPClient.EventLoopGroupProvider: Sendable {}
929918
extension HTTPClient.EventLoopPreference: Sendable {}

Sources/AsyncHTTPClient/HTTPHandler.swift

-10
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,6 @@ extension HTTPClient {
750750
return self.promise.futureResult
751751
}
752752

753-
#if swift(>=5.7)
754753
/// Waits for execution of this request to complete.
755754
///
756755
/// - returns: The value of ``futureResult`` when it completes.
@@ -759,15 +758,6 @@ extension HTTPClient {
759758
public func wait() throws -> Response {
760759
return try self.promise.futureResult.wait()
761760
}
762-
#else
763-
/// Waits for execution of this request to complete.
764-
///
765-
/// - returns: The value of ``futureResult`` when it completes.
766-
/// - throws: The error value of ``futureResult`` if it errors.
767-
public func wait() throws -> Response {
768-
return try self.promise.futureResult.wait()
769-
}
770-
#endif
771761

772762
/// Provides the result of this request.
773763
///

Tests/AsyncHTTPClientTests/HTTPClientRequestTests.swift

-2
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,6 @@ class HTTPClientRequestTests: XCTestCase {
522522
XCTAssertEqual(body, expectedChunks)
523523
}
524524

525-
#if swift(>=5.7)
526525
func testChunkingSequenceFastPath() async throws {
527526
func makeBytes() -> some Sequence<UInt8> & Sendable {
528527
Array(repeating: 0, count: bagOfBytesToByteBufferConversionChunkSize) +
@@ -569,7 +568,6 @@ class HTTPClientRequestTests: XCTestCase {
569568

570569
XCTAssertEqual(body, expectedChunks)
571570
}
572-
#endif
573571

574572
func testBodyStringChunking() throws {
575573
let body = try HTTPClient.Body.string(

docker/docker-compose.2004.56.yaml

-21
This file was deleted.

docker/docker-compose.2204.510.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: "3"
2+
3+
services:
4+
5+
runtime-setup:
6+
image: async-http-client:22.04-5.10
7+
build:
8+
args:
9+
base_image: "swiftlang/swift:nightly-5.10-jammy"
10+
11+
documentation-check:
12+
image: async-http-client:22.04-5.10
13+
14+
test:
15+
image: async-http-client:22.04-5.10
16+
environment:
17+
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
18+
#- SANITIZER_ARG=--sanitize=thread
19+
20+
shell:
21+
image: async-http-client:22.04-5.10

docker/docker-compose.2204.59.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ services:
66
image: async-http-client:22.04-5.9
77
build:
88
args:
9-
base_image: "swiftlang/swift:nightly-5.9-jammy"
9+
ubuntu_version: "jammy"
10+
swift_version: "5.9"
1011

1112
documentation-check:
1213
image: async-http-client:22.04-5.9

0 commit comments

Comments
 (0)