-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Include com_google_protobuf_javalite to MODULE.bazel to fix bzlmod querying graph in end-user repo #11147
Conversation
com_google_protobuf_javalite was load-bearing in previous versions of Bazel, as The easier approach is to just define com_google_protobuf_javalite as a duplicate of com_google_protobuf_java, which is what we've been doing for a while. (In the olden days, protobuf had a separate branch for lite, but it was later integrated into the master branch.) |
It won't work in bzlmod because of module strict visibility, it must be accessible from grpc-java itself. So currently we just patch it on module import.
I don't remove it completely, I thought this remapping will do the trick Currently in bzlmod perspective trunk is not correct as it has a reference to repository com_google_protobuf_javalite and does not define repository with that name. So other possible fix is remove |
I was meaning to change grpc-java to add the repo. (So changing
The problem is we need to make sure to use the same library as java_lite_proto_library. So it is really a question of java_lite_proto_library's behavior and then we match it (with tweaks for migration when it changes). |
Okay, let's go this way.
Ah i got it now, if user redefines it in workspace, we need to use his version. |
Hi folks, just hit this issue. Can this be merged, or is there a different way in which it can be fixed on my end? |
Hey, as i see we are waiting for second review. For now you can import this pr as a patch, if you are using version from central registry, something like this:
where first 3 patches you can take from registry https://github.com/bazelbuild/bazel-central-registry/tree/main/modules/grpc-java/1.62.2/patches |
Query in end-user repository fails with:
It's because com_google_protobuf_javalite is missing in use_repo in MODULE.bazel and completely not imported in repositories.bzl when using bzlmod. I noticed that actually com_google_protobuf_javalite is an archive with protobuf repository, which we already have, so i just change remapping.