-
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
Add a MODULE.bazel
in order to support for bzlmod
#9559
Comments
Support for bazel is on best effort basis. You may want to consider contributing this enhancement so it can then be reviewed. |
Because of the integration with BCR, it looks like we may need to be the one to do the last parts of this. And unclear if we'll need a new part to the release process or something. Looks like protobuf is out-of-date and we'll need to have yet-another copy of all our Maven dependencies (seems to replace maven_install). This is probably all for the best, but will be annoying during the transition and will need some effort to rework. |
You can move the build to use Bazel 6, so you'll only have one version of your |
If we don't test with Bazel 5, we'll break something. And we'd still need to support the maven_install approach (for Bazel 5 users, and Bazel 6 users that haven't swapped to modules), thus the duplication I noted. |
There IS a https://registry.bazel.build/modules/grpc but it doesn't define |
Has there been any movement on this ? Thanks ! |
Bazel 7 is released now and This issue is tagged with "help wanted" and I experimented a bit but hit a snag. Working on this probably also needs module support in https://github.com/googleapis/googleapis (there's even already a PR, googleapis/googleapis#855)... I'm not hopeful that a non Googler can do anything in googleapis. I'm not even sure issues and PRs in that repo are even read. Can you tell us a bit about the situation there or nudge someone into looking at it? (edit I misjudged, commits by external contributors seem to exist. But this probably has to be aligned with internal code and will be quite intricate) This will probably also affect grpc/grpc#35271 |
External contributors should be okay, but yeah, I see even a trivial PR updating a broken link has been languishing. @veblush, do you know who best to poke on googleapis to review PRs? Googleapis is a severe risk for this item. Its dependency situation tends to take some effort in the best of times, and there's circular dependencies between multiple grpc repos and googleapis that seem will impact this. I see the mention of |
Indeed, comments on the googleapis PR (googleapis/googleapis#855 (comment)) suggest that they're blocked on gRPC for migrating to Bzlmod. I assume this is because googleapis optionally generates per-language gRPC targets. What probably contributes to dependency issues is the fact that googleapis is the canonical open source location for global common components in addition to being the location for Google service APIs. Separately, I agree that this repo probably was never the right place for the |
Perhaps this is a limitation in bzlmod as much as it is an issue in this repo, but when attempting to migrate from rules_jvm to bzlmod for grpc-java, I hit issues where grpc-java pulls in guava-android, while we need the standard guava (we use some apis not included in the android version). While at compile time, this works fine, at runtime, whether guava-android or guava-jre get pulled in appears to be non-controllable. When pulling in grpc-java via maven on rules_jvm, we could simply pin to the jre version / exclude the android one. Also, at build time we would receive a warning that multiple versions of guava were pulled in. With this, we do not. I don't really have a suggested solution here, just worth noting -- and I'm sure others will see this behavior as well. Obviously there's nothing keeping us from continuing to use the maven version, at least for now. Happy to open an issue for this if it's useful. |
Opened #11102 |
I think you probably want a maven.override similar to the ones in my PR? |
@hlawrence-cn, you should be able to select which version of guava you want by setting it in your |
Right -- using maven.install I can -- the issue comes when trying to use grpc-java via bzlmod instead of maven.install. Though perhaps the idea would be to pull java sources via maven still, and just use the |
Probably makes sense to move conversation to #11102 |
Is your feature request related to a problem?
In Bazel 6, a new feature called
bzlmod
will ship. This is like a "package manager for Bazel rulesets", and using it avoids a lot of setup work being need to be done in aWORKSPACE
.Describe the solution you'd like
When run,
bzlmod
looks for rulesets on the Bazel Central Registry. Once theMODULE.bazel
is added to this project, it can then be registered with the BCR, and then people can start using it from the modularised builds.Describe alternatives you've considered
There are no alternatives at the moment.
Additional context
While there are workarounds to get things working, it would be nice if this was available before Bazel 6 is released, so projects can migrate to using
bzlmod
ASAP.The text was updated successfully, but these errors were encountered: