From 478da0da46e3da025e5739a8b077b0b8a838152a Mon Sep 17 00:00:00 2001 From: Luan Gong Date: Wed, 13 Mar 2024 01:12:59 +0800 Subject: [PATCH] Keep dependency versions in sync for WORKSPACE and MODULE.bazel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 - https://github.com/protocolbuffers/protobuf-javascript/pull/186 --- MODULE.bazel | 2 +- WORKSPACE | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 92acf1f..ed40701 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -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") diff --git a/WORKSPACE b/WORKSPACE index 6902897..8e88002 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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")