-
Notifications
You must be signed in to change notification settings - Fork 4
Description
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.