mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-27 05:04:23 +00:00
Raise minimum supported Swift version from 5.4 to 5.5 (#355)
Motivation: SwiftNIO periodically drops support for older Swift versions. Now that 5.7 has been released, 5.4 will be dropped. Modifications: - Remove 5.4 specific Package.swift and docker-compose - Update the 5.7 docker-compose to use the released 5.7 and move from focal (2004) to jammy (2204) - Fix tools version in Package@swift-5.5.swift - Update docs Results: Minimum Swift version is 5.5
This commit is contained in:
1 parent
e220d2130b
commit
00576e6f1e
8 files changed
+28
-156
No files matched your search
@@ -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"),
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user