grpc/grpc-swift

protoc-gen-grpc-swift/main.swift is using an outdated API from SwiftProtobufPlugin

IrisG33 opened this issue · 1 comments

Describe the bug

When using the latest version of SwiftProtobuf, the protoc-gen-grpc-swift/main.swift fails to compile:

Sources/protoc-gen-grpc-swift/main.swift:153:64: error: value of type 'FileDescriptor' has no member 'proto'
let serializedFileDescriptorProto = try fileDescriptor.proto.serializedData()
                                                ~~~~~~~~~~~~~~ ^~~~~

Looks like the FileDescriptor in SwiftProtobuf has removed the proto api.
https://github.com/apple/swift-protobuf/blob/main/Sources/SwiftProtobufPluginLibrary/Descriptor.swift#L91-L149

Please help to take a look. Thank you.

To reproduce

Build with the SwiftProtobuf on head.

Expected behaviour

Swift gRPC should build with the current version of SwiftProtobuf.

SwiftProtobuf is working towards a 2.x release on their main branch. gRPC Swift requires version 1.x of SwiftProtobuf, as such building against the main of SwiftProtobuf isn't supported and you must use a released 1.x version of SwiftProtobuf.