Skip to content
New issue

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

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

Already on GitHub? # to your account

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

Closed
ukai opened this issue Mar 29, 2024 · 4 comments · Fixed by #7351
Closed

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

ukai opened this issue Mar 29, 2024 · 4 comments · Fixed by #7351
Labels
P2 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
Contributor

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
Contributor

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.

@arvindbr8
Copy link
Member

arvindbr8 commented May 31, 2024

Updated dep for protobuf to 1.34 in #7274. unblocks implementation.

@arvindbr8 arvindbr8 assigned arvindbr8 and unassigned arvindbr8 May 31, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 24, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
P2 Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants