diff --git a/Package@swift-5.4.swift b/Package@swift-5.4.swift deleted file mode 100644 index 042de94..0000000 --- a/Package@swift-5.4.swift +++ /dev/null @@ -1,85 +0,0 @@ -// swift-tools-version:5.4 -//===----------------------------------------------------------------------===// -// -// This source file is part of the SwiftNIO open source project -// -// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See CONTRIBUTORS.txt for the list of SwiftNIO project authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - -import PackageDescription - -let package = Package( - name: "swift-nio-http2", - products: [ - .library(name: "NIOHTTP2", targets: ["NIOHTTP2"]), - ], - dependencies: [ - .package(url: "https://github.com/apple/swift-nio.git", from: "2.35.0"), - .package(url: "https://github.com/apple/swift-atomics.git", from: "1.0.2"), - ], - targets: [ - .executableTarget( - name: "NIOHTTP2Server", - dependencies: [ - "NIOHTTP2", - .product(name: "NIOCore", package: "swift-nio"), - .product(name: "NIOPosix", package: "swift-nio"), - .product(name: "NIOHTTP1", package: "swift-nio"), - ]), - .executableTarget( - name: "NIOHTTP2PerformanceTester", - dependencies: [ - "NIOHTTP2", - .product(name: "NIOCore", package: "swift-nio"), - .product(name: "NIOPosix", package: "swift-nio"), - .product(name: "NIOEmbedded", package: "swift-nio"), - ]), - .target( - name: "NIOHTTP2", - dependencies: [ - "NIOHPACK", - .product(name: "NIO", package: "swift-nio"), - .product(name: "NIOCore", package: "swift-nio"), - .product(name: "NIOHTTP1", package: "swift-nio"), - .product(name: "NIOTLS", package: "swift-nio"), - .product(name: "NIOConcurrencyHelpers", package: "swift-nio"), - .product(name: "Atomics", package: "swift-atomics"), - ]), - .target( - name: "NIOHPACK", - dependencies: [ - .product(name: "NIO", package: "swift-nio"), - .product(name: "NIOCore", package: "swift-nio"), - .product(name: "NIOConcurrencyHelpers", package: "swift-nio"), - .product(name: "NIOHTTP1", package: "swift-nio"), - ]), - .testTarget( - name: "NIOHTTP2Tests", - dependencies: [ - "NIOHTTP2", - .product(name: "NIOCore", package: "swift-nio"), - .product(name: "NIOEmbedded", package: "swift-nio"), - .product(name: "NIOHTTP1", package: "swift-nio"), - .product(name: "NIOFoundationCompat", package: "swift-nio"), - ]), - .testTarget( - name: "NIOHPACKTests", - dependencies: [ - "NIOHPACK", - .product(name: "NIOCore", package: "swift-nio"), - .product(name: "NIOFoundationCompat", package: "swift-nio"), - ], - resources: [ - .copy("Fixtures/large_complex_huffman_b64.txt"), - .copy("Fixtures/large_huffman_b64.txt"), - ] - ) - ] -) diff --git a/Package@swift-5.5.swift b/Package@swift-5.5.swift index 042de94..b060154 100644 --- a/Package@swift-5.5.swift +++ b/Package@swift-5.5.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.4 +// swift-tools-version:5.5 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project diff --git a/README.md b/README.md index 8c22e16..b6e1166 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,15 @@ To depend on `swift-nio-http2`, put the following in the `dependencies` of your .package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.19.2"), -SwiftNIO HTTP2 1.21.x and later support Swift 5.4 and above. 1.20.x and earlier also support Swift 5.2 and 5.3. 1.17.x and earlier also support Swift 5.0 and 5.1. +The most recent versions of SwiftNIO HTTP/2 support Swift 5.5 and newer. The minimum Swift version supported for SwiftNIO HTTP/2 releases are detailed below: + +SwiftNIO HTTP/2 | Minimum Swift Version +--------------------|---------------------- +`1.0.0 ..< 1.18.0` | 5.0 +`1.18.0 ..< 1.21.0` | 5.2 +`1.21.0 ..< 1.23.0` | 5.4 +`1.24.0 ...` | 5.5 + ### `swift-nio-http2` 0.x diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift index 13060b0..7a380f7 100644 --- a/Tests/LinuxMain.swift +++ b/Tests/LinuxMain.swift @@ -26,14 +26,11 @@ import XCTest @testable import NIOHPACKTests @testable import NIOHTTP2Tests -// This protocol is necessary to we can call the 'run' method (on an existential of this protocol) -// without the compiler noticing that we're calling a deprecated function. -// This hack exists so we can deprecate individual tests which test deprecated functionality without -// getting a compiler warning... -protocol LinuxMainRunner { func run() } -class LinuxMainRunnerImpl: LinuxMainRunner { +@main +@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings") +class LinuxMainRunner { @available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings") - func run() { + static func main() { XCTMain([ testCase(CircularBufferExtensionsTests.allTests), testCase(CompoundOutboundBufferTest.allTests), @@ -66,5 +63,4 @@ class LinuxMainRunnerImpl: LinuxMainRunner { ]) } } -(LinuxMainRunnerImpl() as LinuxMainRunner).run() #endif diff --git a/docker/Dockerfile b/docker/Dockerfile index 8ddb46f..641bd14 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -ARG swift_version=5.4 +ARG swift_version=5.7 ARG ubuntu_version=focal ARG base_image=swift:$swift_version-$ubuntu_version FROM $base_image diff --git a/docker/docker-compose.1804.54.yaml b/docker/docker-compose.1804.54.yaml deleted file mode 100644 index 8771a81..0000000 --- a/docker/docker-compose.1804.54.yaml +++ /dev/null @@ -1,44 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: swift-nio-http2:18.04-5.4 - build: - args: - base_image: "swift:5.4-focal" - ubuntu_version: "focal" - swift_version: "5.4" - h2spec_version: "2.2.1" - - unit-tests: - image: swift-nio-http2:18.04-5.4 - command: /bin/bash -xcl "swift test -Xswiftc -warnings-as-errors" - - integration-tests: - image: swift-nio-http2:18.04-5.4 - - performance-test: - image: swift-nio-http2:18.04-5.4 - - h2spec: - image: swift-nio-http2:18.04-5.4 - - test: - image: swift-nio-http2:18.04-5.4 - command: /bin/bash -xcl "swift test -Xswiftc -warnings-as-errors $${SANITIZER_ARG-} && ./scripts/integration_tests.sh && ./scripts/test_h2spec.sh $${SANITIZER_ARG-}" - environment: - - MAX_ALLOCS_ALLOWED_1k_requests_interleaved=46200 - - MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=45100 - - MAX_ALLOCS_ALLOWED_client_server_h1_request_response=313050 - - MAX_ALLOCS_ALLOWED_client_server_request_response=277050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel=42050 - - 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=303350 - - shell: - image: swift-nio-http2:18.04-5.4 diff --git a/docker/docker-compose.2004.57.yaml b/docker/docker-compose.2204.57.yaml similarity index 75% rename from docker/docker-compose.2004.57.yaml rename to docker/docker-compose.2204.57.yaml index fef9a28..1b7baf4 100644 --- a/docker/docker-compose.2004.57.yaml +++ b/docker/docker-compose.2204.57.yaml @@ -3,26 +3,27 @@ version: "3" services: runtime-setup: - image: swift-nio-http2:20.04-5.7 + image: swift-nio-http2:22.04-5.7 build: args: - base_image: "swiftlang/swift:nightly-5.7-focal" + ubuntu_version: "jammy" + swift_version: "5.7" h2spec_version: "2.2.1" unit-tests: - image: swift-nio-http2:20.04-5.7 + image: swift-nio-http2:22.04-5.7 integration-tests: - image: swift-nio-http2:20.04-5.7 + image: swift-nio-http2:22.04-5.7 performance-test: - image: swift-nio-http2:20.04-5.7 + image: swift-nio-http2:22.04-5.7 h2spec: - image: swift-nio-http2:20.04-5.7 + image: swift-nio-http2:22.04-5.7 test: - image: swift-nio-http2:20.04-5.7 + image: swift-nio-http2:22.04-5.7 environment: - MAX_ALLOCS_ALLOWED_1k_requests_interleaved=43200 - MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=42100 @@ -37,4 +38,4 @@ services: - MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent=293350 shell: - image: swift-nio-http2:20.04-5.7 + image: swift-nio-http2:22.04-5.7 diff --git a/scripts/generate_linux_tests.rb b/scripts/generate_linux_tests.rb index c290a61..74d574e 100755 --- a/scripts/generate_linux_tests.rb +++ b/scripts/generate_linux_tests.rb @@ -98,14 +98,11 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files) file.write ' @testable import ' + testSubDirectory + "\n" end file.write "\n" - file.write "// This protocol is necessary to we can call the 'run' method (on an existential of this protocol)\n" - file.write "// without the compiler noticing that we're calling a deprecated function.\n" - file.write "// This hack exists so we can deprecate individual tests which test deprecated functionality without\n" - file.write "// getting a compiler warning...\n" - file.write "protocol LinuxMainRunner { func run() }\n" - file.write "class LinuxMainRunnerImpl: LinuxMainRunner {\n" + file.write "@main\n" + file.write '@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")' + "\n" + file.write "class LinuxMainRunner {\n" file.write ' @available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")' + "\n" - file.write " func run() {\n" + file.write " static func main() {\n" file.write " XCTMain([\n" testCases = [] @@ -121,7 +118,6 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files) file.write " ])\n" file.write " }\n" file.write "}\n" - file.write "(LinuxMainRunnerImpl() as LinuxMainRunner).run()\n" file.write "#endif\n" end end