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

Build breaks with Bazel 7.2.0 and bazel module grpc-java 1.62.2 #11275

Closed
openjohn opened this issue Jun 10, 2024 · 1 comment
Closed

Build breaks with Bazel 7.2.0 and bazel module grpc-java 1.62.2 #11275

openjohn opened this issue Jun 10, 2024 · 1 comment

Comments

@openjohn
Copy link

I have a bazel project with a MODULE.bazel depending on grpc-java 1.62.2 that was building fine on Debian. When I invoked bazel build at the command line, I saw that Bazel v7.2.0 was automatically downloaded; whereupon,

ERROR: ... build aborted: in tag at https://bcr.bazel.build/modules/grpc-java/1.62.2/MODULE.bazel:89:15: 
no repository visible as '@com_google_protobuf_javalite' to the repository '@@grpc-java~', but referenced 
by label '@com_google_protobuf_javalite//:protobuf_javalite' in attribute 'target' of tag 'override'. 
Is the module 'grpc-java' missing a bazel_dep or use_repo(..., "com_google_protobuf_javalite")?

Looking at head, in MODULE.bazel:

use_repo(
    non_module_deps,
    ...
    "com_google_protobuf_javalite",
)

maven.override(
    coordinates = "com.google.protobuf:protobuf-javalite",
    target = "@com_google_protobuf//:protobuf_javalite",
)

Notice com_google_protobuf_javalite versus com_google_protobuf//:protobuf_javalite. Looking in repositories.bzl, there are both com_google_protobuf and com_google_protobuf_javalite pointing at the same archive (protobuf-25.1).

In the grpc_java_repositories (module extension) there's some logic:

    if not bzlmod and not native.existing_rule("com_google_protobuf"):
        com_google_protobuf()
    if not native.existing_rule("com_google_protobuf_javalite"):
        com_google_protobuf_javalite()

I tried the obvious things like bazel clean but got the same error.

@openjohn
Copy link
Author

Closing the loop, I see that grpc-java 1.64.0 was published to Bazel Central this morning. I updated the module dependency in my project and the build now succeeds.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant