From e2442b563c472efe6d3889e342c9f2844d2ab0e0 Mon Sep 17 00:00:00 2001 From: Luan Gong Date: Wed, 13 Mar 2024 01:12:59 +0800 Subject: [PATCH 1/2] 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 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 - 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") From 4bb7e178dae42874cb2dc19b4ace976c838346b8 Mon Sep 17 00:00:00 2001 From: Luan Gong Date: Wed, 13 Mar 2024 03:46:42 +0800 Subject: [PATCH 2/2] Update PROTOC_VERSION to 21.7 --- .github/workflows/build.yml | 2 +- .github/workflows/codeql.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bdbbfe..b409f70 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ permissions: read-all # update in build.yml and codeql.yml at same time env: - PROTOC_VERSION: 21.3 + PROTOC_VERSION: 21.7 jobs: build: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 4b65e05..57b1751 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -15,7 +15,7 @@ permissions: read-all # update in build.yml and codeql.yml at same time env: - PROTOC_VERSION: 21.3 + PROTOC_VERSION: 21.7 on: push: