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

Use fully-qualified import paths in go_package options. #219

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

jmillikin
Copy link
Contributor

The Protobuf documentation for go_package requires that it
contain a fully-qualified import path, with an optional package
name override.

As of CL 301953 (released in protobuf-go v1.26), this
requirement is being enforced by the protoc-gen-go plugin.

I set the go_package options such that there is no change to
generated code compared to the previous version. This required
overriding the package names for the remoteasset, remoteexecution,
and remotelogstream packages, since those have import paths ending
in /v1 or /v2.

Fixes #181

The Protobuf documentation for [`go_package`][1] requires that it
contain a fully-qualified import path, with an optional package
name override.

As of [CL 301953][2] (released in [protobuf-go v1.26][3]), this
requirement is being enforced by the `protoc-gen-go` plugin.

I set the `go_package` options such that there is no change to
generated code compared to the previous version. This required
overriding the package names for the `remoteasset`, `remoteexecution`,
and `remotelogstream` packages, since those have import paths ending
in `/v1` or `/v2`.

Fixes bazelbuild#181

[1]: https://developers.google.com/protocol-buffers/docs/reference/go-generated#package
[2]: https://go-review.googlesource.com/c/protobuf/+/301953/
[3]: https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.26.0
@bergsieker bergsieker removed the request for review from buchgr April 13, 2022 21:25
@bergsieker bergsieker merged commit 2af1c43 into bazelbuild:main Apr 13, 2022
@jmillikin jmillikin deleted the go-package-names branch April 14, 2022 05:20
moroten added a commit to moroten/remote-apis that referenced this pull request May 10, 2022
This commit updates .pb.go using hooks/pre-commit as it was forgotten
in the following commits:

2af1c43 Use fully-qualified import paths in `go_package` options. (bazelbuild#219)
5971c1e Add a note about ordering of Tree protos (bazelbuild#223)
@moroten moroten mentioned this pull request May 10, 2022
moroten added a commit to moroten/remote-apis that referenced this pull request May 10, 2022
This commit updates .pb.go using hooks/pre-commit as it was forgotten
in the following commits:

2af1c43 Use fully-qualified import paths in `go_package` options. (bazelbuild#219)
5971c1e Add a note about ordering of Tree protos (bazelbuild#223)
bergsieker pushed a commit that referenced this pull request May 10, 2022
This commit updates .pb.go using hooks/pre-commit as it was forgotten
in the following commits:

2af1c43 Use fully-qualified import paths in `go_package` options. (#219)
5971c1e Add a note about ordering of Tree protos (#223)
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 this pull request may close these issues.

deprecated usage of go_package option in proto files
3 participants