Skip to content

Commit 4b38f35

Browse files
authored
Drop Swift 5.9 (#536)
Motivation: Swift 5.9 is no longer supported, we should bump the tools version and remove it from our CI. Modifications: * Bump the Swift tools version to Swift 5.10 * Remove Swift 5.9 jobs where appropriate in main.yml, pull_request.yml Result: Code reflects our support window.
1 parent 8061e1e commit 4b38f35

12 files changed

+3
-36
lines changed

.github/workflows/main.yml

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ jobs:
1111
name: Unit tests
1212
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
1313
with:
14-
linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
1514
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
1615
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
1716
linux_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"

.github/workflows/pull_request.yml

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
name: Unit tests
1515
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
1616
with:
17-
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
1817
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
1918
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
2019
linux_6_1_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"

Benchmarks/Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version:5.10
22

33
import PackageDescription
44

Benchmarks/Thresholds/5.9/NIOSSHBenchmarks.ManyWrites.p90.json

-3
This file was deleted.

Benchmarks/Thresholds/5.9/NIOSSHBenchmarks.SimpleHandshake.p90.json

-3
This file was deleted.

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.9
1+
// swift-tools-version:5.10
22
//===----------------------------------------------------------------------===//
33
//
44
// This source file is part of the SwiftNIO open source project

Sources/NIOSSL/ByteBufferBIO.swift

-4
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,8 @@ final class ByteBufferBIO {
175175
/// using a ByteBufferBIO. There will only ever be one value of this in a NIO program,
176176
/// and it will always be non-NULL. Failure to initialize this structure is fatal to
177177
/// the program.
178-
#if compiler(>=5.10)
179178
nonisolated(unsafe) private static let boringSSLBIOMethod: UnsafeMutablePointer<BIO_METHOD> =
180179
buildBoringSSLBIOMethod()
181-
#else
182-
private static let boringSSLBIOMethod: UnsafeMutablePointer<BIO_METHOD> = buildBoringSSLBIOMethod()
183-
#endif
184180

185181
private static func buildBoringSSLBIOMethod() -> UnsafeMutablePointer<BIO_METHOD> {
186182
guard boringSSLIsInitialized else {

Sources/NIOSSL/CustomPrivateKey.swift

-4
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,8 @@ extension SSLConnection {
222222

223223
// We heap-allocate the SSL_PRIVATE_KEY_METHOD we need because we can't define a static stored property with fixed address
224224
// in Swift.
225-
#if compiler(>=5.10)
226225
nonisolated(unsafe) internal let customPrivateKeyMethod: UnsafePointer<SSL_PRIVATE_KEY_METHOD> =
227226
buildCustomPrivateKeyMethod()
228-
#else
229-
internal let customPrivateKeyMethod: UnsafePointer<SSL_PRIVATE_KEY_METHOD> = buildCustomPrivateKeyMethod()
230-
#endif
231227

232228
private func buildCustomPrivateKeyMethod() -> UnsafePointer<SSL_PRIVATE_KEY_METHOD> {
233229
let pointer = UnsafeMutablePointer<SSL_PRIVATE_KEY_METHOD>.allocate(capacity: 1)

Sources/NIOSSLPerformanceTester/main.swift

-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ import Foundation
1717

1818
// MARK: Test Harness
1919

20-
#if compiler(>=5.10)
2120
nonisolated(unsafe) var warning: String = ""
22-
#else
23-
var warning: String = ""
24-
#endif
2521

2622
assert(
2723
{

Tests/NIOSSLTests/CustomPrivateKeyTests.swift

-4
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,11 @@ import XCTest
1919

2020
@testable import NIOSSL
2121

22-
#if compiler(>=5.1)
2322
#if compiler(>=6.1)
2423
internal import CNIOBoringSSL
2524
#else
2625
@_implementationOnly import CNIOBoringSSL
2726
#endif
28-
#else
29-
import CNIOBoringSSL
30-
#endif
3127

3228
// This is a helper that lets us work with an EVP_PKEY.
3329
//

Tests/NIOSSLTests/SecurityFrameworkVerificationTests.swift

-4
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,7 @@ extension SecurityFrameworkVerificationTests {
226226
/// by running the following command, and replacing both served certificates as leaf and intermediate,
227227
/// in that order:
228228
/// `openssl s_client -connect www.apple.com:443 -servername www.apple.com -showcerts`
229-
#if compiler(>=5.10)
230229
nonisolated(unsafe) fileprivate static let appleComCertChain: [SecCertificate] = buildAppleComCertChain()
231-
#else
232-
fileprivate static let appleComCertChain: [SecCertificate] = buildAppleComCertChain()
233-
#endif
234230

235231
fileprivate static func buildAppleComCertChain() -> [SecCertificate] {
236232
#if canImport(Darwin)

Tests/NIOSSLTests/TLSConfigurationTest.swift

+1-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15+
@preconcurrency import Dispatch
1516
import NIOConcurrencyHelpers
1617
import NIOCore
1718
import NIOEmbedded
@@ -27,12 +28,6 @@ internal import CNIOBoringSSL
2728
@_implementationOnly import CNIOBoringSSL
2829
#endif
2930

30-
#if compiler(>=5.8)
31-
@preconcurrency import Dispatch
32-
#else
33-
import Dispatch
34-
#endif
35-
3631
final class ErrorCatcher<T: Error>: ChannelInboundHandler, Sendable {
3732
public typealias InboundIn = Any
3833
let _errors: NIOLockedValueBox<[T]>

0 commit comments

Comments
 (0)