bazelbuild / bazel-central-registry

The central registry of Bazel modules for the Bzlmod external dependency system.
https://registry.bazel.build
Apache License 2.0
237 stars 269 forks source link

[Bug]: gRPC v1.48.1.bcr.2's new `//third_party:protocol_compiler` alias is not visible for `cc_grpc_library` macro #1189

Closed grencez closed 6 months ago

grencez commented 7 months ago

What happened?

I'm trying to update my code on this branch to use Bazel version 6, which gRPC has been incompatible with for a while. But version 1.48.1.bcr.2 is almost enough! The only trouble is that its //third_party:protocol_compiler alias isn't publicly visible and causes errors when using the cc_grpc_library macro:

ERROR: /home/runner/work/rendezqueue/rendezqueue/proto/BUILD.bazel:16:16: in _generate_cc rule //proto:_rendezqueue_cc_grpc_grpc_codegen: alias '@grpc~1.48.1.bcr.2//third_party:protocol_compiler' referring to target '@protobuf~3.19.6//:protoc' is not visible from target '//proto:_rendezqueue_cc_grpc_grpc_codegen'. Check the visibility declaration of the former target if you think the dependency is legitimate
ERROR: /home/runner/work/rendezqueue/rendezqueue/proto/BUILD.bazel:16:16: Analysis of target '//proto:_rendezqueue_cc_grpc_grpc_codegen' failed

Is this intentional? Any objections to making a version 1.48.1.bcr.3 with more visibility?

Version

Development (host) and target OS/architectures: Linux [redacted] 5.10.0-25-amd64 #1 SMP Debian 5.10.191-1 (2023-08-16) x86_64 GNU/Linux

Output of bazel --version: bazel 6.4.0

Version of relevant rules from the WORKSPACE or MODULE.bazel file: grpc 1.48.1.bcr.2

Language(s) and/or frameworks involved: C++

How to reproduce

git clone -b grpc-v1.48.1 https://github.com/rendezqueue/rendezqueue.git
cd rendezqueue
bazel build //proto:rendezqueue_rendezqueue_cc_grpc

Any other information?

No response

mering commented 7 months ago

I forgot to make this public in #1181. Fixed in #1190.

grencez commented 6 months ago

That was a bit of an adventure. Thanks for being so persistent on the fix @mering.