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

support --go_opt=default_api_level and --go_opt=apilevelM flags #12

Open
stapelberg opened this issue Jan 21, 2025 · 0 comments
Open

support --go_opt=default_api_level and --go_opt=apilevelM flags #12

stapelberg opened this issue Jan 21, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@stapelberg
Copy link
Collaborator

Currently, the open2opaque tool obtains the default API level (see https://protobuf.dev/reference/go/go-generated-opaque/#apilevel) by querying the google.golang.org/protobuf/compiler/protogen package.

This does not cover the case where users change the default API level via the protoc Go plugin command-line option --go_opt=default_api_level or --go_opt=apilevelM.

For open2opaque setapi, knowledge of the correct default is important, because explicit API level overrides will not be added when they match the default. For example, if an organization builds with --go_opt=default_api_level=HYBRID, then open2opaque setapi --api=OPEN will not result in a option features.(pb.go).api_level = API_OPEN; line (but will be a no-op, because it matches what open2opaque incorrectly considers the default).

We should implement support in the open2opaque tool for these two flags so that users can copy the flags from their protoc invocation to their open2opaque tool invocation.

@stapelberg stapelberg added the enhancement New feature or request label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant