Skip to content

Commit 00576e6

Browse files
authored
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 [email protected] - Update docs Results: Minimum Swift version is 5.5
1 parent e220d21 commit 00576e6

File tree

8 files changed

+28
-156
lines changed

8 files changed

+28
-156
lines changed

[email protected]

Lines changed: 0 additions & 85 deletions
This file was deleted.

[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.4
1+
// swift-tools-version:5.5
22
//===----------------------------------------------------------------------===//
33
//
44
// This source file is part of the SwiftNIO open source project

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ To depend on `swift-nio-http2`, put the following in the `dependencies` of your
2424

2525
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.19.2"),
2626

27-
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.
27+
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:
28+
29+
SwiftNIO HTTP/2 | Minimum Swift Version
30+
--------------------|----------------------
31+
`1.0.0 ..< 1.18.0` | 5.0
32+
`1.18.0 ..< 1.21.0` | 5.2
33+
`1.21.0 ..< 1.23.0` | 5.4
34+
`1.24.0 ...` | 5.5
35+
2836

2937
### `swift-nio-http2` 0.x
3038

Tests/LinuxMain.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,11 @@ import XCTest
2626
@testable import NIOHPACKTests
2727
@testable import NIOHTTP2Tests
2828

29-
// This protocol is necessary to we can call the 'run' method (on an existential of this protocol)
30-
// without the compiler noticing that we're calling a deprecated function.
31-
// This hack exists so we can deprecate individual tests which test deprecated functionality without
32-
// getting a compiler warning...
33-
protocol LinuxMainRunner { func run() }
34-
class LinuxMainRunnerImpl: LinuxMainRunner {
29+
@main
30+
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
31+
class LinuxMainRunner {
3532
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
36-
func run() {
33+
static func main() {
3734
XCTMain([
3835
testCase(CircularBufferExtensionsTests.allTests),
3936
testCase(CompoundOutboundBufferTest.allTests),
@@ -66,5 +63,4 @@ class LinuxMainRunnerImpl: LinuxMainRunner {
6663
])
6764
}
6865
}
69-
(LinuxMainRunnerImpl() as LinuxMainRunner).run()
7066
#endif

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG swift_version=5.4
1+
ARG swift_version=5.7
22
ARG ubuntu_version=focal
33
ARG base_image=swift:$swift_version-$ubuntu_version
44
FROM $base_image

docker/docker-compose.1804.54.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

docker/docker-compose.2004.57.yaml renamed to docker/docker-compose.2204.57.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,27 @@ version: "3"
33
services:
44

55
runtime-setup:
6-
image: swift-nio-http2:20.04-5.7
6+
image: swift-nio-http2:22.04-5.7
77
build:
88
args:
9-
base_image: "swiftlang/swift:nightly-5.7-focal"
9+
ubuntu_version: "jammy"
10+
swift_version: "5.7"
1011
h2spec_version: "2.2.1"
1112

1213
unit-tests:
13-
image: swift-nio-http2:20.04-5.7
14+
image: swift-nio-http2:22.04-5.7
1415

1516
integration-tests:
16-
image: swift-nio-http2:20.04-5.7
17+
image: swift-nio-http2:22.04-5.7
1718

1819
performance-test:
19-
image: swift-nio-http2:20.04-5.7
20+
image: swift-nio-http2:22.04-5.7
2021

2122
h2spec:
22-
image: swift-nio-http2:20.04-5.7
23+
image: swift-nio-http2:22.04-5.7
2324

2425
test:
25-
image: swift-nio-http2:20.04-5.7
26+
image: swift-nio-http2:22.04-5.7
2627
environment:
2728
- MAX_ALLOCS_ALLOWED_1k_requests_interleaved=43200
2829
- MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=42100
@@ -37,4 +38,4 @@ services:
3738
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent=293350
3839

3940
shell:
40-
image: swift-nio-http2:20.04-5.7
41+
image: swift-nio-http2:22.04-5.7

scripts/generate_linux_tests.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,11 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
9898
file.write ' @testable import ' + testSubDirectory + "\n"
9999
end
100100
file.write "\n"
101-
file.write "// This protocol is necessary to we can call the 'run' method (on an existential of this protocol)\n"
102-
file.write "// without the compiler noticing that we're calling a deprecated function.\n"
103-
file.write "// This hack exists so we can deprecate individual tests which test deprecated functionality without\n"
104-
file.write "// getting a compiler warning...\n"
105-
file.write "protocol LinuxMainRunner { func run() }\n"
106-
file.write "class LinuxMainRunnerImpl: LinuxMainRunner {\n"
101+
file.write "@main\n"
102+
file.write '@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")' + "\n"
103+
file.write "class LinuxMainRunner {\n"
107104
file.write ' @available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")' + "\n"
108-
file.write " func run() {\n"
105+
file.write " static func main() {\n"
109106
file.write " XCTMain([\n"
110107

111108
testCases = []
@@ -121,7 +118,6 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
121118
file.write " ])\n"
122119
file.write " }\n"
123120
file.write "}\n"
124-
file.write "(LinuxMainRunnerImpl() as LinuxMainRunner).run()\n"
125121
file.write "#endif\n"
126122
end
127123
end

0 commit comments

Comments
 (0)