gnoi icon indicating copy to clipboard operation
gnoi copied to clipboard

protoc-gen-go-grpc gRPC code generation plugin downgraded

Open aaronbee opened this issue 1 year ago • 3 comments

In commit https://github.com/openconfig/gnoi/commit/64e82de6cfe3c26ea588cf98a2e44e0793dc318a the generated gRPC code looks to have started using a downgraded protoc plugin. It used to be the case that the protoc-gen-go plugin handled Go code generation for protobuf messages and gRPC services. The gRPC service code generation was later moved into protoc-gen-go-grpc. It seems that in that commit support went backwards.

This can be seen by the fact that *_grpc.pb.go files have been deleted, merging the gRPC service definitions into the other .pb.go and the line that exists in the deleted file:

const _ = grpc.SupportPackageIsVersion7

is now:

const _ = grpc.SupportPackageIsVersion6

Note the version has gone down.

This is a backwards incompatible change because certain symbols are deleted, such as UnimplementedCertificateManagementServer. In the current version of gRPC it is required that code references this when implementing a CertificateManagement service server, by removing it code that supported the current version of gRPC no longer compiles.

aaronbee avatar Mar 06 '24 18:03 aaronbee

Aaron -- thanks for flagging this. This looks like an error. Let me chase it up.

robshakir avatar Mar 06 '24 20:03 robshakir

Fixed by #190

aaronbee avatar May 07 '24 15:05 aaronbee

@marcushines #190 looks to have missed regeneration of packet_link_qualification and packet_capture. They are both missing _grpc.pb.go files.

aaronbee avatar May 07 '24 17:05 aaronbee