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

Provide ability to use golang (v1) marshal/unmarshal under the hood #18

Open
huntsman90 opened this issue Aug 24, 2021 · 1 comment
Open

Comments

@huntsman90
Copy link

Hello 👋
We have a large protobuf repo, using golang codegen, most of which is based on the V1 go message format. We are now starting to move to using the V2 message format, and are using vtprotobuf for fast (de)serialization. However, we cannot do the migration all at once. Due to this, we have V2 generated code, that can depend on V1 format generated code during the migration. So, we need the vtproto-generated code to be compatible with the older code.

To handle such scenarios, it would be very helpful if there is an ability to substitute google.golang.org/protobuf/proto with github.com/golang/protobuf/proto. This would make our migration a lot smoother.

This could be exposed via an option/flag at codegen time.

cc @euroelessar

@vmg
Copy link
Member

vmg commented Sep 9, 2021

This seems like a perfectly reasonable request. If you send a PR that implements the flag I'll merge it. Thank you!

jhance pushed a commit to dropbox/dbx_build_tools that referenced this issue Sep 27, 2021
… gen_build_proto

Summary:
In `gen_build_proto.py`, ignore `go_package` requirements for proto files in `configs/proto/google/protobuf`

Use the script from (1) to add `go_package` option to hulk proto files, and all its dependencies.

Modify `rpc_stubs.go` to change the package name for generated go code. Earlier, a proto package like `hulk.driver` would generate a go package with name `hulk_driver`. Instead, now we simply have the go package name `driver`. This was done to match `protoc-gen-godbx` behaviour with that of `protoc-gen-go`

Mark `github.com/planetscale/vtprotobuf` as dirty in `.dbxvendor.json`, while we get a fix for planetscale/vtprotobuf#18, and add a hack to the repo.

Substitute using `github.com/gogo/protobuf/proto` with `github.com/golang/protobuf/proto` in `/go/src/dropbox/hulk/*` to remove usage of gogoproto

GitOrigin-RevId: dddc8e25678549687004135369733d7ee4c75490
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

No branches or pull requests

2 participants