Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugins are not supported : grpc #1070

Closed
harrybin815 opened this issue Apr 1, 2020 · 19 comments
Closed

plugins are not supported : grpc #1070

harrybin815 opened this issue Apr 1, 2020 · 19 comments

Comments

@harrybin815
Copy link

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
@neild
Copy link
Contributor

neild commented Apr 1, 2020

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.)

@alexshtin
Copy link

alexshtin commented Apr 1, 2020

@neild, thanks for update. Could you provide very approximate date for gRPC support in google.golang.org/protobuf/cmd/protoc-gen-go?

@neild
Copy link
Contributor

neild commented Apr 1, 2020

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.

@alexshtin
Copy link

Ok, this is better approach, I agree. I will rephrase my question though: could you provide very approximate date when google.golang.org/protobuf/cmd/protoc-gen-go-grpc is available?

@neild
Copy link
Contributor

neild commented Apr 1, 2020

Whenever grpc/grpc-go#3453 is approved and merged; unfortunately, the timing of that isn't under my control, so I can't give even an approximate date. It's in the gRPC folks' hands right now, but current events have everyone working at reduced capacity and I don't know where this is on their priority list.

@alexshtin
Copy link

Thanks @neild. I am super excited about V2. Great job!

@dsnet
Copy link
Member

dsnet commented Apr 2, 2020

I'm going to close this issue, since it seems to be a duplicate of #903

@dsnet dsnet closed this as completed Apr 2, 2020
@kraymond37
Copy link

This doc needs to be updated.

@dsnet
Copy link
Member

dsnet commented Jul 16, 2020

I recommend filing an issue on https://github.com/grpc/grpc-go/issues

@quinn
Copy link

quinn commented Sep 11, 2020

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

@shanduur
Copy link

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

AlekSi added a commit to AlekSi/talos-tools that referenced this issue Jan 8, 2021
AlekSi added a commit to AlekSi/talos-tools that referenced this issue Jan 8, 2021
AlekSi added a commit to AlekSi/talos-tools that referenced this issue Jan 8, 2021
talos-bot pushed a commit to siderolabs/tools that referenced this issue Jan 8, 2021
raghavendra-talur added a commit to raghavendra-talur/spec that referenced this issue Feb 9, 2021
There has been a change in the protoc binary from version v1.12. For
more information refer to:
golang/protobuf#1070.

This Makefile has been kept minimal to achieve the following:

1. Changes should be made to the replication.proto file in the root of
   the repo.
2. The generated code is split into two files now,
   lib/go/replication.pb.go and lib/go/replication_grpc.pb.go

TODO: Add validation methods to ensure that the generated files match
with the commited files.

Signed-off-by: Raghavendra Talur <[email protected]>
AlekSi added a commit to AlekSi/talos-tools that referenced this issue Mar 1, 2021
@AndresHMosqueda
Copy link

How can I fix this issue?

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

Screen Shot 2021-03-08 at 18 46 25

@shanduur
Copy link

shanduur commented Mar 9, 2021

