Open vudaoanhtuan opened 1 month ago
This is due to a bug in a released version of grpc-java: https://github.com/grpc/grpc-java/issues/11275
This project doesn't directly ever use the grpc-java repo, but it gets pulled transitively through googleapis -> grpc. Whilst there is a new version released that fixes this, you end up pulling the broken version due to googleapis not being updated to the fixed version.
A temporary fix is to use a single_version_override
in your MODULE.bazel to force the fixed version, but a real fix needs to be done in one of those other repos sadly...
single_version_override(
module_name = "grpc-java",
version = "1.64.0",
)
I added single_version_override
but I got another error:
ERROR: no such package '@@[unknown repo 'maven' requested from @@protobuf~]//': The repository '@@[unknown repo 'maven' requested from @@protobuf~]' could not be resolved: No repository visible as '@maven' from repository '@@protobuf~'
ERROR: /private/var/tmp/_bazel_user/691169fb99f8988cdeecf9ebf10cdc9f/external/protobuf~/java/util/BUILD.bazel:8:13: no such package '@@[unknown repo 'maven' requested from @@protobuf~]//': The repository '@@[unknown repo 'maven' requested from @@protobuf~]' could not be resolved: No repository visible as '@maven' from repository '@@protobuf~' and referenced by '@@protobuf~//java/util:util'
ERROR: Analysis of target '//:java_binary' failed; build aborted: Analysis failed
Gah, I see this too. This is a different bug in yet another upstream dependency: https://github.com/protocolbuffers/protobuf/issues/17176
This one has no simple workaround, as there is no fixed protobuf release available (let alone available in BCR)...
I see that https://github.com/protocolbuffers/protobuf/issues/17176 is resolved by PR https://github.com/protocolbuffers/protobuf/pull/17402, that PR is merged into main
branch, so I tried to override protobuf
by using git_override
rule, but it produces another error, perhaps I should wait for them to release a new version
Issue Description
I'm migrating my project to from
WORKSPACE
toMODULE.bazel
, my project includes some grpc services written by both java and python, and I am usingrules_proto_grpc
v4.1.1, every work well. After migrating to bzlmod, I userules_proto_grpc
v5.0.0, first I userules_proto_grpc_python
for python services and they work, then I userules_proto_grpc_java
for java services but I got error:I notice that when I disable one of them, the other will work without any error, but when I enable both rules, I got above error message again
Here is my simple setup to reproduce the error: test_bazel.zip
bazel run //:python_binary
works butbazel run //:java_binary
throw error messageLog Output
rules_proto_grpc Version
5.0.0
Bazel Version
7.2.1
OS
MacOS
Link to Demo Repo
No response
MODULE.bazel or WORKSPACE Content
BUILD Content
Proto Content
Any Other Content
No response