From 6310ff20f5266f8af967f012d3ece42962c51d71 Mon Sep 17 00:00:00 2001 From: Grady Zhuo Date: Thu, 12 Sep 2024 00:31:27 +0800 Subject: [PATCH] [UPDATE] remove @preconcurrency and fix warnning for 6.0 --- Package.resolved | 39 ++++++++++--------- Package@swift-6.0.swift | 10 ++--- .../Stream/Stream.Identifier.swift | 2 +- .../StreamClient/StreamClient.swift | 6 +-- Sources/EventStoreDB/utils/Error/Error.swift | 2 +- 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/Package.resolved b/Package.resolved index e66b744..fa64ca4 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "f868a8ea7ed17f6a77a82457b30f295c87ce312e7d8167e11237d802b715fb76", "pins" : [ { "identity" : "grpc-swift", @@ -23,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections.git", "state" : { - "revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb", - "version" : "1.1.0" + "revision" : "9bf03ff58ce34478e66aaee630e491823326fd06", + "version" : "1.1.3" } }, { @@ -32,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-http-types", "state" : { - "revision" : "9bee2fdb79cc740081abd8ebd80738063d632286", - "version" : "1.1.0" + "revision" : "ae67c8178eb46944fd85e4dc6dd970e1f3ed6ccd", + "version" : "1.3.0" } }, { @@ -41,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-log.git", "state" : { - "revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5", - "version" : "1.5.4" + "revision" : "9cb486020ebf03bfa5b5df985387a14a98744537", + "version" : "1.6.1" } }, { @@ -50,8 +51,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "359c461e5561d22c6334828806cc25d759ca7aa6", - "version" : "2.65.0" + "revision" : "9746cf80e29edfef2a39924a66731249223f42a3", + "version" : "2.72.0" } }, { @@ -59,8 +60,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-extras.git", "state" : { - "revision" : "a3b640d7dc567225db7c94386a6e71aded1bfa63", - "version" : "1.22.0" + "revision" : "d1ead62745cc3269e482f1c51f27608057174379", + "version" : "1.24.0" } }, { @@ -68,8 +69,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-http2.git", "state" : { - "revision" : "c6afe04165c865faaa687b42c32ed76dfcc91076", - "version" : "1.31.0" + "revision" : "b5f7062b60e4add1e8c343ba4eb8da2e324b3a94", + "version" : "1.34.0" } }, { @@ -77,8 +78,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-ssl.git", "state" : { - "revision" : "7c381eb6083542b124a6c18fae742f55001dc2b5", - "version" : "2.26.0" + "revision" : "7b84abbdcef69cc3be6573ac12440220789dcd69", + "version" : "2.27.2" } }, { @@ -95,8 +96,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf.git", "state" : { - "revision" : "9f0c76544701845ad98716f3f6a774a892152bcb", - "version" : "1.26.0" + "revision" : "edb6ed4919f7756157fe02f2552b7e3850a538e5", + "version" : "1.28.1" } }, { @@ -104,10 +105,10 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "025bcb1165deab2e20d4eaba79967ce73013f496", - "version" : "1.2.1" + "revision" : "d2ba781702a1d8285419c15ee62fd734a9437ff5", + "version" : "1.3.2" } } ], - "version" : 2 + "version" : 3 } diff --git a/Package@swift-6.0.swift b/Package@swift-6.0.swift index 3caf881..87eca3e 100644 --- a/Package@swift-6.0.swift +++ b/Package@swift-6.0.swift @@ -16,8 +16,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "1.15.0"), - .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.6.0"), + .package(url: "https://github.com/grpc/grpc-swift.git", from: "1.23.0"), .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"), ], targets: [ @@ -33,8 +32,7 @@ let package = Package( .target( name: "GRPCEncapsulates", dependencies: [ - .product(name: "GRPC", package: "grpc-swift"), - .product(name: "SwiftProtobuf", package: "swift-protobuf"), + .product(name: "GRPC", package: "grpc-swift") ] ), .testTarget( @@ -52,5 +50,7 @@ let package = Package( dependencies: ["GRPCEncapsulates"] ), ], - swiftLanguageVersions: [.version("6")] + swiftLanguageModes: [ + .v6 + ] ) diff --git a/Sources/EventStoreDB/StreamClient/Stream/Stream.Identifier.swift b/Sources/EventStoreDB/StreamClient/Stream/Stream.Identifier.swift index d440145..47af8eb 100644 --- a/Sources/EventStoreDB/StreamClient/Stream/Stream.Identifier.swift +++ b/Sources/EventStoreDB/StreamClient/Stream/Stream.Identifier.swift @@ -5,7 +5,7 @@ // Created by Grady Zhuo on 2024/5/21. // -@preconcurrency import Foundation +import Foundation import GRPCEncapsulates extension Stream { diff --git a/Sources/EventStoreDB/StreamClient/StreamClient.swift b/Sources/EventStoreDB/StreamClient/StreamClient.swift index d2a6fa5..9940965 100644 --- a/Sources/EventStoreDB/StreamClient/StreamClient.swift +++ b/Sources/EventStoreDB/StreamClient/StreamClient.swift @@ -14,7 +14,7 @@ public struct StreamClient: GRPCConcreteClient { public private(set) var channel: GRPCChannel public var callOptions: CallOptions - + public init(channel: GRPCChannel, callOptions: CallOptions) { self.channel = channel self.callOptions = callOptions @@ -61,7 +61,7 @@ extension StreamClient { package func subscribe(stream: Stream.Identifier, from cursor: Cursor, options: StreamClient.Subscribe.Options) async throws -> Subscription { let handler = Subscribe(streamIdentifier: stream, cursor: cursor, options: options) - var request = try handler.build() + let request = try handler.build() let getSubscriptionCall = underlyingClient.makeReadCall(request) return try await .init(readCall: getSubscriptionCall) @@ -71,7 +71,7 @@ extension StreamClient { package func subscribeToAll(from cursor: Cursor, options: StreamClient.SubscribeToAll.Options) async throws -> Subscription { let handler = SubscribeToAll(cursor: cursor, options: options) - var request = try handler.build() + let request = try handler.build() let getSubscriptionCall = underlyingClient.makeReadCall(request) return try await .init(readCall: getSubscriptionCall) diff --git a/Sources/EventStoreDB/utils/Error/Error.swift b/Sources/EventStoreDB/utils/Error/Error.swift index 3603936..c03eb2a 100644 --- a/Sources/EventStoreDB/utils/Error/Error.swift +++ b/Sources/EventStoreDB/utils/Error/Error.swift @@ -5,7 +5,7 @@ // Created by Grady Zhuo on 2023/10/17. // -@preconcurrency import Foundation +import Foundation import GRPC import GRPCEncapsulates