Skip to content

Commit

Permalink
Update Protobuf to 3.11.3
Browse files Browse the repository at this point in the history
Closes #10651.

PiperOrigin-RevId: 294910709
  • Loading branch information
Yannic authored and copybara-github committed Feb 13, 2020
1 parent 67b03f0 commit 5e571d2
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 33 deletions.
64 changes: 49 additions & 15 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ bind(
actual = "//third_party:guava",
)

# Used by //third_party/protobuf:protobuf_python
bind(
name = "six",
actual = "//third_party/py/six",
)

http_archive(
name = "bazel_j2objc",
# Computed using "shasum -a 256 j2objc-2.5.zip"
Expand Down Expand Up @@ -99,10 +93,18 @@ bind(
actual = "@bazel_tools//tools/objc:xcrunwrapper",
)

new_local_repository(
http_archive(
name = "com_google_protobuf",
build_file = "./third_party/protobuf/3.6.1/BUILD",
path = "./third_party/protobuf/3.6.1/",
patch_args = ["-p1"],
patches = ["@io_bazel//third_party/protobuf:3.11.3.patch"],
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
sha256 = "cf754718b0aa945b00550ed7962ddc167167bd922b842199eeb6505e6f344852",
strip_prefix = "protobuf-3.11.3",
urls = [
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.11.3.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/v3.11.3.tar.gz",
],
)

# This is a mock version of bazelbuild/rules_python that contains only
Expand Down Expand Up @@ -144,7 +146,6 @@ distdir_tar(
# Keep in sync with the archives fetched as part of building bazel.
archives = [
"e0b0291b2c51fbe5a7cfa14473a1ae850f94f021.zip",
"f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz",
"java_tools_javac11_linux-v7.0.zip",
"java_tools_javac11_windows-v7.0.zip",
"java_tools_javac11_darwin-v7.0.zip",
Expand All @@ -153,6 +154,8 @@ distdir_tar(
"8ccf4f1c351928b55d5dddf3672e3667f6978d60.tar.gz",
"0.16.2.zip",
"android_tools_pkg-0.14.tar.gz",
# bazelbuild/bazel-skylib
"f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz",
# bazelbuild/platforms
"46993efdd33b73649796c5fc5c9efb193ae19d51.zip",
# bazelbuild/rules_java
Expand All @@ -165,11 +168,12 @@ distdir_tar(
"rules_pkg-0.2.4.tar.gz",
# bazelbuild/rules_proto
"97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
# protocolbuffers/protobuf
"v3.11.3.tar.gz",
],
dirname = "derived/distdir",
sha256 = {
"e0b0291b2c51fbe5a7cfa14473a1ae850f94f021.zip": "fe2e04f91ce8c59d49d91b8102edc6627c6fa2906c1b0e7346f01419ec4f419d",
"f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz": "ba5d15ca230efca96320085d8e4d58da826d1f81b444ef8afccd8b23e0799b52",
"java_tools_javac11_linux-v7.0.zip": "3ff465e82954a70f49982610dd63f6f651beaa83c707dd637870b0e41cdcd2f0",
"java_tools_javac11_windows-v7.0.zip": "11d90a147919e74d11870cdd58c4ee5de3062c08d11b16aa72d3f3bbfa9497a0",
"java_tools_javac11_darwin-v7.0.zip": "373a4226906ae9ba908550da16e133c4cd1f01b8973af82b9a2eb6903cb4d645",
Expand All @@ -178,6 +182,8 @@ distdir_tar(
"8ccf4f1c351928b55d5dddf3672e3667f6978d60.tar.gz": "d868ce50d592ef4aad7dec4dd32ae68d2151261913450fac8390b3fd474bb898",
"0.16.2.zip": "9b72bb0aea72d7cbcfc82a01b1e25bf3d85f791e790ddec16c65e2d906382ee0",
"android_tools_pkg-0.14.tar.gz": "a3a951838448483e7af25afd10671b266cc6283104b4a2a427d31cac12cf0912", # built at 6c63d70ef9c11a662b8323c0ae4f6d3ac53b1a60
# bazelbuild/bazel-skylib
"f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz": "ba5d15ca230efca96320085d8e4d58da826d1f81b444ef8afccd8b23e0799b52",
# bazelbuild/platforms
"46993efdd33b73649796c5fc5c9efb193ae19d51.zip": "66184688debeeefcc2a16a2f80b03f514deac8346fe888fb7e691a52c023dd88",
# bazelbuild/rules_java
Expand All @@ -190,16 +196,14 @@ distdir_tar(
"rules_pkg-0.2.4.tar.gz": "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
# bazelbuild/rules_proto
"97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz": "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208",
# protocolbuffers/protobuf
"v3.11.3.tar.gz": "cf754718b0aa945b00550ed7962ddc167167bd922b842199eeb6505e6f344852",
},
urls = {
"e0b0291b2c51fbe5a7cfa14473a1ae850f94f021.zip": [
"https://mirror.bazel.build/github.com/google/desugar_jdk_libs/archive/e0b0291b2c51fbe5a7cfa14473a1ae850f94f021.zip",
"https://github.com/google/desugar_jdk_libs/archive/e0b0291b2c51fbe5a7cfa14473a1ae850f94f021.zip",
],
"f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz": [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/archive/f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/archive/f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz",
],
"java_tools_javac11_linux-v7.0.zip": [
"https://mirror.bazel.build/bazel_java_tools/releases/javac11/v7.0/java_tools_javac11_linux-v7.0.zip",
],
Expand Down Expand Up @@ -227,6 +231,11 @@ distdir_tar(
"android_tools_pkg-0.14.tar.gz": [
"https://mirror.bazel.build/bazel_android_tools/android_tools_pkg-0.14.tar.gz",
],
# bazelbuild/bazel-skylib
"f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz": [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/archive/f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/archive/f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz",
],
# bazelbuild/platforms
"46993efdd33b73649796c5fc5c9efb193ae19d51.zip": [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/archive/46993efdd33b73649796c5fc5c9efb193ae19d51.zip",
Expand Down Expand Up @@ -257,6 +266,11 @@ distdir_tar(
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
],
# protocolbuffers/protobuf
"v3.11.3.tar.gz": [
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.11.3.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/v3.11.3.tar.gz",
],
},
)

Expand Down Expand Up @@ -417,6 +431,8 @@ http_archive(

http_archive(
name = "bazel_skylib",
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
# Commit f83cb8dd6f5658bc574ccd873e25197055265d1c of 2018-11-26
sha256 = "ba5d15ca230efca96320085d8e4d58da826d1f81b444ef8afccd8b23e0799b52",
strip_prefix = "bazel-skylib-f83cb8dd6f5658bc574ccd873e25197055265d1c",
Expand Down Expand Up @@ -500,6 +516,8 @@ distdir_tar(
"zulu11.29.3-ca-jdk11.0.2-macosx_x64.zip",
"zulu11.29.3-ca-jdk11.0.2-win_x64.zip",
"android_tools_pkg-0.14.tar.gz",
# bazelbuild/bazel-skylib
"f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz",
# bazelbuild/platforms
"46993efdd33b73649796c5fc5c9efb193ae19d51.zip",
# bazelbuild/rules_java
Expand All @@ -508,6 +526,8 @@ distdir_tar(
"8bd6cd75d03c01bb82561a96d9c1f9f7157b13d0.zip",
# bazelbuild/rules_proto
"97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
# protocolbuffers/protobuf
"v3.11.3.tar.gz",
],
dirname = "test_WORKSPACE/distdir",
sha256 = {
Expand All @@ -531,6 +551,8 @@ distdir_tar(
"zulu11.29.3-ca-jdk11.0.2-macosx_x64.zip": "059f8e3484bf07b63a8f2820d5f528f473eff1befdb1896ee4f8ff06be3b8d8f",
"zulu11.29.3-ca-jdk11.0.2-win_x64.zip": "e1f5b4ce1b9148140fae2fcfb8a96d1c9b7eac5b8df0e13fbcad9b8561284880",
"android_tools_pkg-0.14.tar.gz": "a3a951838448483e7af25afd10671b266cc6283104b4a2a427d31cac12cf0912", # built at 6c63d70ef9c11a662b8323c0ae4f6d3ac53b1a60
# bazelbuild/bazel-skylib
"f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz": "ba5d15ca230efca96320085d8e4d58da826d1f81b444ef8afccd8b23e0799b52",
# bazelbuild/platforms
"46993efdd33b73649796c5fc5c9efb193ae19d51.zip": "66184688debeeefcc2a16a2f80b03f514deac8346fe888fb7e691a52c023dd88",
# bazelbuild/rules_java
Expand All @@ -539,6 +561,8 @@ distdir_tar(
"8bd6cd75d03c01bb82561a96d9c1f9f7157b13d0.zip": "1d4dbbd1e1e9b57d40bb0ade51c9e882da7658d5bfbf22bbd15b68e7879d761f",
# bazelbuild/rules_proto
"97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz": "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208",
# protocolbuffers/protobuf
"v3.11.3.tar.gz": "cf754718b0aa945b00550ed7962ddc167167bd922b842199eeb6505e6f344852",
},
urls = {
"zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules.tar.gz": ["https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules.tar.gz"],
Expand All @@ -563,6 +587,11 @@ distdir_tar(
"android_tools_pkg-0.14.tar.gz": [
"https://mirror.bazel.build/bazel_android_tools/android_tools_pkg-0.14.tar.gz",
],
# bazelbuild/bazel-skylib
"f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz": [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/archive/f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/archive/f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz",
],
# bazelbuild/platforms
"46993efdd33b73649796c5fc5c9efb193ae19d51.zip": [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/archive/46993efdd33b73649796c5fc5c9efb193ae19d51.zip",
Expand All @@ -583,6 +612,11 @@ distdir_tar(
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
],
# protocolbuffers/protobuf
"v3.11.3.tar.gz": [
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.11.3.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/v3.11.3.tar.gz",
],
},
)

Expand Down
1 change: 1 addition & 0 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ filegroup(
name = "test_repos",
srcs = [
"@android_tools_for_testing//:WORKSPACE",
"@bazel_skylib//:WORKSPACE",
"@bazel_toolchains//:WORKSPACE",
"@com_google_protobuf//:WORKSPACE",
"@openjdk10_darwin_archive//:WORKSPACE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ public static String getWorkspaceWithDefaultRepos() {
" strip_prefix = 'rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313',",
" urls = [",
" 'https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/"
+ "97d8af4dc474595af3900dd85cb3a29ad28cc313.zip',",
+ "97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz',",
" 'https://github.com/bazelbuild/rules_proto/archive/"
+ "97d8af4dc474595af3900dd85cb3a29ad28cc313.zip',",
+ "97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz',",
" ],",
")");
}
Expand Down
30 changes: 18 additions & 12 deletions src/test/shell/bazel/bazel_proto_library_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,30 @@ http_archive(
strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313",
sha256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/97d8af4dc474595af3900dd85cb3a29ad28cc313.zip",
"https://github.com/bazelbuild/rules_proto/97d8af4dc474595af3900dd85cb3a29ad28cc313.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
],
)
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()
# java_lite_proto_library rules implicitly depend on @com_google_protobuf_javalite//:javalite_toolchain,
# which is the JavaLite proto runtime (base classes and common utilities).
http_archive(
name = "com_google_protobuf_javalite",
sha256 = "d8a2fed3708781196f92e1e7e7e713cf66804bd2944894401057214aff4f468e",
strip_prefix = "protobuf-5e8916e881c573c5d83980197a6f783c132d4276",
urls = [
"https://mirror.bazel.build/github.com/google/protobuf/archive/5e8916e881c573c5d83980197a6f783c132d4276.zip",
"https://github.com/google/protobuf/archive/5e8916e881c573c5d83980197a6f783c132d4276.zip",
],
# @com_google_protobuf//:protoc depends on @io_bazel//third_party/zlib.
new_local_repository(
name = "io_bazel",
path = "$(dirname $(rlocation io_bazel/third_party/rules_python/rules_python.WORKSPACE))/../..",
build_file_content = "# Intentionally left empty.",
workspace_file_content = "workspace(name = 'io_bazel')",
)
# TODO(#9029): May require some adjustment if/when we depend on the real
# @rules_python in the real source tree, since this third_party/ package won't
# be available.
new_local_repository(
name = "rules_python",
path = "$(dirname $(rlocation io_bazel/third_party/rules_python/rules_python.WORKSPACE))",
build_file = "$(rlocation io_bazel/third_party/rules_python/BUILD)",
workspace_file = "$(rlocation io_bazel/third_party/rules_python/rules_python.WORKSPACE)",
)
EOF
}
Expand Down
1 change: 0 additions & 1 deletion src/test/shell/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ sh_test(
srcs = ["modify_execution_info_test.sh"],
data = [
":test-deps",
"//third_party/protobuf/3.6.1:srcs",
"@bazel_tools//tools/bash/runfiles",
],
)
Expand Down
21 changes: 18 additions & 3 deletions src/test/shell/integration/modify_execution_info_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,25 @@ function test_modify_execution_info_various_types() {
if [[ "$PRODUCT_NAME" = "bazel" ]]; then
# proto_library requires this external workspace.
cat >> WORKSPACE << EOF
http_archive(
name = "rules_proto",
strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313",
sha256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
],
)
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()
# @com_google_protobuf//:protoc depends on @io_bazel//third_party/zlib.
new_local_repository(
name = "com_google_protobuf",
path = "$(dirname $(rlocation io_bazel/third_party/protobuf/3.6.1/BUILD))",
build_file = "$(rlocation io_bazel/third_party/protobuf/3.6.1/BUILD)",
name = "io_bazel",
path = "$(dirname $(rlocation io_bazel/third_party/rules_python/rules_python.WORKSPACE))/../..",
build_file_content = "# Intentionally left empty.",
workspace_file_content = "workspace(name = 'io_bazel')",
)
# TODO(#9029): May require some adjustment if/when we depend on the real
Expand Down
1 change: 1 addition & 0 deletions src/test/shell/testenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ EOF

repos=(
"android_tools_for_testing"
"bazel_skylib"
"bazel_toolchains"
"com_google_protobuf"
"openjdk10_darwin_archive"
Expand Down

0 comments on commit 5e571d2

Please sign in to comment.