-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Bzlmod support #3759
Comments
This sounds like a great idea, but will it break existing users of Bazel? What does the Bazel team recommend maintainers do? We do have existing Bazel users and I don't want to suddenly spring this on them. CC @achew22, our resident Bazel expert ;) |
It's possible to offer support for both at the same time, but it is understandably more work to do so. Most projects that have published modules have got support for both methods, but personally I am cutting a major release of rules_proto_grpc that drops one and adds the other since WORKSPACE has been a collossal source of pain. There's a helpful project template here that helps automate the release process. At the moment, bzlmod is an opt-in flag under Bazel 6, but from Bazel 7 (whose release is imminent) bzlmod will be enabled by default. This flag flip won't immediately break things, since in the absence of a MODULE.bazel file, the WORKSPACE is used instead. But the path appears to be that WORKSPACE is on the way out over a long deprecation period. |
Thanks for that extra context, I expect we'll want to support both. |
In case it helps, I have a Bazel module for grpc-gateway in my own registry. Note that it depends on the googleapis module in that registry, as that does not have an official module yet. |
Thanks @SanjayVas, I tried out your modules, and it works great. For anyone else, to use it I added this to my bazelrc. This registers BCR and @SanjayVas registry.
Then I could add these modules to my
+1 for having bzlmod support directly from grpc-gateway |
I just wanted to give fair warning about using that registry directly. It's only intended to be used by other repos in that organization. There won't be any effort to avoid breaking other users. You may instead want to copy those modules into your own registry. |
🚀 Feature
At present your Bazel support and dependencies are managed via your WORKSPACE file. Bazel 6 introduced Bzlmod for managing project dependencies using a registry, which helps to solve the transitive dependency problem.
I am attempting to support grpc-gateway under bzlmod here, but both paths I have tried presently do not work (direct plugins and Gazelle). My third option is to maintain a patchset on top of grpc-gateway that fixes dependency loads to work under bzlmod, which really won't be pleasant. Before I do this, are you considering adding Bzlmod support? Looking at what's presently in your WORKSPACE, I don't see any major blockers.
Some useful links:
The text was updated successfully, but these errors were encountered: