You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
darwin arm64
What did you do?
I have a go dependency on https://github.com/grpc-ecosystem/grpc-gateway which has a proto dependency on googleapis.
In my repo, I added bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5") to my MODULE.bazel expecting that it would satisfy the dependency for grpc gateway. However, I'm getting the following error message.
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'
Prior to bzlmod, I could declare googleapis in my WORKSPACE and go_repository targets would be able to use them.
My current work around is to patch gazelle to have a dependency on googleapis as described in this issue.
What did you expect to see?
@googleapis is a resolveable target from within go_deps.
What did you see instead?
@googleapis cannot be found unless it's a dependency within gazelle.
The text was updated successfully, but these errors were encountered:
Follow up. I got around needing to patch gazelle by turning on build_file_generation for grpc gateway.
Grpc gateway doesn't quite support bzlmod but it's defining an empty MODULE.bazel and not a WORKSPACE.bzlmod.
I'm guessing gazelle was defaulting to the repo's build files and isn't using WORKSPACE for declared dependencies.
My overrides look as followed.
go_deps.gazelle_override(
build_file_generation = "on",
directives = [
"gazelle:go_generate_proto false",
"gazelle:resolve go github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor/apiconfig //internal/descriptor/apiconfig",
"gazelle:resolve go github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor/openapiconfig //internal/descriptor/openapiconfig",
"gazelle:resolve go github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options //protoc-gen-openapiv2/options",
],
path = "github.com/grpc-ecosystem/grpc-gateway/v2",
)
What version of gazelle are you using?
0.36.0
What version of rules_go are you using?
0.46.0
What version of Bazel are you using?
7.1.1
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
darwin arm64
What did you do?
I have a go dependency on https://github.com/grpc-ecosystem/grpc-gateway which has a proto dependency on googleapis.
In my repo, I added
bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5")
to myMODULE.bazel
expecting that it would satisfy the dependency for grpc gateway. However, I'm getting the following error message.Prior to bzlmod, I could declare
googleapis
in my WORKSPACE andgo_repository
targets would be able to use them.My current work around is to patch gazelle to have a dependency on
googleapis
as described in this issue.What did you expect to see?
@googleapis
is a resolveable target from within go_deps.What did you see instead?
@googleapis
cannot be found unless it's a dependency within gazelle.The text was updated successfully, but these errors were encountered: