From aaac44e056d3a8e2600962cd63a928dad44568e6 Mon Sep 17 00:00:00 2001 From: Fabian Boemer Date: Mon, 11 Nov 2024 08:59:48 -0800 Subject: [PATCH] Update to latest swift-homomorphic-encryption and adopt swift 6 --- .github/workflows/ci.yaml | 2 +- Package.resolved | 63 +++++++++---------- Package.swift | 8 ++- README.md | 2 +- .../Controllers/PrivacyPassController.swift | 9 --- .../PrivacyPass/TokenIssuerDirectory.swift | 5 -- 6 files changed, 38 insertions(+), 51 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 54716fd..4909f23 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,7 +36,7 @@ jobs: strategy: fail-fast: false matrix: - swift: [ "5.10", "6.0" ] + swift: [ "6.0" ] name: swift ${{ matrix.swift }} tests steps: - uses: slashmo/install-swift@v0.4.0 diff --git a/Package.resolved b/Package.resolved index 0f0f029..244db9c 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "69e696bfbcaf0edafc74f37f96ccc1c90f8d1cf6847aeebfd6e2b90240acef7b", + "originHash" : "e8f3c77635a38c01853b4b0ecb7ce6dc069868602c5669bc662ad2c5148b86b2", "pins" : [ { "identity" : "async-http-client", "kind" : "remoteSourceControl", "location" : "https://github.com/swift-server/async-http-client.git", "state" : { - "revision" : "64abc77edf1ef81e69bd90a2ac386de615c8e8ea", - "version" : "1.23.0" + "revision" : "0a9b72369b9d87ab155ef585ef50700a34abf070", + "version" : "1.23.1" } }, { @@ -15,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/adam-fowler/compress-nio.git", "state" : { - "revision" : "a52d3ac5f48820846d34d78d6f59316481e84968", - "version" : "1.2.1" + "revision" : "9dedf2c97c00792ffdf436601cdef1f60a90e0ad", + "version" : "1.3.0" } }, { @@ -24,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/hummingbird-project/hummingbird", "state" : { - "revision" : "d4f792d209f02b26a17c0105751220da65207fb2", - "version" : "2.0.1" + "revision" : "417fa852757a3673739f4f68c67a56f1ce6ab87a", + "version" : "2.3.0" } }, { @@ -60,8 +60,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-asn1.git", "state" : { - "revision" : "df5d2fcd22e3f480e3ef85bf23e277a4a0ef524d", - "version" : "1.2.0" + "revision" : "7faebca1ea4f9aaf0cda1cef7c43aecd2311ddf6", + "version" : "1.3.0" } }, { @@ -69,8 +69,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-async-algorithms.git", "state" : { - "revision" : "6ae9a051f76b81cc668305ceed5b0e0a7fd93d20", - "version" : "1.0.1" + "revision" : "5c8bd186f48c16af0775972700626f0b74588278", + "version" : "1.0.2" } }, { @@ -96,8 +96,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-crypto.git", "state" : { - "revision" : "ffca28be3c9c6a86a579949d23f68818a4b9b5d8", - "version" : "3.8.0" + "revision" : "06dc63c6d8da54ee11ceb268cde1fa68161afc96", + "version" : "3.9.1" } }, { @@ -105,8 +105,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-distributed-tracing.git", "state" : { - "revision" : "11c756c5c4d7de0eeed8595695cadd7fa107aa19", - "version" : "1.1.1" + "revision" : "6483d340853a944c96dbcc28b27dd10b6c581703", + "version" : "1.1.2" } }, { @@ -132,8 +132,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-homomorphic-encryption", "state" : { - "revision" : "1d7e43a45123ce3190b0545fad05bde25d28980c", - "version" : "1.0.1" + "revision" : "7091583923d9e25ec760e8479b56f6aefd7fa6d5" } }, { @@ -168,8 +167,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "665206000b8307cab5ac51203d29b0f232d7e31b", - "version" : "2.74.0" + "revision" : "914081701062b11e3bb9e21accc379822621995e", + "version" : "2.76.1" } }, { @@ -177,8 +176,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-extras.git", "state" : { - "revision" : "d1ead62745cc3269e482f1c51f27608057174379", - "version" : "1.24.0" + "revision" : "2e9746cfc57554f70b650b021b6ae4738abef3e6", + "version" : "1.24.1" } }, { @@ -186,8 +185,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-http2.git", "state" : { - "revision" : "b5f7062b60e4add1e8c343ba4eb8da2e324b3a94", - "version" : "1.34.0" + "revision" : "eaa71bb6ae082eee5a07407b1ad0cbd8f48f9dca", + "version" : "1.34.1" } }, { @@ -195,8 +194,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-ssl.git", "state" : { - "revision" : "7b84abbdcef69cc3be6573ac12440220789dcd69", - "version" : "2.27.2" + "revision" : "c7e95421334b1068490b5d41314a50e70bab23d1", + "version" : "2.29.0" } }, { @@ -204,14 +203,14 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-transport-services.git", "state" : { - "revision" : "38ac8221dd20674682148d6451367f89c2652980", - "version" : "1.21.0" + "revision" : "bbd5e63cf949b7db0c9edaf7a21e141c52afe214", + "version" : "1.23.0" } }, { "identity" : "swift-numerics", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-numerics", + "location" : "https://github.com/apple/swift-numerics.git", "state" : { "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", "version" : "1.0.2" @@ -240,8 +239,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/swift-server/swift-service-lifecycle.git", "state" : { - "revision" : "24c800fb494fbee6e42bc156dc94232dc08971af", - "version" : "2.6.1" + "revision" : "f70b838872863396a25694d8b19fe58bcd0b7903", + "version" : "2.6.2" } }, { @@ -249,8 +248,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "d2ba781702a1d8285419c15ee62fd734a9437ff5", - "version" : "1.3.2" + "revision" : "c8a44d836fe7913603e246acab7c528c2e780168", + "version" : "1.4.0" } } ], diff --git a/Package.swift b/Package.swift index 04f0014..b49b159 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.10 +// swift-tools-version: 6.0 // The swift-tools-version declares the minimum version of Swift required to build this package. // Copyright 2024 Apple Inc. and the Swift Homomorphic Encryption project authors @@ -33,7 +33,9 @@ let package = Package( .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.0"), .package(url: "https://github.com/apple/swift-asn1.git", from: "1.0.0"), .package(url: "https://github.com/apple/swift-crypto.git", from: "3.5.0"), - .package(url: "https://github.com/apple/swift-homomorphic-encryption", from: "1.0.0"), + .package( + url: "https://github.com/apple/swift-homomorphic-encryption", + revision: "7091583923d9e25ec760e8479b56f6aefd7fa6d5"), .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.27.0"), .package(url: "https://github.com/hummingbird-project/hummingbird", from: "2.0.0"), .package(url: "https://github.com/hummingbird-project/hummingbird-compression", from: "2.0.0-rc.2"), @@ -91,6 +93,6 @@ let package = Package( #if canImport(Darwin) // Set the minimum macOS version for the package package.platforms = [ - .macOS(.v14), // Constrained by Swift 5.10 support for Xcode (https://developer.apple.com/support/xcode/) + .macOS(.v15), // Constrained by swift-homomorphic-encryption ] #endif diff --git a/README.md b/README.md index 4d3542e..25ab5f6 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ The documentation lives at [Swift Package Index](https://swiftpackageindex.com/a Building Live Caller ID Lookup Example requires: * 64-bit processor with little-endian memory representation * macOS or Linux operating system -* [Swift](https://www.swift.org/) version 5.10 or later +* [Swift](https://www.swift.org/) version 6.0 or later Additionally, developing Live Caller ID Lookup Example requires: * [Nick Lockwood SwiftFormat](https://github.com/nicklockwood/SwiftFormat) diff --git a/Sources/PIRService/Controllers/PrivacyPassController.swift b/Sources/PIRService/Controllers/PrivacyPassController.swift index 5eb8046..f9921c5 100644 --- a/Sources/PIRService/Controllers/PrivacyPassController.swift +++ b/Sources/PIRService/Controllers/PrivacyPassController.swift @@ -12,12 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if canImport(Darwin) import Foundation -#else -// Foundation.URL is not Sendable -@preconcurrency import Foundation -#endif import Hummingbird import PrivacyPass @@ -50,11 +45,7 @@ struct PrivacyPassController { } // swiftlint:disable:next force_unwrapping let issuerRequestUri = URL(string: "/issue")! - #if canImport(Darwin) return TokenIssuerDirectory(issuerRequestUri: issuerRequestUri, tokenKeys: tokenKeys) - #else - return await TokenIssuerDirectory(issuerRequestUri: issuerRequestUri, tokenKeys: tokenKeys) - #endif } @Sendable diff --git a/Sources/PrivacyPass/TokenIssuerDirectory.swift b/Sources/PrivacyPass/TokenIssuerDirectory.swift index 513c842..260f115 100644 --- a/Sources/PrivacyPass/TokenIssuerDirectory.swift +++ b/Sources/PrivacyPass/TokenIssuerDirectory.swift @@ -12,12 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if canImport(Darwin) import Foundation -#else -// Foundation.URL is not Sendable -@preconcurrency import Foundation -#endif /// Token issuer directory hold the list of all public keys supported by the issuer. ///