-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
go.mod: upgrade grpc-gateway to v2 #134964
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
from v1.56.3 to v1.68.0. TODO: changelog
Similar but different error: ``` link: package conflict error: google.golang.org/genproto/googleapis/cloud/location: package imports google.golang.org/genproto/googleapis/api/annotations was compiled with: @org_golang_google_genproto//googleapis/api/annotations:annotations but was linked with: @org_golang_google_genproto_googleapis_api//annotations:annotations ``` Compare with the original: ``` link: package conflict error: cloud.google.com/go/pubsub/apiv1/pubsubpb: package imports google.golang.org/genproto/googleapis/api/annotations was compiled with: @org_golang_google_genproto_googleapis_api//annotations:annotations but was linked with: @org_golang_google_genproto//googleapis/api/annotations:annotations ```
Error unchanged from last commit. I did remember to `./dev gen bazel`. ``` link: package conflict error: google.golang.org/genproto/googleapis/cloud/location: package imports google.golang.org/genproto/googleapis/api/annotations was compiled with: @org_golang_google_genproto//googleapis/api/annotations:annotations but was linked with: @org_golang_google_genproto_googleapis_api//annotations:annotations ```
…f68ea54 See googleapis/go-genproto#1015. Sadly grpc-gateway is incompatible with this version of `genproto`: ``` ERROR: no such package '@@org_golang_google_genproto//googleapis/api/httpbody': BUILD file not found in directory 'googleapis/api/httpbody' of external repository @@org_golang_google_genproto. Add a BUILD file to a directory to mark it as a package. ERROR: /private/var/tmp/_bazel_tbg/b1346cddcc70d57afdaa90f7f09f9b2c/external/com_github_grpc_ecosystem_grpc_gateway/runtime/BUILD.bazel:5:11: no such package '@@org_golang_google_genproto//googleapis/api/httpbody': BUILD file not found in directory 'googleapis/api/httpbody' of external repository @@org_golang_google_genproto. Add a BUILD file to a directory to mark it as a package. and referenced by '@@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library' ``` Since we are on the final `grpc-gateway/v1` version already[^1], we'll have to make the leap to v2 to fix this. [^1]: https://github.com/grpc-ecosystem/grpc-gateway/releases/tag/v1.16.0
This won't compile but it's fine, just gets this change out of the way.
``` ERROR: /private/var/tmp/_bazel_tbg/b1346cddcc70d57afdaa90f7f09f9b2c/external/com_github_grpc_ecosystem_grpc_gateway_v2/runtime/BUILD.bazel: no such target '@@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:runtime': target 'runtime' not declared in package 'runtime' defined by /private/var/tmp/_bazel_tbg/b1346cddcc70d57afdaa90f7f09f9b2c/external/com_github_grpc_ecosystem_grpc_gateway_v2/runtime/BUILD.bazel ERROR: /Users/tbg/go/src/github.com/cockroachdb/cockroach/pkg/util/protoutil/BUILD.bazel:5:11: no such target '@@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:runtime': target 'runtime' not declared in package 'runtime' defined by /private/var/tmp/_bazel_tbg/b1346cddcc70d57afdaa90f7f09f9b2c/external/com_github_grpc_ecosystem_grpc_gateway_v2/runtime/BUILD.bazel and referenced by '//pkg/util/protoutil:protoutil' ```
Now we get: ``` ERROR: /private/var/tmp/_bazel_tbg/b1346cddcc70d57afdaa90f7f09f9b2c/external/go_googleapis/google/api/BUILD.bazel: no such target '@@go_googleapis//google/api:httpbody_go_proto': target 'httpbody_go_proto' not declared in package 'google/api' defined by /private/var/tmp/_bazel_tbg/b1346cddcc70d57afdaa90f7f09f9b2c/external/go_googleapis/google/api/BUILD.bazel (did you mean httpbody_proto, or httpbody.proto?) ERROR: /private/var/tmp/_bazel_tbg/b1346cddcc70d57afdaa90f7f09f9b2c/external/com_github_grpc_ecosystem_grpc_gateway_v2/runtime/BUILD.bazel:5:11: no such target '@@go_googleapis//google/api:httpbody_go_proto': target 'httpbody_go_proto' not declared in package 'google/api' defined by /private/var/tmp/_bazel_tbg/b1346cddcc70d57afdaa90f7f09f9b2c/external/go_googleapis/google/api/BUILD.bazel (did you mean httpbody_proto, or httpbody.proto?) and referenced by '@@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library' ```
Error after this: ``` /external/com_github_grpc_ecosystem_grpc_gateway_v2/internal/descriptor/apiconfig/BUILD.bazel:7:14: no such package '@@googleapis//google/api': The repository '@@googleapis' could not be resolved: Repository '@@googleapis' is not defined and referenced by '@@com_github_grpc_ecosystem_grpc_gateway_v2//internal/descriptor/apiconfig:apiconfig_proto' ``` I added a .patch trying to fix this (see this commit) but it didn't seem to take effect.
Epic: none Release note: None
https://cockroachlabs.slack.com/archives/CJ0H8Q97C/p1733177280312459?thread_ts=1731420942.261169&cid=CJ0H8Q97C is the latest on how to get something that at least fails at compile time. |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is an offshoot from attempting to upgrade gRPC.
It turned out in the end that we can upgrade gRPC without bumping grpc-gateway to v2. However, upgrading grpc-gateway seems like a good vessel for ripping of the FUD we have around mixing gogoproto and google.golang.org/protobuf. We should do it to avoid running into thorny dep issues during routine upgrades.