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

gateway_grpc_library is broken with latest version of rules_go and gazelle #275

Open
alexbozhenko opened this issue Aug 9, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@alexbozhenko
Copy link

alexbozhenko commented Aug 9, 2023

Issue Description

The rules_go 0.41.0 and gazelle 0.32.0 added the breaking go_googleapis change.

This repo uses go_googleapis in multiple places. E.g.: gateway_grpc_library

I am trying to update my repo to use go 1.21. That requires the latest version or gazelle and rules_go.
When I am trying to use gateway_grpc_library in a repo that has the latest version, I get the following error, even though go_googleapis is not defined/used anywhere in my repo.

I know this is not a proper bug report, and I will need to provide a reproducer, but I wanted to check and see if updating the version of rules_go and gazelle can break gateway_grpc_library, or is it something else in my repo setup that is more likely to be broken?
UPD: I tried to update versions here: #277

I did try to include https://github.com/googleapis/googleapis repo and gazelle:resolve stanzas as per the advice in the release notes for rules_go, but still that did not work.

So I am wondering if the fix that fix is also needed to repositories.bzl in this repo, if it were to be used with the latest rules_go?

Log Output

plain text
ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/5a6fc9ff7fa4373be5f3f379b34ac692/external/rules_proto_grpc/grpc-gateway/example/api/BUILD.bazel:4:14: no such package '@go_googleapis//google/api': The repository '@go_googleapis' could not be resolved: Repository '@go_googleapis' is not defined

rules_proto_grpc Version

4.4.0

Bazel Version

6.3.2

OS

Ubuntu 22.04

Link to Demo Repo

No response

WORKSPACE Content

No response

BUILD Content

No response

Proto Content

No response

Any Other Content

No response

@alexbozhenko
Copy link
Author

Thanks @sluongng for the suggestion, I was able to patch it like this:

http_archive(
    name = "rules_proto_grpc",
    sha256 = "f87d885ebfd6a1bdf02b4c4ba5bf6fb333f90d54561e4d520a8413c8d1fb7beb",
    strip_prefix = "rules_proto_grpc-4.5.0",
    patch_args = ["-p1"],
    patches = ["//buildpatches:gateway_grpc_library.bzl.patch",],
    urls = [
        "https://github.com/rules-proto-grpc/rules_proto_grpc/archive/refs/tags/4.5.0.tar.gz",
    ],
)
$ cat buildpatches/gateway_grpc_library.bzl.patch
diff --git a/grpc-gateway/gateway_grpc_library.bzl b/grpc-gateway/gateway_grpc_library.bzl
index 91cedbfe..0b3fbae1 100644
--- a/grpc-gateway/gateway_grpc_library.bzl
+++ b/grpc-gateway/gateway_grpc_library.bzl
@@ -38,5 +38,5 @@ GATEWAY_DEPS = [
     "@org_golang_google_grpc//metadata:go_default_library",
     "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library",
     "@com_github_grpc_ecosystem_grpc_gateway_v2//utilities:go_default_library",
-    "@go_googleapis//google/api:annotations_go_proto",
+    "@org_golang_google_genproto_googleapis_api//annotations",
 ]

@alexbozhenko
Copy link
Author

@aaliddell looks like you have been active in the repo recently. Can we commit this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant