Skip to content

Commit

Permalink
Keep dependency versions in sync for WORKSPACE and MODULE.bazel
Browse files Browse the repository at this point in the history
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 an 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 in common.

References:

- https://blog.bazel.build/2023/12/11/bazel-7-release.html#bzlmod
- #186
  • Loading branch information
luangong committed Mar 12, 2024
1 parent f2c5583 commit 478da0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +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")
bazel_dep(name = "rules_pkg", version = "0.7.0")
5 changes: 3 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "com_google_protobuf",
strip_prefix = "protobuf-21.3",
urls = ["https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.3.zip"],
urls = ["https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.7.zip"],
sha256 = "e13ca6c2f1522924b8482f3b3a482427d0589ff8ea251088f7e39f4713236053",
strip_prefix = "protobuf-21.7",
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
Expand Down

0 comments on commit 478da0d

Please sign in to comment.