@AndresHMosqueda this should work:
protoc --proto_path=proto --go_out=plugins=grpc:. proto/*.proto

@puellanivis
Copy link
Collaborator

puellanivis commented Mar 9, 2021

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

@CrayfishGo
Copy link

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

talos-bot pushed a commit to AlekSi/talos-tools that referenced this issue Mar 12, 2021
talos-bot pushed a commit to siderolabs/tools that referenced this issue Mar 15, 2021
@tejasjadhav
Copy link

tejasjadhav commented Jul 29, 2021

How do I use custom plugins with this change? We used to rely on that to generate custom gRPC implementation and a few additional code using our own custom plugins.

Also, why was this change introduced as a minor version change when it is breaking backward compatibility?

@neild
Copy link
Contributor

neild commented Jul 29, 2021

why was this change introduced as a minor version change

It was not.

google.golang.org/protobuf/cmd/protoc-gen-go has never supported gRPC code generation.

github.com/golang/protobuf/cmd/protoc-gen-go still contains gRPC code generation support. (However, the gRPC code generation is frozen and superseded by google.golang.org/grpc/cmd/protoc-gen-go-grpc, so I would recommend switching to the gRPC-owned plugin at your earliest convenience.)

@tejasjadhav
Copy link

@neild reason for stating this as as a minor version change is that in v1.3.5 we could still specify custom plugins (ex. plugins=grpc+my-custom-plugin). In v1.4.0 that support was removed.

This did break our internal code generation scripts as they relied on the plugins parameter. For now the workaround that we going ahead with is to generate the gRPC clients based on v1.3.5 and generate the gRPC server as per the latest version.

@neild
Copy link
Contributor

neild commented Aug 2, 2021

There has never been a way to add a custom plugin to protoc-gen-go, however. The list of plugins is built in at compile time. You can build your own generator binary uses the github.com/golang/protobuf/protoc-gen-go/generator package and adds a plugin, but that is still possible with v1.4.0. (New code should use the protogen package, however.)

The removed support you link to is in an executable (package main), not an importable package.

blanquicet added a commit to inspektor-gadget/inspektor-gadget that referenced this issue Aug 11, 2021
As described in [1], plugins=grpc is not supported anymore in latest
versions of protoc-gen-go because it was moved to
https://github.com/grpc/grpc-go project [2].

This commit updates api/gadgettracermanager to use the new syntax and
regenerates the code.

[1] golang/protobuf#1070
[2] golang/protobuf#903
blanquicet added a commit to inspektor-gadget/inspektor-gadget that referenced this issue Aug 11, 2021
As described in [1], plugins=grpc is not supported anymore in latest
versions of protoc-gen-go because it was moved to
https://github.com/grpc/grpc-go project [2].

This commit updates api/gadgettracermanager to use the new syntax and
regenerates the code.

[1] golang/protobuf#1070
[2] golang/protobuf#903
blanquicet added a commit to inspektor-gadget/inspektor-gadget that referenced this issue Aug 11, 2021
As described in [1], plugins=grpc is not supported anymore in latest
versions of protoc-gen-go because it was moved to
https://github.com/grpc/grpc-go project [2].

This commit updates api/gadgettracermanager to use the new syntax and
regenerates the code.

[1] golang/protobuf#1070
[2] golang/protobuf#903
alban pushed a commit to inspektor-gadget/inspektor-gadget that referenced this issue Aug 11, 2021
As described in [1], plugins=grpc is not supported anymore in latest
versions of protoc-gen-go because it was moved to
https://github.com/grpc/grpc-go project [2].

This commit updates api/gadgettracermanager to use the new syntax and
regenerates the code.

[1] golang/protobuf#1070
[2] golang/protobuf#903
eiffel-fl pushed a commit to eiffel-fl/inspektor-gadget that referenced this issue Aug 22, 2021
As described in [1], plugins=grpc is not supported anymore in latest
versions of protoc-gen-go because it was moved to
https://github.com/grpc/grpc-go project [2].

This commit updates api/gadgettracermanager to use the new syntax and
regenerates the code.

[1] golang/protobuf#1070
[2] golang/protobuf#903
margamanterola pushed a commit to inspektor-gadget/inspektor-gadget that referenced this issue Sep 15, 2021
As described in [1], plugins=grpc is not supported anymore in latest
versions of protoc-gen-go because it was moved to
https://github.com/grpc/grpc-go project [2].

This commit updates api/gadgettracermanager to use the new syntax and
regenerates the code.

[1] golang/protobuf#1070
[2] golang/protobuf#903
reasonerjt added a commit to reasonerjt/velero that referenced this issue Apr 12, 2024
Fix a nil pointer issue after bumping up to go1.22
More details see golang/go#65637

Also update the way protoc is called,
more details see:
golang/protobuf#1070

Signed-off-by: Daniel Jiang <[email protected]>
reasonerjt added a commit to reasonerjt/velero that referenced this issue Apr 12, 2024
Fix a nil pointer issue after bumping up to go1.22
More details see golang/go#65637

Also update the way protoc is called,
more details see:
golang/protobuf#1070

Signed-off-by: Daniel Jiang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests