From 0399f38a163c76a7c3fe9c5be25dbd89fd4717cb Mon Sep 17 00:00:00 2001 From: Loo Rong Jie Date: Tue, 10 Jul 2018 03:08:36 -0700 Subject: Update third_party/protobuf to 3.6.0 Fixes #5439. PiperOrigin-RevId: 203917717 --- WORKSPACE | 12 ++++++------ .../google/devtools/build/lib/buildeventservice/BUILD | 2 +- src/main/protobuf/BUILD | 4 ++-- .../java/com/google/devtools/build/lib/rules/cpp/BUILD | 2 +- src/test/shell/integration/bazel_command_log_test.sh | 18 ++++++++++++++++++ src/test/shell/testenv.sh | 2 +- 6 files changed, 29 insertions(+), 11 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 74a3c4e5c3..e5ebb0c6f2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -69,20 +69,20 @@ bind( new_local_repository( name = "com_google_protobuf", - build_file = "./third_party/protobuf/3.4.0/BUILD", - path = "./third_party/protobuf/3.4.0/", + build_file = "./third_party/protobuf/3.6.0/BUILD", + path = "./third_party/protobuf/3.6.0/", ) new_local_repository( name = "com_google_protobuf_cc", - build_file = "./third_party/protobuf/3.4.0/BUILD", - path = "./third_party/protobuf/3.4.0/", + build_file = "./third_party/protobuf/3.6.0/BUILD", + path = "./third_party/protobuf/3.6.0/", ) new_local_repository( name = "com_google_protobuf_java", - build_file = "./third_party/protobuf/3.4.0/com_google_protobuf_java.BUILD", - path = "./third_party/protobuf/3.4.0/", + build_file = "./third_party/protobuf/3.6.0/com_google_protobuf_java.BUILD", + path = "./third_party/protobuf/3.6.0/", ) new_local_repository( diff --git a/src/main/java/com/google/devtools/build/lib/buildeventservice/BUILD b/src/main/java/com/google/devtools/build/lib/buildeventservice/BUILD index 10db971120..325788fa86 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventservice/BUILD +++ b/src/main/java/com/google/devtools/build/lib/buildeventservice/BUILD @@ -27,9 +27,9 @@ java_library( "//third_party:guava", "//third_party:jsr305", "//third_party/grpc:grpc-jar", + "@com_google_protobuf//:any_proto", "@com_google_protobuf//:protobuf_java", "@com_google_protobuf//:protobuf_java_util", - "@com_google_protobuf//:well_known_types_any_proto", "@googleapis//:google_devtools_build_v1_build_events_java_proto", "@googleapis//:google_devtools_build_v1_build_status_java_proto", "@googleapis//:google_devtools_build_v1_publish_build_event_java_proto", diff --git a/src/main/protobuf/BUILD b/src/main/protobuf/BUILD index 85aaa24a67..fbb1374348 100644 --- a/src/main/protobuf/BUILD +++ b/src/main/protobuf/BUILD @@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"]) load("//tools/build_rules:genproto.bzl", "cc_grpc_library") load("//tools/build_rules:utilities.bzl", "java_library_srcs") -load("//third_party/protobuf/3.4.0:protobuf.bzl", "py_proto_library") +load("//third_party/protobuf/3.6.0:protobuf.bzl", "py_proto_library") load("//third_party/grpc:build_defs.bzl", "java_grpc_library") exports_files( @@ -148,7 +148,7 @@ proto_library( name = "remote_execution_log_proto", srcs = ["remote_execution_log.proto"], deps = [ - "@com_google_protobuf//:well_known_types_timestamp_proto", + "@com_google_protobuf//:timestamp_proto", "@googleapis//:google_bytestream_bytestream_proto", "@googleapis//:google_devtools_remoteexecution_v1test_remote_execution_proto", "@googleapis//:google_longrunning_operations_proto", diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD b/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD index fe502fd67e..8fa0c86c49 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD @@ -83,7 +83,7 @@ java_library( "//third_party:junit4", "//third_party:truth", "//third_party/java/dd_plist", - "//third_party/protobuf/3.4.0:protobuf_java", + "//third_party/protobuf:protobuf_java", ], ) diff --git a/src/test/shell/integration/bazel_command_log_test.sh b/src/test/shell/integration/bazel_command_log_test.sh index 91294daa89..3e7443c353 100755 --- a/src/test/shell/integration/bazel_command_log_test.sh +++ b/src/test/shell/integration/bazel_command_log_test.sh @@ -46,12 +46,29 @@ function strip_lines_from_bazel_cc() { echo "$clean_log" > $TEST_log } +function strip_protobuf_unsafe_warning() { + # TODO: Protobuf triggers illegal reflective access warning in JDK 9. + # Remove this workaround when protobuf fixes this. + # See https://github.com/google/protobuf/issues/3781 + clean_log=$(\ + sed \ + -e "/^WARNING: An illegal reflective access operation has occurred/d" \ + -e "/^WARNING: Illegal reflective access by com\.google\.protobuf\.UnsafeUtil /d" \ + -e "/^WARNING: Please consider reporting this to the maintainers of com\.google\.protobuf\.UnsafeUtil/d" \ + -e "/^WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations/d" \ + -e "/^WARNING: All illegal access operations will be denied in a future release/d" \ + $TEST_log) + + echo "$clean_log" > $TEST_log +} + function test_batch_mode() { # capture stdout/stderr in $TEST_log bazel --batch info >&$TEST_log || fail "Expected success" # strip extra lines printed by bazel.cc strip_lines_from_bazel_cc + strip_protobuf_unsafe_warning # compare $TEST_log with command.log assert_equals "" "$(diff $TEST_log $log 2>&1)" @@ -68,6 +85,7 @@ function test_batch_mode_with_logging_flag() { # strip extra lines printed by bazel.cc strip_lines_from_bazel_cc + strip_protobuf_unsafe_warning # compare $TEST_log with command.log assert_equals "" "$(diff $TEST_log $log 2>&1)" diff --git a/src/test/shell/testenv.sh b/src/test/shell/testenv.sh index b2f6e24147..c4a0c5599d 100755 --- a/src/test/shell/testenv.sh +++ b/src/test/shell/testenv.sh @@ -115,7 +115,7 @@ if [ "${MACHINE_TYPE}" = 's390x' ]; then fi # Requires //third_party/protobuf:protoc -protoc_compiler="${BAZEL_RUNFILES}/third_party/protobuf/3.4.0/protoc" +protoc_compiler="${BAZEL_RUNFILES}/third_party/protobuf/3.6.0/protoc" if [ -z ${RUNFILES_MANIFEST_ONLY+x} ]; then junit_jar="${BAZEL_RUNFILES}/third_party/junit/junit-*.jar" -- cgit v1.2.3