From 31c86098086630732454b7e215819d5d91835220 Mon Sep 17 00:00:00 2001 From: Peter Adams <63288215+PeterAdams-A@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:06:45 +0100 Subject: [PATCH] Drop support for Swift 5.8 (#470) Motivation: Only the last 3 versions of Swift are supported. Modifications: Update the Swift tools version in Package.swift. Remove code which can now never be compiled. Remove legacy docker configuration. Result: Only Swift 5.9+ supported. --- Package.swift | 2 +- .../HTTP2CommonInboundStreamMultiplexer.swift | 16 ------ ...iguringPipelineAsyncMultiplexerTests.swift | 14 ----- docker/docker-compose.2204.58.yaml | 55 ------------------- 4 files changed, 1 insertion(+), 86 deletions(-) delete mode 100644 docker/docker-compose.2204.58.yaml diff --git a/Package.swift b/Package.swift index 8bc3e58e..85d4cbff 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.8 +// swift-tools-version:5.9 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project diff --git a/Sources/NIOHTTP2/HTTP2CommonInboundStreamMultiplexer.swift b/Sources/NIOHTTP2/HTTP2CommonInboundStreamMultiplexer.swift index 8817b8df..0c6f3ee8 100644 --- a/Sources/NIOHTTP2/HTTP2CommonInboundStreamMultiplexer.swift +++ b/Sources/NIOHTTP2/HTTP2CommonInboundStreamMultiplexer.swift @@ -550,19 +550,3 @@ extension NIOHTTP2AsyncSequence.AsyncIterator: Sendable {} @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) extension NIOHTTP2AsyncSequence: Sendable where Output: Sendable {} - -#if compiler(<5.9) -// this should be available in the std lib from 5.9 onwards -@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) -extension AsyncThrowingStream { - static func makeStream( - of elementType: Element.Type = Element.self, - throwing failureType: Failure.Type = Failure.self, - bufferingPolicy limit: Continuation.BufferingPolicy = .unbounded - ) -> (stream: AsyncThrowingStream, continuation: AsyncThrowingStream.Continuation) where Failure == Error { - var continuation: AsyncThrowingStream.Continuation! - let stream = AsyncThrowingStream(bufferingPolicy: limit) { continuation = $0 } - return (stream: stream, continuation: continuation!) - } -} -#endif diff --git a/Tests/NIOHTTP2Tests/ConfiguringPipelineAsyncMultiplexerTests.swift b/Tests/NIOHTTP2Tests/ConfiguringPipelineAsyncMultiplexerTests.swift index a0b4db14..8aa33856 100644 --- a/Tests/NIOHTTP2Tests/ConfiguringPipelineAsyncMultiplexerTests.swift +++ b/Tests/NIOHTTP2Tests/ConfiguringPipelineAsyncMultiplexerTests.swift @@ -579,17 +579,3 @@ final class ConfiguringPipelineAsyncMultiplexerTests: XCTestCase { } } } - -#if compiler(<5.9) -// this should be available in the std lib from 5.9 onwards -extension AsyncStream { - internal static func makeStream( - of elementType: Element.Type = Element.self, - bufferingPolicy limit: Continuation.BufferingPolicy = .unbounded - ) -> (stream: AsyncStream, continuation: AsyncStream.Continuation) { - var continuation: AsyncStream.Continuation! - let stream = AsyncStream(bufferingPolicy: limit) { continuation = $0 } - return (stream: stream, continuation: continuation!) - } -} -#endif diff --git a/docker/docker-compose.2204.58.yaml b/docker/docker-compose.2204.58.yaml deleted file mode 100644 index 1c843b00..00000000 --- a/docker/docker-compose.2204.58.yaml +++ /dev/null @@ -1,55 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: swift-nio-http2:22.04-5.8 - build: - args: - ubuntu_version: "jammy" - swift_version: "5.8" - h2spec_version: "2.2.1" - - unit-tests: - image: swift-nio-http2:22.04-5.8 - - integration-tests: - image: swift-nio-http2:22.04-5.8 - - performance-test: - image: swift-nio-http2:22.04-5.8 - - h2spec: - image: swift-nio-http2:22.04-5.8 - - documentation-check: - image: swift-nio-http2:22.04-5.8 - - test: - image: swift-nio-http2:22.04-5.8 - environment: - - MAX_ALLOCS_ALLOWED_1k_requests_inline_interleaved=30150 - - MAX_ALLOCS_ALLOWED_1k_requests_inline_noninterleaved=29100 - - MAX_ALLOCS_ALLOWED_1k_requests_interleaved=36150 - - MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=35100 - - MAX_ALLOCS_ALLOWED_client_server_h1_request_response=276050 - - MAX_ALLOCS_ALLOWED_client_server_h1_request_response_inline=261050 - - MAX_ALLOCS_ALLOWED_client_server_request_response=245050 - - MAX_ALLOCS_ALLOWED_client_server_request_response_inline=236050 - - MAX_ALLOCS_ALLOWED_client_server_request_response_many=1190050 - - MAX_ALLOCS_ALLOWED_client_server_request_response_many_inline=881050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel=35050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline=35050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline_no_promise_based_API=35050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel_no_promise_based_API=35050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form=200050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace=200050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_long_string=300050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_short_string=200050 - - MAX_ALLOCS_ALLOWED_hpack_decoding=5050 - - MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent=262550 - - MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent_inline=261650 - - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error - - shell: - image: swift-nio-http2:22.04-5.8