protobuf: plugins are not supported : grpc

run:

protoc protoc/route_guide.proto --go_out=plugins=grpc:.

output:

--go_out: protoc-gen-go: plugins are not supported; use 'protoc --go-grpc_out=...' to generate gRPC

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 8
  • Comments: 19 (7 by maintainers)

Commits related to this issue

Most upvoted comments

google.golang.org/protobuf/cmd/protoc-gen-go will never have explicit gRPC support. We’ve split it out into a separate program (protoc-gen-go-grpc), so the gRPC code generator can live in the gRPC repository and follow that repo’s release cycle.

The practical effect is that when using this generator you will need to specify two flags on the protoc command line (or run protoc twice):

protoc --go_out=. --go-grpc_out=. foo.proto

The original github.com/golang/protobuf/protoc-gen-go will continue to directly support gRPC generation indefinitely, to avoid breaking existing users.

The google.golang.org/protobuf/cmd/protoc-gen-go program doesn’t include gRPC support. Instead, that support will soon be provided by a google.golang.org/grpc/cmd/protoc-gen-go-grpc program. That program is In code review now, but not quite yet available.

The github.com/golang/protobuf/protoc-gen-go program supports gRPC as always, and will continue to do so. Versions v1.4 and newer of that program support the new protobuf reflection features. (Right now, the newest release is v1.4.0-rc.4.)

It seems strange to give a warning and recommend using a plugin that does not yet exist.

How to use original github.com/golang/protobuf/protoc-gen-go? The new way just broke all my codebase…

This doc needs to be updated.

gRPC generation is no longer handled as a plugin of this protoc-gen-go package. We only generate the protobuf definitions, the protoc-gen-go-grpc is now responsible for generating grpc code.

It tells you what you need to do:

protoc --go-grpc_out=. dummy/dummyProt/dummy.proto

google.golang.org/protobuf/cmd/protoc-gen-go will never have explicit gRPC support. We’ve split it out into a separate program (protoc-gen-go-grpc), so the gRPC code generator can live in the gRPC repository and follow that repo’s release cycle.

The practical effect is that when using this generator you will need to specify two flags on the protoc command line (or run protoc twice):

protoc --go_out=. --go-grpc_out=. foo.proto

The original github.com/golang/protobuf/protoc-gen-go will continue to directly support gRPC generation indefinitely, to avoid breaking existing users.

This can work. Great