From 9cd2881c8c4eec6aa9c115f53a69fcab0ba9f75b Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Wed, 4 Oct 2023 09:26:21 +0100 Subject: [PATCH] Bump minimum Swift version to 5.7 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 --- Package.swift | 2 +- README.md | 3 ++- Sources/AsyncHTTPClient/HTTPClient.swift | 11 ---------- Sources/AsyncHTTPClient/HTTPHandler.swift | 10 --------- .../HTTPClientRequestTests.swift | 2 -- docker/docker-compose.2004.56.yaml | 21 ------------------- docker/docker-compose.2204.510.yaml | 21 +++++++++++++++++++ docker/docker-compose.2204.59.yaml | 3 ++- 8 files changed, 26 insertions(+), 47 deletions(-) delete mode 100644 docker/docker-compose.2004.56.yaml create mode 100644 docker/docker-compose.2204.510.yaml diff --git a/Package.swift b/Package.swift index db458583c..23a733d75 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.6 +// swift-tools-version:5.7 //===----------------------------------------------------------------------===// // // This source file is part of the AsyncHTTPClient open source project diff --git a/README.md b/README.md index 806cc2960..45a847fea 100644 --- a/README.md +++ b/README.md @@ -328,4 +328,5 @@ AsyncHTTPClient | Minimum Swift Version `1.5.0 ..< 1.10.0` | 5.2 `1.10.0 ..< 1.13.0` | 5.4 `1.13.0 ..< 1.18.0` | 5.5.2 -`1.18.0 ...` | 5.6 +`1.18.0 ..< 1.20.0` | 5.6 +`1.20.0 ...` | 5.7 diff --git a/Sources/AsyncHTTPClient/HTTPClient.swift b/Sources/AsyncHTTPClient/HTTPClient.swift index f39a86c95..46d238b23 100644 --- a/Sources/AsyncHTTPClient/HTTPClient.swift +++ b/Sources/AsyncHTTPClient/HTTPClient.swift @@ -166,7 +166,6 @@ public class HTTPClient { } } - #if swift(>=5.7) /// Shuts down the client and `EventLoopGroup` if it was created by the client. /// /// This method blocks the thread indefinitely, prefer using ``shutdown()-96ayw``. @@ -174,14 +173,6 @@ public class HTTPClient { public func syncShutdown() throws { try self.syncShutdown(requiresCleanClose: false) } - #else - /// Shuts down the client and `EventLoopGroup` if it was created by the client. - /// - /// This method blocks the thread indefinitely, prefer using ``shutdown()-96ayw``. - public func syncShutdown() throws { - try self.syncShutdown(requiresCleanClose: false) - } - #endif /// Shuts down the client and `EventLoopGroup` if it was created by the client. /// @@ -921,9 +912,7 @@ extension HTTPClient { } } -#if swift(>=5.7) extension HTTPClient.Configuration: Sendable {} -#endif extension HTTPClient.EventLoopGroupProvider: Sendable {} extension HTTPClient.EventLoopPreference: Sendable {} diff --git a/Sources/AsyncHTTPClient/HTTPHandler.swift b/Sources/AsyncHTTPClient/HTTPHandler.swift index 33e68995e..98415a124 100644 --- a/Sources/AsyncHTTPClient/HTTPHandler.swift +++ b/Sources/AsyncHTTPClient/HTTPHandler.swift @@ -750,7 +750,6 @@ extension HTTPClient { return self.promise.futureResult } - #if swift(>=5.7) /// Waits for execution of this request to complete. /// /// - returns: The value of ``futureResult`` when it completes. @@ -759,15 +758,6 @@ extension HTTPClient { public func wait() throws -> Response { return try self.promise.futureResult.wait() } - #else - /// Waits for execution of this request to complete. - /// - /// - returns: The value of ``futureResult`` when it completes. - /// - throws: The error value of ``futureResult`` if it errors. - public func wait() throws -> Response { - return try self.promise.futureResult.wait() - } - #endif /// Provides the result of this request. /// diff --git a/Tests/AsyncHTTPClientTests/HTTPClientRequestTests.swift b/Tests/AsyncHTTPClientTests/HTTPClientRequestTests.swift index 3536160fd..f0a329f2a 100644 --- a/Tests/AsyncHTTPClientTests/HTTPClientRequestTests.swift +++ b/Tests/AsyncHTTPClientTests/HTTPClientRequestTests.swift @@ -522,7 +522,6 @@ class HTTPClientRequestTests: XCTestCase { XCTAssertEqual(body, expectedChunks) } - #if swift(>=5.7) func testChunkingSequenceFastPath() async throws { func makeBytes() -> some Sequence & Sendable { Array(repeating: 0, count: bagOfBytesToByteBufferConversionChunkSize) + @@ -569,7 +568,6 @@ class HTTPClientRequestTests: XCTestCase { XCTAssertEqual(body, expectedChunks) } - #endif func testBodyStringChunking() throws { let body = try HTTPClient.Body.string( diff --git a/docker/docker-compose.2004.56.yaml b/docker/docker-compose.2004.56.yaml deleted file mode 100644 index b496e8484..000000000 --- a/docker/docker-compose.2004.56.yaml +++ /dev/null @@ -1,21 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: async-http-client:20.04-5.6 - build: - args: - ubuntu_version: "focal" - swift_version: "5.6" - - documentation-check: - image: async-http-client:20.04-5.6 - - test: - image: async-http-client:20.04-5.6 - environment: [] - #- SANITIZER_ARG=--sanitize=thread - - shell: - image: async-http-client:20.04-5.6 diff --git a/docker/docker-compose.2204.510.yaml b/docker/docker-compose.2204.510.yaml new file mode 100644 index 000000000..fdc3d2bdd --- /dev/null +++ b/docker/docker-compose.2204.510.yaml @@ -0,0 +1,21 @@ +version: "3" + +services: + + runtime-setup: + image: async-http-client:22.04-5.10 + build: + args: + base_image: "swiftlang/swift:nightly-5.10-jammy" + + documentation-check: + image: async-http-client:22.04-5.10 + + test: + image: async-http-client:22.04-5.10 + environment: + - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error + #- SANITIZER_ARG=--sanitize=thread + + shell: + image: async-http-client:22.04-5.10 diff --git a/docker/docker-compose.2204.59.yaml b/docker/docker-compose.2204.59.yaml index 2c5a9e297..b125fff39 100644 --- a/docker/docker-compose.2204.59.yaml +++ b/docker/docker-compose.2204.59.yaml @@ -6,7 +6,8 @@ services: image: async-http-client:22.04-5.9 build: args: - base_image: "swiftlang/swift:nightly-5.9-jammy" + ubuntu_version: "jammy" + swift_version: "5.9" documentation-check: image: async-http-client:22.04-5.9