Skip to content

Commit

Permalink
update remaining files
Browse files Browse the repository at this point in the history
  • Loading branch information
rebello95 committed Jul 13, 2024
1 parent ba1cd94 commit 4da1e84
Show file tree
Hide file tree
Showing 20 changed files with 103 additions and 347 deletions.
2 changes: 1 addition & 1 deletion Connect-Swift-Mocks.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |spec|
spec.watchos.deployment_target = '6.0'

spec.dependency 'Connect-Swift', "#{spec.version.to_s}"
spec.dependency 'SwiftProtobuf', '~> 1.26.0'
spec.dependency 'SwiftProtobuf', '~> 1.27.0'

spec.source_files = 'Libraries/ConnectMocks/**/*.swift'

Expand Down
2 changes: 1 addition & 1 deletion Connect-Swift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Pod::Spec.new do |spec|
spec.tvos.deployment_target = '13.0'
spec.watchos.deployment_target = '6.0'

spec.dependency 'SwiftProtobuf', '~> 1.26.0'
spec.dependency 'SwiftProtobuf', '~> 1.27.0'

spec.source_files = 'Libraries/Connect/**/*.swift'

Expand Down
8 changes: 4 additions & 4 deletions Examples/ElizaCocoaPodsApp/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- Connect-Swift (0.14.0):
- SwiftProtobuf (~> 1.26.0)
- SwiftProtobuf (1.26.0)
- SwiftProtobuf (~> 1.27.0)
- SwiftProtobuf (1.27.0)

DEPENDENCIES:
- Connect-Swift (from `../..`)
Expand All @@ -15,8 +15,8 @@ EXTERNAL SOURCES:
:path: "../.."

SPEC CHECKSUMS:
Connect-Swift: 6b4b5267a58ab231531935fd3331b1eeac726b45
SwiftProtobuf: 5e8349171e7c2f88f5b9e683cb3cb79d1dc780b3
Connect-Swift: 3cee5c7a7258aa85c3b73408ba30a397a6c23e80
SwiftProtobuf: 07b360b482e7015be5add8475cbe314853516814

PODFILE CHECKSUM: b598f373a6ab5add976b09c2ac79029bf2200d48

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
}

