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

Add support for Protobuf Editions #327

Open
vallahaye opened this issue Jan 26, 2025 · 0 comments · May be fixed by #328
Open

Add support for Protobuf Editions #327

vallahaye opened this issue Jan 26, 2025 · 0 comments · May be fixed by #328

Comments

@vallahaye
Copy link
Contributor

Last year the Protobuf compiler v0.27 was released, and with it came Protobuf Editions. It introduces a new feature flag system aimed at unifying proto2 and proto3 functionality and semantics.

Since then, both the Buf build system and Connect RPCs have successfully added support for it, suggesting that people could start migrating their Protobuf files.

The protoc-gen-go-aip code generator is currently incompatible with Editions and will return an error each time it is run against it:

plugin "go-aip" does not support feature "supports editions" which is required by "testdata.proto"

As far as I've been able to tell, protoc-gen-go-aip is agnostic of Editions, and adding support for it could be straightforward:

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

This change would also add support for proto3 optional fields, which I believe the protoc-gen-go-aip code generator is also agnostic of.

vallahaye added a commit to vallahaye/aip-go that referenced this issue Jan 26, 2025
Protobuf Editions introduces a new feature flag system aimed at unifying proto2 and
proto3 functionality and semantics.

Closes einride#327
@vallahaye vallahaye linked a pull request Jan 26, 2025 that will close this issue
vallahaye added a commit to vallahaye/aip-go that referenced this issue Jan 26, 2025
Protobuf Editions introduces a new feature flag system aimed at unifying proto2 and
proto3 functionality and semantics.

Closes einride#327
vallahaye added a commit to vallahaye/aip-go that referenced this issue Jan 27, 2025
Protobuf Editions introduces a new feature flag system aimed at unifying proto2 and
proto3 functionality and semantics.

Closes einride#327
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

Successfully merging a pull request may close this issue.

1 participant