-
Notifications
You must be signed in to change notification settings - Fork 72
Use bzlmod to manage external dependencies #186
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
Conversation
Bzlmod is the new way to to manage external dependencies. The `--enable_bzlmod` flag was introduced in Bazel 6 and has been turned on by default since Bazel 7, so declaring external dependencies in `WORKSPACE` is considered leagcy behavior. The old `WORKSPACE`-system is planned to be disabled in Bazel 8 and to be removed altogether in Bazel 9. This commit migrates from `WORKSPACE` to bzlmod. References: - https://bazel.build/external/overview - https://bazel.build/external/migration - https://blog.bazel.build/2023/12/11/bazel-7-release.html#bzlmod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delay; I've been trying to dig into our policies on some things.
I have no major objection to accepting this change. However, could you please remove the lock file? While we should add one, it's too large to meaningfully review.
I'm thinking it would be easier for us to just generate it ourselves per https://bazel.build/external/lockfile.
The lockfile is already auto-generated. Maybe we should enable |
I think it'll be ok for the time being. Thank you the contribution! |
…194) * Keep dependency versions in sync for WORKSPACE and MODULE.bazel As mentioned in the Bazel blog article, the old `WORKSPACE` system is planned to be disabled by default in Bazel 8, and to be removed altogether in Bazel 9. The `WORKSPACE` file will eventually be removed, but for now, it’s best to keep the dependency versions in both systems in sync, so that we can build the project with Bzlmod either disabled or enabled. Note that there is a compatibility issue that prevents this project from depending on protobuf v22 and higher. Until that issue is fixed, v21.7 is the highest version that both systems have. References: - https://blog.bazel.build/2023/12/11/bazel-7-release.html#bzlmod - https://registry.bazel.build/modules/protobuf - https://github.com/protocolbuffers/protobuf/blob/v21.7/protobuf_deps.bzl#L96-L104 - #186 * Update PROTOC_VERSION to 21.7
Bzlmod is the new way to to manage external dependencies. The
--enable_bzlmod
flag was introduced in Bazel 6 and has been turned on by default since Bazel 7, so declaring external dependencies inWORKSPACE
is considered legacy behavior. The oldWORKSPACE
-system is planned to be disabled in Bazel 8 and to be removed altogether in Bazel 9.This commit migrates from
WORKSPACE
to bzlmod.References: