Skip to content

Commit

Permalink
Upgrade protobuf to 21.7
Browse files Browse the repository at this point in the history
Closes bazelbuild#17094.

PiperOrigin-RevId: 501570204
Change-Id: Ibb15570709d9a9cd0624e2a91d98b00749fa108e
  • Loading branch information
comius authored and copybara-github committed Jan 12, 2023
1 parent 53e6a79 commit e9929af
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
16 changes: 5 additions & 11 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module(

bazel_dep(name = "rules_license", version = "0.0.3")
bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "protobuf", version = "3.19.6", repo_name = "com_google_protobuf")
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")
bazel_dep(name = "grpc", version = "1.47.0", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "platforms", version = "0.0.5")
bazel_dep(name = "rules_pkg", version = "0.7.0")
Expand All @@ -17,7 +17,7 @@ bazel_dep(name = "zstd-jni", version = "1.5.2-3")
bazel_dep(name = "zlib", version = "1.2.13")
bazel_dep(name = "rules_cc", version = "0.0.2")
bazel_dep(name = "rules_java", version = "5.4.0")
bazel_dep(name = "rules_proto", version = "4.0.0")
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")

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

use_repo(maven, "maven", "unpinned_maven")
use_repo(maven, "maven")

# TODO(pcloudy): Add remoteapis and googleapis as Bazel modules in the BCR.
bazel_dep(name = "remoteapis", version = "")
Expand All @@ -53,10 +54,3 @@ local_path_override(
module_name = "googleapis",
path = "./third_party/googleapis",
)

# TODO(pcloudy): Remove this when rules_jvm_external adopts Bzlmod.
single_version_override(
module_name = "protobuf",
patches = ["//third_party/protobuf:3.19.6.bzlmod.patch"],
patch_strip = 1,
)
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ bind(

dist_http_archive(
name = "com_google_protobuf",
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
)

# This is a mock version of bazelbuild/rules_python that contains only
Expand Down
23 changes: 11 additions & 12 deletions distdir_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,11 @@ DIST_DEPS = {
},
# Used in src/test/java/com/google/devtools/build/lib/blackbox/framework/blackbox.WORKSAPCE
"rules_proto": {
"archive": "7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz",
"sha256": "8e7d59a5b12b233be5652e3d29f42fba01c7cbab09f6b3a8d0a57ed6d1e9a0da",
"strip_prefix": "rules_proto-7e4afce6fe62dbff0a4a03450143146f9f2d7488",
"archive": "5.3.0-21.7.tar.gz",
"sha256": "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
"strip_prefix": "rules_proto-5.3.0-21.7",
"urls": [
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
],
"used_in": [
"additional_distfiles",
Expand All @@ -95,23 +94,22 @@ DIST_DEPS = {
"license_kinds": [
"@rules_license//licenses/spdx:Apache-2.0",
],
"package_version": "2020-10-27",
},
#################################################
#
# Dependencies which are part of the Bazel binary
#
#################################################
"com_google_protobuf": {
"archive": "v3.19.6.tar.gz",
"sha256": "9a301cf94a8ddcb380b901e7aac852780b826595075577bb967004050c835056",
"strip_prefix": "protobuf-3.19.6",
"archive": "v21.7.tar.gz",
"sha256": "75be42bd736f4df6d702a0e4e4d30de9ee40eac024c4b845d17ae4cc831fe4ae",
"strip_prefix": "protobuf-21.7",
"urls": [
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.19.6.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/v3.19.6.tar.gz",
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v21.7.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/v21.7.tar.gz",
],
"patch_args": ["-p1"],
"patches": ["//third_party/protobuf:3.19.6.patch"],
"patches": ["//third_party/protobuf:21.7.patch"],
"used_in": [
"additional_distfiles",
"test_WORKSPACE_files",
Expand Down Expand Up @@ -336,6 +334,7 @@ DIST_DEPS = {
],
"used_in": [
"additional_distfiles",
"test_WORKSPACE_files",
],
"package_version": "0.8.0",
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/google/devtools/build/lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/util:crash_failure_details",
"//src/main/java/com/google/devtools/build/lib/util:detailed_exit_code",
"//src/main/java/com/google/devtools/build/lib/util:exit_code",
"//src/main/protobuf:any_java_proto",
"//src/main/protobuf:command_server_java_proto",
"//src/main/protobuf:failure_details_java_proto",
"//third_party:guava",
"//third_party:jsr305",
"@com_google_protobuf//java/core",
],
)

Expand All @@ -216,8 +216,8 @@ java_library(
":runtime/blaze_command_result",
"//src/main/java/com/google/devtools/build/lib/util",
"//src/main/java/com/google/devtools/build/lib/util/io:out-err",
"//src/main/protobuf:any_java_proto",
"//src/main/protobuf:invocation_policy_java_proto",
"@com_google_protobuf//java/core",
],
)

Expand Down
1 change: 1 addition & 0 deletions src/test/shell/testenv.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ EOF
"rules_license"
"rules_proto"
"rules_python"
"rules_pkg"
)
for repo in "${repos[@]}"; do
reponame="${repo%"_for_testing"}"
Expand Down

0 comments on commit e9929af

Please sign in to comment.