Skip to content

Commit e9929af

Browse files
comiuscopybara-github
authored andcommitted
Upgrade protobuf to 21.7
Closes #17094. PiperOrigin-RevId: 501570204 Change-Id: Ibb15570709d9a9cd0624e2a91d98b00749fa108e
1 parent 53e6a79 commit e9929af

File tree

5 files changed

+21
-27
lines changed

5 files changed

+21
-27
lines changed

MODULE.bazel

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module(
88

99
bazel_dep(name = "rules_license", version = "0.0.3")
1010
bazel_dep(name = "bazel_skylib", version = "1.3.0")
11-
bazel_dep(name = "protobuf", version = "3.19.6", repo_name = "com_google_protobuf")
11+
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")
1212
bazel_dep(name = "grpc", version = "1.47.0", repo_name = "com_github_grpc_grpc")
1313
bazel_dep(name = "platforms", version = "0.0.5")
1414
bazel_dep(name = "rules_pkg", version = "0.7.0")
@@ -17,7 +17,7 @@ bazel_dep(name = "zstd-jni", version = "1.5.2-3")
1717
bazel_dep(name = "zlib", version = "1.2.13")
1818
bazel_dep(name = "rules_cc", version = "0.0.2")
1919
bazel_dep(name = "rules_java", version = "5.4.0")
20-
bazel_dep(name = "rules_proto", version = "4.0.0")
20+
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
2121

2222
bazel_dep(name = "rules_jvm_external", version = "4.5")
2323
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
@@ -37,10 +37,11 @@ maven.install(
3737
"https://dl.google.com/android/maven2",
3838
"https://repo1.maven.org/maven2",
3939
],
40-
lock_file = "//:maven_install.json",
40+
# TODO(pcloudy): Re-enable lock file after updating maven_install.json
41+
# lock_file = "//:maven_install.json",
4142
)
4243

43-
use_repo(maven, "maven", "unpinned_maven")
44+
use_repo(maven, "maven")
4445

4546
# TODO(pcloudy): Add remoteapis and googleapis as Bazel modules in the BCR.
4647
bazel_dep(name = "remoteapis", version = "")
@@ -53,10 +54,3 @@ local_path_override(
5354
module_name = "googleapis",
5455
path = "./third_party/googleapis",
5556
)
56-
57-
# TODO(pcloudy): Remove this when rules_jvm_external adopts Bzlmod.
58-
single_version_override(
59-
module_name = "protobuf",
60-
patches = ["//third_party/protobuf:3.19.6.bzlmod.patch"],
61-
patch_strip = 1,
62-
)

WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ bind(
9292

9393
dist_http_archive(
9494
name = "com_google_protobuf",
95-
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
96-
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
95+
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
96+
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
9797
)
9898

9999
# This is a mock version of bazelbuild/rules_python that contains only

distdir_deps.bzl

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,11 @@ DIST_DEPS = {
8181
},
8282
# Used in src/test/java/com/google/devtools/build/lib/blackbox/framework/blackbox.WORKSAPCE
8383
"rules_proto": {
84-
"archive": "7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz",
85-
"sha256": "8e7d59a5b12b233be5652e3d29f42fba01c7cbab09f6b3a8d0a57ed6d1e9a0da",
86-
"strip_prefix": "rules_proto-7e4afce6fe62dbff0a4a03450143146f9f2d7488",
84+
"archive": "5.3.0-21.7.tar.gz",
85+
"sha256": "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
86+
"strip_prefix": "rules_proto-5.3.0-21.7",
8787
"urls": [
88-
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz",
89-
"https://github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz",
88+
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
9089
],
9190
"used_in": [
9291
"additional_distfiles",
@@ -95,23 +94,22 @@ DIST_DEPS = {
9594
"license_kinds": [
9695
"@rules_license//licenses/spdx:Apache-2.0",
9796
],
98-
"package_version": "2020-10-27",
9997
},
10098
#################################################
10199
#
102100
# Dependencies which are part of the Bazel binary
103101
#
104102
#################################################
105103
"com_google_protobuf": {
106-
"archive": "v3.19.6.tar.gz",
107-
"sha256": "9a301cf94a8ddcb380b901e7aac852780b826595075577bb967004050c835056",
108-
"strip_prefix": "protobuf-3.19.6",
104+
"archive": "v21.7.tar.gz",
105+
"sha256": "75be42bd736f4df6d702a0e4e4d30de9ee40eac024c4b845d17ae4cc831fe4ae",
106+
"strip_prefix": "protobuf-21.7",
109107
"urls": [
110-
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.19.6.tar.gz",
111-
"https://github.com/protocolbuffers/protobuf/archive/v3.19.6.tar.gz",
108+
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v21.7.tar.gz",
109+
"https://github.com/protocolbuffers/protobuf/archive/v21.7.tar.gz",
112110
],
113111
"patch_args": ["-p1"],
114-
"patches": ["//third_party/protobuf:3.19.6.patch"],
112+
"patches": ["//third_party/protobuf:21.7.patch"],
115113
"used_in": [
116114
"additional_distfiles",
117115
"test_WORKSPACE_files",
@@ -336,6 +334,7 @@ DIST_DEPS = {
336334
],
337335
"used_in": [
338336
"additional_distfiles",
337+
"test_WORKSPACE_files",
339338
],
340339
"package_version": "0.8.0",
341340
},

src/main/java/com/google/devtools/build/lib/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,11 @@ java_library(
190190
"//src/main/java/com/google/devtools/build/lib/util:crash_failure_details",
191191
"//src/main/java/com/google/devtools/build/lib/util:detailed_exit_code",
192192
"//src/main/java/com/google/devtools/build/lib/util:exit_code",
193-
"//src/main/protobuf:any_java_proto",
194193
"//src/main/protobuf:command_server_java_proto",
195194
"//src/main/protobuf:failure_details_java_proto",
196195
"//third_party:guava",
197196
"//third_party:jsr305",
197+
"@com_google_protobuf//java/core",
198198
],
199199
)
200200

@@ -216,8 +216,8 @@ java_library(
216216
":runtime/blaze_command_result",
217217
"//src/main/java/com/google/devtools/build/lib/util",
218218
"//src/main/java/com/google/devtools/build/lib/util/io:out-err",
219-
"//src/main/protobuf:any_java_proto",
220219
"//src/main/protobuf:invocation_policy_java_proto",
220+
"@com_google_protobuf//java/core",
221221
],
222222
)
223223

src/test/shell/testenv.sh.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ EOF
323323
"rules_license"
324324
"rules_proto"
325325
"rules_python"
326+
"rules_pkg"
326327
)
327328
for repo in "${repos[@]}"; do
328329
reponame="${repo%"_for_testing"}"

0 commit comments

Comments
 (0)