Skip to content

Commit

Permalink
Use bzlmod to manage external dependencies (#186)
Browse files Browse the repository at this point in the history
* Use bzlmod to manage external dependencies

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

* Remove lockfile MODULE.bazel.lock
  • Loading branch information
luangong authored Feb 1, 2024
1 parent 90d7c56 commit f2c5583
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module(name = "protobuf_javascript", version = "3.21.2")

bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_pkg", version = "0.9.1")
2 changes: 2 additions & 0 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# When Bzlmod is enabled, this file replaces the content of the original WORKSPACE and
# makes sure no WORKSPACE prefix or suffix are added when Bzlmod is enabled.

0 comments on commit f2c5583

Please sign in to comment.