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

protoc-gen-go-grpc: support proto edition #7067

Open
ukai opened this issue Mar 29, 2024 · 3 comments
Open

protoc-gen-go-grpc: support proto edition #7067

ukai opened this issue Mar 29, 2024 · 3 comments
Labels
Status: Blocked Type: Feature New features or improvements in behavior

Comments

@ukai
Copy link

ukai commented Mar 29, 2024

Please see the FAQ in our main README.md before submitting your issue.

Use case(s) - what problem will this feature solve?

Please add edition support in protoc-gen-go-grpc.
https://protobuf.dev/editions/overview/

protoc-gen-go@v1.33.0 works with protoc@v26.1 with --experimental_editions, but
protoc-gen-go-grpc can't use it

protoc-gen-go-grpc: invalid FileDescriptorProto "local_rpc_service.proto": proto: invalid syntax: "editions"
--go-grpc_out: protoc-gen-go-grpc: Plugin failed with status code 1.

Proposed Solution

Support "edition" in protoc-gen-go-grpc.

Alternatives Considered

Keep legacy proto2/3 when using grpc.

Additional Context

@ukai ukai added the Type: Feature New features or improvements in behavior label Mar 29, 2024
@arvindbr8
Copy link
Member

It would be great to add editions support to protoc-gen-go-grpc. However this is not something the team has cycles to prioritize at the moment. Please feel free to send us a PR and we would love to take a look at it.

@mkruskal-google
Copy link

mkruskal-google commented Apr 9, 2024

FYI, this should be trivial to add once protobuf-go issues a new release and you bump your dependency. Edition 2023 has no grpc-relevant features (unless you want to add some), so the following should be sufficient in your main plugin file:

gen.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL | pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS)
gen.SupportedEditionsMinimum = descriptorpb.Edition_EDITION_PROTO2
gen.SupportedEditionsMaximum = descriptorpb.Edition_EDITION_2023

@arjan-bal
Copy link
Collaborator

We need to wait for protobuf-go version 1.34 to be released which should include this commit that adds support for the editions feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Blocked Type: Feature New features or improvements in behavior
Projects
None yet
Development

No branches or pull requests

4 participants