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

Upgrading to bazel modules #5389

Open
itmecho opened this issue Mar 21, 2025 · 1 comment
Open

Upgrading to bazel modules #5389

itmecho opened this issue Mar 21, 2025 · 1 comment

Comments

@itmecho
Copy link

itmecho commented Mar 21, 2025

🐛 Bug Report

I'm trying to upgrade our monorepo to bazel modules but I'm getting an issue where grpc-gateway doesn't seem to be able to resolve the @googleapis module. This is the error I'm getting:

ERROR: no such package '@@[unknown repo 'googleapis' requested from @@gazelle++go_deps+com_github_grpc_ecosystem_grpc_gateway_v2]//google/api': The repository '@@[unknown repo 'googleapis' requested from @@gazelle++go_deps+com_github_grpc_ecosystem_grpc_gateway_v2]' could not be resolved: No repository visible as '@googleapis' from repository '@@gazelle++go_deps+com_github_grpc_ecosystem_grpc_gateway_v2'

I have tried running the following commands and they both work so I'm pretty sure I've configured the root module correctly

bazel build @googleapis//google/api:annotations_proto
bazel build @googleapis//google/api:annotations_go_proto

To Reproduce

I have created a minimal repo that has the same issue. The README contains the output from some relevant commands.

https://github.com/itmecho/bzlmodgotest

Expected behavior

grpc-gateway should be able to resolve @googleapis

Actual Behavior

ERROR: no such package '@@[unknown repo 'googleapis' requested from @@gazelle++go_deps+com_github_grpc_ecosystem_grpc_gateway_v2]//google/api': The repository '@@[unknown repo 'googleapis' requested from @@gazelle++go_deps+com_github_grpc_ecosystem_grpc_gateway_v2]' could not be resolved: No repository visible as '@googleapis' from repository '@@gazelle++go_deps+com_github_grpc_ecosystem_grpc_gateway_v2'

Your Environment

macOS 15.3.2
go 1.24
bazel 8.1.1
@johanbrandhorst
Copy link
Collaborator

Hi, thanks for the issue. I'm really not very familiar with Bazel, but I've been fortunate enough to have had help from contributors like @AlejoAsd, who may be able to figure out what's going on 😬.

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