From 5bd06ee1d2af4a66cf643987933eea1b749783a3 Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Wed, 7 May 2025 10:39:06 +0100 Subject: [PATCH] Drop Swift 5.9 (#353) 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. --- .github/workflows/main.yml | 1 - .github/workflows/pull_request.yml | 1 - Benchmarks/Package.swift | 2 +- Package.swift | 2 +- README.md | 19 ++++++++++--------- .../_CryptoExtras/Key Derivation/KDF.swift | 4 ---- .../PBKDF2/BoringSSL/PBKDF2_boring.swift | 5 ----- .../BoringSSL/PBKDF2_commoncrypto.swift | 5 ----- .../Key Derivation/PBKDF2/PBKDF2.swift | 4 ---- .../Scrypt/BoringSSL/Scrypt_boring.swift | 5 ----- .../Key Derivation/Scrypt/Scrypt.swift | 4 ---- 11 files changed, 12 insertions(+), 40 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 844e23a0..96601fa0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,6 @@ jobs: name: Unit tests uses: apple/swift-nio/.github/workflows/unit_tests.yml@main with: - linux_5_9_arguments_override: "--explicit-target-dependency-import-check error" linux_5_10_arguments_override: "--explicit-target-dependency-import-check error" linux_6_0_arguments_override: "--explicit-target-dependency-import-check error" linux_6_1_arguments_override: "--explicit-target-dependency-import-check error" diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 3d5859ba..19600e3a 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -16,7 +16,6 @@ jobs: name: Unit tests uses: apple/swift-nio/.github/workflows/unit_tests.yml@main with: - linux_5_9_arguments_override: "--explicit-target-dependency-import-check error" linux_5_10_arguments_override: "--explicit-target-dependency-import-check error" linux_6_0_arguments_override: "--explicit-target-dependency-import-check error" linux_6_1_arguments_override: "--explicit-target-dependency-import-check error" diff --git a/Benchmarks/Package.swift b/Benchmarks/Package.swift index 31aaa1bf..6b93c2d1 100644 --- a/Benchmarks/Package.swift +++ b/Benchmarks/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version:5.10 import PackageDescription let package = Package( diff --git a/Package.swift b/Package.swift index 3ad7d7a6..9ac597f1 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.10 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftCrypto open source project diff --git a/README.md b/README.md index 9a72b1c3..6c7e8572 100644 --- a/README.md +++ b/README.md @@ -110,15 +110,16 @@ If you believe you have identified a vulnerability in Swift Crypto, please [repo The most recent versions of Swift Crypto support Swift 5.7 and newer. The minimum Swift version supported by Swift Crypto releases are detailed below: -Swift Crypto | Minimum Swift Version -------------------|---------------------- -`2.0.0 ..< 2.1.0` | 5.2 -`2.1.0 ..< 2.2.0` | 5.4 -`2.2.0 ..< 2.4.2` | 5.5 -`2.4.2 ..< 3.1.0` | 5.6 -`3.1.0 ..< 3.3.0` | 5.7 -`3.3.0 ..< 3.8.0` | 5.8 -`3.8.0 ...` | 5.9 +Swift Crypto | Minimum Swift Version +--------------------|---------------------- +`2.0.0 ..< 2.1.0` | 5.2 +`2.1.0 ..< 2.2.0` | 5.4 +`2.2.0 ..< 2.4.2` | 5.5 +`2.4.2 ..< 3.1.0` | 5.6 +`3.1.0 ..< 3.3.0` | 5.7 +`3.3.0 ..< 3.8.0` | 5.8 +`3.9.0 ..< 3.13.0` | 5.9 +`3.13.0 ...` | 5.10 ### Compatibility diff --git a/Sources/_CryptoExtras/Key Derivation/KDF.swift b/Sources/_CryptoExtras/Key Derivation/KDF.swift index 258a7054..3ecae0a2 100644 --- a/Sources/_CryptoExtras/Key Derivation/KDF.swift +++ b/Sources/_CryptoExtras/Key Derivation/KDF.swift @@ -12,11 +12,7 @@ // //===----------------------------------------------------------------------===// import Crypto -#if canImport(Darwin) || swift(>=5.9.1) import Foundation -#else -@preconcurrency import Foundation -#endif /// A container for Key Detivation Function algorithms. @available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *) diff --git a/Sources/_CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_boring.swift b/Sources/_CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_boring.swift index 2279ed1c..e2df821b 100644 --- a/Sources/_CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_boring.swift +++ b/Sources/_CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_boring.swift @@ -12,12 +12,7 @@ // //===----------------------------------------------------------------------===// import Crypto - -#if canImport(Darwin) || swift(>=5.9.1) import Foundation -#else -@preconcurrency import Foundation -#endif #if !canImport(CommonCrypto) @_implementationOnly import CCryptoBoringSSL diff --git a/Sources/_CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_commoncrypto.swift b/Sources/_CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_commoncrypto.swift index 24b7b9b2..ad3217cc 100644 --- a/Sources/_CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_commoncrypto.swift +++ b/Sources/_CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_commoncrypto.swift @@ -12,12 +12,7 @@ // //===----------------------------------------------------------------------===// import Crypto - -#if canImport(Darwin) || swift(>=5.9.1) import Foundation -#else -@preconcurrency import Foundation -#endif #if canImport(CommonCrypto) @_implementationOnly import CommonCrypto diff --git a/Sources/_CryptoExtras/Key Derivation/PBKDF2/PBKDF2.swift b/Sources/_CryptoExtras/Key Derivation/PBKDF2/PBKDF2.swift index bc59237f..90a268cd 100644 --- a/Sources/_CryptoExtras/Key Derivation/PBKDF2/PBKDF2.swift +++ b/Sources/_CryptoExtras/Key Derivation/PBKDF2/PBKDF2.swift @@ -12,11 +12,7 @@ // //===----------------------------------------------------------------------===// import Crypto -#if canImport(Darwin) || swift(>=5.9.1) import Foundation -#else -@preconcurrency import Foundation -#endif #if canImport(CommonCrypto) @available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *) diff --git a/Sources/_CryptoExtras/Key Derivation/Scrypt/BoringSSL/Scrypt_boring.swift b/Sources/_CryptoExtras/Key Derivation/Scrypt/BoringSSL/Scrypt_boring.swift index 08905f83..20371014 100644 --- a/Sources/_CryptoExtras/Key Derivation/Scrypt/BoringSSL/Scrypt_boring.swift +++ b/Sources/_CryptoExtras/Key Derivation/Scrypt/BoringSSL/Scrypt_boring.swift @@ -15,12 +15,7 @@ @_implementationOnly import CCryptoBoringSSL @_implementationOnly import CCryptoBoringSSLShims import Crypto - -#if canImport(Darwin) || swift(>=5.9.1) import Foundation -#else -@preconcurrency import Foundation -#endif #if canImport(Android) import Android diff --git a/Sources/_CryptoExtras/Key Derivation/Scrypt/Scrypt.swift b/Sources/_CryptoExtras/Key Derivation/Scrypt/Scrypt.swift index 3cc7d6d7..47ef6df6 100644 --- a/Sources/_CryptoExtras/Key Derivation/Scrypt/Scrypt.swift +++ b/Sources/_CryptoExtras/Key Derivation/Scrypt/Scrypt.swift @@ -12,11 +12,7 @@ // //===----------------------------------------------------------------------===// import Crypto -#if canImport(Darwin) || swift(>=5.9.1) import Foundation -#else -@preconcurrency import Foundation -#endif @available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *) fileprivate typealias BackingScrypt = BoringSSLScrypt