/// SayRequest is a single-sentence request.
struct Connectrpc_Eliza_V1_SayRequest {
struct Connectrpc_Eliza_V1_SayRequest: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand All @@ -48,7 +48,7 @@ struct Connectrpc_Eliza_V1_SayRequest {
}

/// SayResponse is a single-sentence response.
struct Connectrpc_Eliza_V1_SayResponse {
struct Connectrpc_Eliza_V1_SayResponse: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand All @@ -62,7 +62,7 @@ struct Connectrpc_Eliza_V1_SayResponse {

/// ConverseRequest is a single sentence request sent as part of a
/// back-and-forth conversation.
struct Connectrpc_Eliza_V1_ConverseRequest {
struct Connectrpc_Eliza_V1_ConverseRequest: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand All @@ -76,7 +76,7 @@ struct Connectrpc_Eliza_V1_ConverseRequest {

/// ConverseResponse is a single sentence response sent in answer to a
/// ConverseRequest.
struct Connectrpc_Eliza_V1_ConverseResponse {
struct Connectrpc_Eliza_V1_ConverseResponse: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand All @@ -89,7 +89,7 @@ struct Connectrpc_Eliza_V1_ConverseResponse {
}

/// IntroduceRequest asks Eliza to introduce itself to the named user.
struct Connectrpc_Eliza_V1_IntroduceRequest {
struct Connectrpc_Eliza_V1_IntroduceRequest: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand All @@ -102,7 +102,7 @@ struct Connectrpc_Eliza_V1_IntroduceRequest {
}

/// IntroduceResponse is one sentence of Eliza's introductory monologue.
struct Connectrpc_Eliza_V1_IntroduceResponse {
struct Connectrpc_Eliza_V1_IntroduceResponse: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand All @@ -114,15 +114,6 @@ struct Connectrpc_Eliza_V1_IntroduceResponse {
init() {}
}

#if swift(>=5.5) && canImport(_Concurrency)
extension Connectrpc_Eliza_V1_SayRequest: @unchecked Sendable {}
extension Connectrpc_Eliza_V1_SayResponse: @unchecked Sendable {}
extension Connectrpc_Eliza_V1_ConverseRequest: @unchecked Sendable {}
extension Connectrpc_Eliza_V1_ConverseResponse: @unchecked Sendable {}
extension Connectrpc_Eliza_V1_IntroduceRequest: @unchecked Sendable {}
extension Connectrpc_Eliza_V1_IntroduceResponse: @unchecked Sendable {}
#endif // swift(>=5.5) && canImport(_Concurrency)

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "connectrpc.eliza.v1"
Expand Down
2 changes: 1 addition & 1 deletion Examples/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: v1
plugins:
- plugin: buf.build/apple/swift:v1.26.0
- plugin: buf.build/apple/swift:v1.27.0
opt: Visibility=Internal
out: ./ElizaSharedSources/GeneratedSources
- name: connect-swift
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
///
/// This struct must remain binary-compatible with
/// https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto.
struct Grpc_Status_V1_Status {
struct Grpc_Status_V1_Status: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand All @@ -56,10 +56,6 @@ struct Grpc_Status_V1_Status {
init() {}
}

#if swift(>=5.5) && canImport(_Concurrency)
extension Grpc_Status_V1_Status: @unchecked Sendable {}
#endif // swift(>=5.5) && canImport(_Concurrency)

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "grpc.status.v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
// limitations under the License.

import Foundation
// TODO: Remove `@preconcurrency` once `SwiftProtobuf.JSON{Encoding|Decoding}Options` are `Sendable`
@preconcurrency import SwiftProtobuf
import SwiftProtobuf

/// Codec providing functionality for serializing to/from JSON.
public struct JSONCodec: Sendable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
// limitations under the License.

import Foundation
// TODO: Remove `@preconcurrency` once `SwiftProtobuf.BinaryEncodingOptions` is `Sendable`
@preconcurrency import SwiftProtobuf
import SwiftProtobuf

/// Codec providing functionality for serializing to/from Protobuf binary.
public struct ProtoCodec {
Expand All @@ -41,6 +40,6 @@ extension ProtoCodec: Codec {
}

public func deserialize<Output: ProtobufMessage>(source: Data) throws -> Output {
return try Output(serializedData: source)
return try Output(serializedBytes: source)
}
}
2 changes: 1 addition & 1 deletion Libraries/Connect/Public/Interfaces/ConnectError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public struct ConnectError: Swift.Error, Sendable {
return nil
}

return detail.payload.flatMap { try? Output(serializedData: $0) }
return detail.payload.flatMap { try? Output(serializedBytes: $0) }
}
}

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Connect/Public/Interfaces/ProtobufMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

import SwiftProtobuf

public typealias ProtobufMessage = SwiftProtobuf.Message & Sendable
public typealias ProtobufMessage = SwiftProtobuf.Message
2 changes: 1 addition & 1 deletion Libraries/Connect/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1
plugins:
- plugin: buf.build/apple/swift:v1.26.0
- plugin: buf.build/apple/swift:v1.27.0
opt: Visibility=Internal
out: ./Internal/GeneratedSources
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "9f0c76544701845ad98716f3f6a774a892152bcb",
"version" : "1.26.0"
"revision" : "d57a5aecf24a25b32ec4a74be2f5d0a995a47c4b",
"version" : "1.27.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ let package = Package(
),
.package(
url: "https://github.com/apple/swift-protobuf.git",
from: "1.26.0"
from: "1.27.0"
),
],
targets: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
/// these from stdin and, for each one, invokes an RPC as directed
/// and writes the results (in the form of a ClientCompatResponse
/// message) to stdout.
struct Connectrpc_Conformance_V1_ClientCompatRequest {
struct Connectrpc_Conformance_V1_ClientCompatRequest: @unchecked Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand Down Expand Up @@ -229,7 +229,7 @@ struct Connectrpc_Conformance_V1_ClientCompatRequest {

var unknownFields = SwiftProtobuf.UnknownStorage()

struct Cancel {
struct Cancel: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand Down Expand Up @@ -282,7 +282,7 @@ struct Connectrpc_Conformance_V1_ClientCompatRequest {
/// after all request messages are sent and the send side is
/// closed (as if the after_close_send_ms field were present
/// and zero).
enum OneOf_CancelTiming: Equatable {
enum OneOf_CancelTiming: Equatable, Sendable {
/// When present, the client should cancel *instead of*
/// closing the send side of the stream, after all requests
/// have been sent. This applies only to client and bidi
Expand All @@ -297,28 +297,6 @@ struct Connectrpc_Conformance_V1_ClientCompatRequest {
/// This applies only to server and bidi stream RPCs.
case afterNumResponses(UInt32)

#if !swift(>=4.1)
static func ==(lhs: Connectrpc_Conformance_V1_ClientCompatRequest.Cancel.OneOf_CancelTiming, rhs: Connectrpc_Conformance_V1_ClientCompatRequest.Cancel.OneOf_CancelTiming) -> Bool {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch (lhs, rhs) {
case (.beforeCloseSend, .beforeCloseSend): return {
guard case .beforeCloseSend(let l) = lhs, case .beforeCloseSend(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.afterCloseSendMs, .afterCloseSendMs): return {
guard case .afterCloseSendMs(let l) = lhs, case .afterCloseSendMs(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.afterNumResponses, .afterNumResponses): return {
guard case .afterNumResponses(let l) = lhs, case .afterNumResponses(let r) = rhs else { preconditionFailure() }
return l == r
}()
default: return false
}
}
#endif
}

init() {}
Expand All @@ -330,7 +308,7 @@ struct Connectrpc_Conformance_V1_ClientCompatRequest {
}

/// The outcome of one ClientCompatRequest.
struct Connectrpc_Conformance_V1_ClientCompatResponse {
struct Connectrpc_Conformance_V1_ClientCompatResponse: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand Down Expand Up @@ -376,36 +354,18 @@ struct Connectrpc_Conformance_V1_ClientCompatResponse {
/// (e.g. a unary request that defines zero or multiple request messages).
///
/// However, once the RPC is issued, any resulting error should instead be encoded in response.
enum OneOf_Result: Equatable {
enum OneOf_Result: Equatable, Sendable {
case response(Connectrpc_Conformance_V1_ClientResponseResult)
case error(Connectrpc_Conformance_V1_ClientErrorResult)

#if !swift(>=4.1)
static func ==(lhs: Connectrpc_Conformance_V1_ClientCompatResponse.OneOf_Result, rhs: Connectrpc_Conformance_V1_ClientCompatResponse.OneOf_Result) -> Bool {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch (lhs, rhs) {
case (.response, .response): return {
guard case .response(let l) = lhs, case .response(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.error, .error): return {
guard case .error(let l) = lhs, case .error(let r) = rhs else { preconditionFailure() }
return l == r
}()
default: return false
}
}
#endif
}

init() {}
}

/// The result of a ClientCompatRequest, which may or may not be successful.
/// The client will build this message and return it back to the test runner.
struct Connectrpc_Conformance_V1_ClientResponseResult {
struct Connectrpc_Conformance_V1_ClientResponseResult: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand Down Expand Up @@ -470,7 +430,7 @@ struct Connectrpc_Conformance_V1_ClientResponseResult {
/// The client is not able to fulfill the ClientCompatRequest. This may be due
/// to a runtime error or an unexpected internal error such as the requested protocol
/// not being supported. This is completely independent of the actual RPC invocation.
struct Connectrpc_Conformance_V1_ClientErrorResult {
struct Connectrpc_Conformance_V1_ClientErrorResult: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand All @@ -488,7 +448,7 @@ struct Connectrpc_Conformance_V1_ClientErrorResult {
/// Details about various values as observed on the wire. This message is used
/// only by the reference client when reporting results and should not be populated
/// by clients under test.
struct Connectrpc_Conformance_V1_WireDetails {
struct Connectrpc_Conformance_V1_WireDetails: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand Down Expand Up @@ -536,17 +496,6 @@ struct Connectrpc_Conformance_V1_WireDetails {
fileprivate var _actualGrpcwebTrailers: String? = nil
}

#if swift(>=5.5) && canImport(_Concurrency)
extension Connectrpc_Conformance_V1_ClientCompatRequest: @unchecked Sendable {}
extension Connectrpc_Conformance_V1_ClientCompatRequest.Cancel: @unchecked Sendable {}
extension Connectrpc_Conformance_V1_ClientCompatRequest.Cancel.OneOf_CancelTiming: @unchecked Sendable {}
extension Connectrpc_Conformance_V1_ClientCompatResponse: @unchecked Sendable {}
extension Connectrpc_Conformance_V1_ClientCompatResponse.OneOf_Result: @unchecked Sendable {}
extension Connectrpc_Conformance_V1_ClientResponseResult: @unchecked Sendable {}
extension Connectrpc_Conformance_V1_ClientErrorResult: @unchecked Sendable {}
extension Connectrpc_Conformance_V1_WireDetails: @unchecked Sendable {}
#endif // swift(>=5.5) && canImport(_Concurrency)

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "connectrpc.conformance.v1"
Expand Down
Loading

0 comments on commit 4da1e84

Please sign in to comment.