From f05ad8ee7170e06663d5231b7f8d6ed8b62bb10f Mon Sep 17 00:00:00 2001 From: Deanna Garcia Date: Wed, 10 Aug 2022 20:37:27 +0000 Subject: [PATCH 1/6] Use protoc version for --version --- .../protobuf/compiler/command_line_interface.cc | 2 +- src/google/protobuf/stubs/common.cc | 12 ++++++++++-- src/google/protobuf/stubs/common.h | 7 ++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index f5cc9a91737f5..652ce04495853 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -1844,7 +1844,7 @@ CommandLineInterface::InterpretArgument(const std::string& name, if (!version_info_.empty()) { std::cout << version_info_ << std::endl; } - std::cout << "libprotoc " << internal::VersionString(PROTOBUF_VERSION) + std::cout << "libprotoc " << internal::ProtocVersionString(PROTOBUF_VERSION) << PROTOBUF_VERSION_SUFFIX << std::endl; return PARSE_ARGUMENT_DONE_AND_EXIT; // Exit without running compiler. diff --git a/src/google/protobuf/stubs/common.cc b/src/google/protobuf/stubs/common.cc index f1a815022d4d5..5e6ce708288c8 100644 --- a/src/google/protobuf/stubs/common.cc +++ b/src/google/protobuf/stubs/common.cc @@ -92,7 +92,7 @@ void VerifyVersion(int headerVersion, } } -std::string VersionString(int version) { +std::string VersionString(int version, bool cppMajor) { int major = version / 1000000; int minor = (version / 1000) % 1000; int micro = version % 1000; @@ -100,7 +100,11 @@ std::string VersionString(int version) { // 128 bytes should always be enough, but we use snprintf() anyway to be // safe. char buffer[128]; - snprintf(buffer, sizeof(buffer), "%d.%d.%d", major, minor, micro); + if (cppMajor) { + snprintf(buffer, sizeof(buffer), "%d.%d.%d", major, minor, micro); + } else { + snprintf(buffer, sizeof(buffer), "%d.%d", minor, micro); + } // Guard against broken MSVC snprintf(). buffer[sizeof(buffer)-1] = '\0'; @@ -108,6 +112,10 @@ std::string VersionString(int version) { return buffer; } +std::string ProtocVersionString(int version) { + return VersionString(version, false); +} + } // namespace internal // =================================================================== diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index 427df67d4f1a9..2d6bcf86158cf 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -106,7 +106,12 @@ void PROTOBUF_EXPORT VerifyVersion(int headerVersion, int minLibraryVersion, const char* filename); // Converts a numeric version number to a string. -std::string PROTOBUF_EXPORT VersionString(int version); +// If cppMajor is true the string will have the C++ major version, otherwise +// the string will be the protoc version. +std::string PROTOBUF_EXPORT VersionString(int version, bool cppMajor = true); + +// Prints the protoc compiler version (no major version) +std::string PROTOBUF_EXPORT ProtocVersionString(int version); } // namespace internal From b8712d1a55673380e3960fa5212952eeac05cf5d Mon Sep 17 00:00:00 2001 From: Deanna Garcia Date: Wed, 10 Aug 2022 23:41:45 +0000 Subject: [PATCH 2/6] Update to have two distinct methods --- src/google/protobuf/stubs/common.cc | 22 +++++++++++++++------- src/google/protobuf/stubs/common.h | 4 +--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/google/protobuf/stubs/common.cc b/src/google/protobuf/stubs/common.cc index 5e6ce708288c8..3fa3d04c759ac 100644 --- a/src/google/protobuf/stubs/common.cc +++ b/src/google/protobuf/stubs/common.cc @@ -92,7 +92,7 @@ void VerifyVersion(int headerVersion, } } -std::string VersionString(int version, bool cppMajor) { +std::string VersionString(int version) { int major = version / 1000000; int minor = (version / 1000) % 1000; int micro = version % 1000; @@ -100,11 +100,7 @@ std::string VersionString(int version, bool cppMajor) { // 128 bytes should always be enough, but we use snprintf() anyway to be // safe. char buffer[128]; - if (cppMajor) { - snprintf(buffer, sizeof(buffer), "%d.%d.%d", major, minor, micro); - } else { - snprintf(buffer, sizeof(buffer), "%d.%d", minor, micro); - } + snprintf(buffer, sizeof(buffer), "%d.%d.%d", major, minor, micro); // Guard against broken MSVC snprintf(). buffer[sizeof(buffer)-1] = '\0'; @@ -113,7 +109,19 @@ std::string VersionString(int version, bool cppMajor) { } std::string ProtocVersionString(int version) { - return VersionString(version, false); + int minor = (version / 1000) % 1000; + int micro = version % 1000; + + // 128 bytes should always be enough, but we use snprintf() anyway to be + // safe. + char buffer[128]; + snprintf(buffer, sizeof(buffer), "%d.%d", minor, micro); + + // Guard against broken MSVC snprintf(). + buffer[sizeof(buffer)-1] = '\0'; + + return buffer; + } } // namespace internal diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index 2d6bcf86158cf..64787684bbf88 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -106,9 +106,7 @@ void PROTOBUF_EXPORT VerifyVersion(int headerVersion, int minLibraryVersion, const char* filename); // Converts a numeric version number to a string. -// If cppMajor is true the string will have the C++ major version, otherwise -// the string will be the protoc version. -std::string PROTOBUF_EXPORT VersionString(int version, bool cppMajor = true); +std::string PROTOBUF_EXPORT VersionString(int version); // Prints the protoc compiler version (no major version) std::string PROTOBUF_EXPORT ProtocVersionString(int version); From 486a10c1f69c02c0557322d182c7693076bf08ed Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Thu, 11 Aug 2022 10:41:07 -0700 Subject: [PATCH 3/6] Disabling upb tests in python_cpp builds (#10392) * Disabling upb tests in python_cpp builds * Adding comment about upb --- kokoro/linux/python310_cpp/continuous.cfg | 4 +++- kokoro/linux/python310_cpp/presubmit.cfg | 1 + kokoro/linux/python37_cpp/continuous.cfg | 3 ++- kokoro/linux/python37_cpp/presubmit.cfg | 1 + kokoro/linux/python38_cpp/continuous.cfg | 3 ++- kokoro/linux/python38_cpp/presubmit.cfg | 1 + kokoro/linux/python39_cpp/continuous.cfg | 3 ++- kokoro/linux/python39_cpp/presubmit.cfg | 1 + 8 files changed, 13 insertions(+), 4 deletions(-) diff --git a/kokoro/linux/python310_cpp/continuous.cfg b/kokoro/linux/python310_cpp/continuous.cfg index 1f91c26713d87..e76abe18a0333 100644 --- a/kokoro/linux/python310_cpp/continuous.cfg +++ b/kokoro/linux/python310_cpp/continuous.cfg @@ -11,7 +11,9 @@ env_vars { env_vars { key: "BAZEL_TARGETS" - value: "//python/... @upb//python/..." + # Note: upb tests don't work since the C++ extension takes precedence here. + # Note: upb tests don't work since the C++ extension takes precedence here. + value: "//python/..." } env_vars { diff --git a/kokoro/linux/python310_cpp/presubmit.cfg b/kokoro/linux/python310_cpp/presubmit.cfg index 1c4cfeebc8f43..5b87fd6c51b51 100644 --- a/kokoro/linux/python310_cpp/presubmit.cfg +++ b/kokoro/linux/python310_cpp/presubmit.cfg @@ -11,6 +11,7 @@ env_vars { env_vars { key: "BAZEL_TARGETS" + # Note: upb tests don't work since the C++ extension takes precedence here. value: "//python/..." } diff --git a/kokoro/linux/python37_cpp/continuous.cfg b/kokoro/linux/python37_cpp/continuous.cfg index 44f6606a9fc73..ebef92806f098 100644 --- a/kokoro/linux/python37_cpp/continuous.cfg +++ b/kokoro/linux/python37_cpp/continuous.cfg @@ -11,7 +11,8 @@ env_vars { env_vars { key: "BAZEL_TARGETS" - value: "//python/... @upb//python/..." + # Note: upb tests don't work since the C++ extension takes precedence here. + value: "//python/..." } env_vars { diff --git a/kokoro/linux/python37_cpp/presubmit.cfg b/kokoro/linux/python37_cpp/presubmit.cfg index 54b2de47e156d..ebef92806f098 100644 --- a/kokoro/linux/python37_cpp/presubmit.cfg +++ b/kokoro/linux/python37_cpp/presubmit.cfg @@ -11,6 +11,7 @@ env_vars { env_vars { key: "BAZEL_TARGETS" + # Note: upb tests don't work since the C++ extension takes precedence here. value: "//python/..." } diff --git a/kokoro/linux/python38_cpp/continuous.cfg b/kokoro/linux/python38_cpp/continuous.cfg index dc24fd2a3d8b9..decd46649486e 100644 --- a/kokoro/linux/python38_cpp/continuous.cfg +++ b/kokoro/linux/python38_cpp/continuous.cfg @@ -11,7 +11,8 @@ env_vars { env_vars { key: "BAZEL_TARGETS" - value: "//python/... @upb//python/..." + # Note: upb tests don't work since the C++ extension takes precedence here. + value: "//python/..." } env_vars { diff --git a/kokoro/linux/python38_cpp/presubmit.cfg b/kokoro/linux/python38_cpp/presubmit.cfg index f9d025a3af723..decd46649486e 100644 --- a/kokoro/linux/python38_cpp/presubmit.cfg +++ b/kokoro/linux/python38_cpp/presubmit.cfg @@ -11,6 +11,7 @@ env_vars { env_vars { key: "BAZEL_TARGETS" + # Note: upb tests don't work since the C++ extension takes precedence here. value: "//python/..." } diff --git a/kokoro/linux/python39_cpp/continuous.cfg b/kokoro/linux/python39_cpp/continuous.cfg index f11d73ed8918e..97970087b040c 100644 --- a/kokoro/linux/python39_cpp/continuous.cfg +++ b/kokoro/linux/python39_cpp/continuous.cfg @@ -11,7 +11,8 @@ env_vars { env_vars { key: "BAZEL_TARGETS" - value: "//python/... @upb//python/..." + # Note: upb tests don't work since the C++ extension takes precedence here. + value: "//python/..." } env_vars { diff --git a/kokoro/linux/python39_cpp/presubmit.cfg b/kokoro/linux/python39_cpp/presubmit.cfg index d7deef5b6982b..97970087b040c 100644 --- a/kokoro/linux/python39_cpp/presubmit.cfg +++ b/kokoro/linux/python39_cpp/presubmit.cfg @@ -11,6 +11,7 @@ env_vars { env_vars { key: "BAZEL_TARGETS" + # Note: upb tests don't work since the C++ extension takes precedence here. value: "//python/..." } From 7c1936b29947cc38ae9f2c99d4e1611b1ad740e2 Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Thu, 11 Aug 2022 16:52:36 -0700 Subject: [PATCH 4/6] Reverting changes to ruby aarch64 build. (#10394) * Reverting changes to ruby aarch64 build. * Adding IN_DOCKER environment variable to prevent codegen * Pass the cmake-built protoc to the ruby runner --- kokoro/linux/aarch64/test_ruby_aarch64.sh | 2 +- kokoro/linux/ruby_aarch64/build.sh | 16 ++++++++++++++++ kokoro/linux/ruby_aarch64/continuous.cfg | 19 ++----------------- kokoro/linux/ruby_aarch64/presubmit.cfg | 19 ++----------------- 4 files changed, 21 insertions(+), 35 deletions(-) create mode 100755 kokoro/linux/ruby_aarch64/build.sh diff --git a/kokoro/linux/aarch64/test_ruby_aarch64.sh b/kokoro/linux/aarch64/test_ruby_aarch64.sh index 91ee5f288a486..e256e4edccea9 100755 --- a/kokoro/linux/aarch64/test_ruby_aarch64.sh +++ b/kokoro/linux/aarch64/test_ruby_aarch64.sh @@ -24,4 +24,4 @@ kokoro/linux/aarch64/dockcross_helpers/run_dockcross_manylinux2014_aarch64.sh ko # otherwise the UID would be homeless under the docker container and pip install wouldn't work. For simplicity, # we just run map the user's home to a throwaway temporary directory -docker run $DOCKER_TTY_ARGS --rm --user "$(id -u):$(id -g)" -e "HOME=/home/fake-user" -v "$(mktemp -d):/home/fake-user" -v "$(pwd)":/work -w /work arm64v8/ruby:2.7.3-buster kokoro/linux/aarch64/ruby_build_and_run_tests_with_qemu_aarch64.sh \ No newline at end of file +docker run $DOCKER_TTY_ARGS --rm --user "$(id -u):$(id -g)" -e "HOME=/home/fake-user" -e "PROTOC=/work/protoc" -v "$(mktemp -d):/home/fake-user" -v "$(pwd)":/work -w /work arm64v8/ruby:2.7.3-buster kokoro/linux/aarch64/ruby_build_and_run_tests_with_qemu_aarch64.sh diff --git a/kokoro/linux/ruby_aarch64/build.sh b/kokoro/linux/ruby_aarch64/build.sh new file mode 100755 index 0000000000000..6473e0d222eff --- /dev/null +++ b/kokoro/linux/ruby_aarch64/build.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# +# This is the top-level script we give to Kokoro as the entry point for +# running the "continuous" and "presubmit" jobs. + +set -ex + +# Change to repo root +cd $(dirname $0)/../../.. + +# Initialize any submodules. +git submodule update --init --recursive + +kokoro/linux/aarch64/qemu_helpers/prepare_qemu.sh + +kokoro/linux/aarch64/test_ruby_aarch64.sh diff --git a/kokoro/linux/ruby_aarch64/continuous.cfg b/kokoro/linux/ruby_aarch64/continuous.cfg index 044e8267afedc..ae82696404955 100644 --- a/kokoro/linux/ruby_aarch64/continuous.cfg +++ b/kokoro/linux/ruby_aarch64/continuous.cfg @@ -1,26 +1,11 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" +build_file: "protobuf/kokoro/linux/ruby_aarch64/build.sh" timeout_mins: 120 -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=c" -} - action { define_artifacts { - regex: "**/sponge_log.*" + regex: "**/sponge_log.xml" } } diff --git a/kokoro/linux/ruby_aarch64/presubmit.cfg b/kokoro/linux/ruby_aarch64/presubmit.cfg index 044e8267afedc..ae82696404955 100644 --- a/kokoro/linux/ruby_aarch64/presubmit.cfg +++ b/kokoro/linux/ruby_aarch64/presubmit.cfg @@ -1,26 +1,11 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" +build_file: "protobuf/kokoro/linux/ruby_aarch64/build.sh" timeout_mins: 120 -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=c" -} - action { define_artifacts { - regex: "**/sponge_log.*" + regex: "**/sponge_log.xml" } } From 500cbd7b90fa7eb5716a3bbc6aa788ada028a1bf Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Thu, 11 Aug 2022 18:22:15 -0700 Subject: [PATCH 5/6] Upgrade third_party/googletest submodule to current main branch (#10393) * Upgrade third_party/googletest submodule to current main branch We can finally do this upgrade now that we have dropped our autotools build. Googletest recommends living at head, so let's go straight to the most recent commit on main. For some reason the googletest archive is not present in the Bazel build mirror, so I removed that entry and just left the GitHub download link in our WORKSPACE file. Googletest now requires C++14, so I updated all the C++11 flags I could find to C++14 instead. I added a .bazelrc file to add -std=c++14 for all our Bazel builds. * Delete the empty //src/google/protobuf:protobuf_test target * Avoid building C++ unit tests in aarch64 jobs for Python and Ruby --- .bazelrc | 1 + CMakeLists.txt | 8 ++++---- WORKSPACE | 7 +++---- examples/Makefile | 4 ++-- kokoro/linux/aarch64/protoc_crosscompile_aarch64.sh | 2 +- kokoro/linux/aarch64/python_crosscompile_aarch64.sh | 2 +- python/setup.py | 2 +- src/google/protobuf/BUILD.bazel | 10 ---------- third_party/googletest | 2 +- 9 files changed, 14 insertions(+), 24 deletions(-) create mode 100644 .bazelrc diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 0000000000000..f93facf00a8ca --- /dev/null +++ b/.bazelrc @@ -0,0 +1 @@ +build --cxxopt=-std=c++14 diff --git a/CMakeLists.txt b/CMakeLists.txt index 345d7d05a491d..b343c64e48ee0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,11 +32,11 @@ if(protobuf_DEPRECATED_CMAKE_SUBDIRECTORY_USAGE) get_filename_component(protobuf_SOURCE_DIR ${protobuf_SOURCE_DIR} DIRECTORY) endif() -# Add c++11 flags +# Add c++14 flags if (CYGWIN) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14") else() - set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) endif() @@ -187,7 +187,7 @@ set(protobuf_LINK_LIBATOMIC false) if (NOT MSVC) include(CheckCXXSourceCompiles) set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) - set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -std=c++11) + set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -std=c++14) check_cxx_source_compiles(" #include int main() { diff --git a/WORKSPACE b/WORKSPACE index ebe53315f03cd..20e7415a62961 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -9,11 +9,10 @@ local_repository( http_archive( name = "com_google_googletest", - sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb", - strip_prefix = "googletest-release-1.10.0", + sha256 = "ea54c9845568cb31c03f2eddc7a40f7f83912d04ab977ff50ec33278119548dd", + strip_prefix = "googletest-4c9a3bb62bf3ba1f1010bf96f9c8ed767b363774", urls = [ - "https://mirror.bazel.build/github.com/google/googletest/archive/release-1.10.0.tar.gz", - "https://github.com/google/googletest/archive/release-1.10.0.tar.gz", + "https://github.com/google/googletest/archive/4c9a3bb62bf3ba1f1010bf96f9c8ed767b363774.tar.gz", ], ) diff --git a/examples/Makefile b/examples/Makefile index 2a64b64fe3727..ef7a4ef58e946 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -41,11 +41,11 @@ protoc_middleman_dart: addressbook.proto add_person_cpp: add_person.cc protoc_middleman pkg-config --cflags protobuf # fails if protobuf is not installed - c++ -std=c++11 add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf` + c++ -std=c++14 add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf` list_people_cpp: list_people.cc protoc_middleman pkg-config --cflags protobuf # fails if protobuf is not installed - c++ -std=c++11 list_people.cc addressbook.pb.cc -o list_people_cpp `pkg-config --cflags --libs protobuf` + c++ -std=c++14 list_people.cc addressbook.pb.cc -o list_people_cpp `pkg-config --cflags --libs protobuf` add_person_dart: add_person.dart protoc_middleman_dart diff --git a/kokoro/linux/aarch64/protoc_crosscompile_aarch64.sh b/kokoro/linux/aarch64/protoc_crosscompile_aarch64.sh index 2880507539aa5..7f07968d9a0c4 100755 --- a/kokoro/linux/aarch64/protoc_crosscompile_aarch64.sh +++ b/kokoro/linux/aarch64/protoc_crosscompile_aarch64.sh @@ -4,5 +4,5 @@ set -ex -cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_WITH_ZLIB=0 . +cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_WITH_ZLIB=0 -Dprotobuf_BUILD_TESTS=OFF . make -j8 diff --git a/kokoro/linux/aarch64/python_crosscompile_aarch64.sh b/kokoro/linux/aarch64/python_crosscompile_aarch64.sh index 97d0a2403acc4..a04c7e408c363 100755 --- a/kokoro/linux/aarch64/python_crosscompile_aarch64.sh +++ b/kokoro/linux/aarch64/python_crosscompile_aarch64.sh @@ -12,7 +12,7 @@ PYTHON="/opt/python/cp38-cp38/bin/python" git submodule update --init --recursive # Build protoc and libprotobuf -cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_WITH_ZLIB=0 . +cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_WITH_ZLIB=0 -Dprotobuf_BUILD_TESTS=OFF . make -j8 # create a simple shell wrapper that runs crosscompiled protoc under qemu diff --git a/python/setup.py b/python/setup.py index 283c99af607aa..3364ba9f7ad21 100755 --- a/python/setup.py +++ b/python/setup.py @@ -331,7 +331,7 @@ def HasLibraryDirsOpt(): extra_compile_args.append('-Wno-invalid-offsetof') extra_compile_args.append('-Wno-sign-compare') extra_compile_args.append('-Wno-unused-variable') - extra_compile_args.append('-std=c++11') + extra_compile_args.append('-std=c++14') if sys.platform == 'darwin': extra_compile_args.append('-Wno-shorten-64-to-32') diff --git a/src/google/protobuf/BUILD.bazel b/src/google/protobuf/BUILD.bazel index ac9b420d5182d..b5e1a5e44cd81 100644 --- a/src/google/protobuf/BUILD.bazel +++ b/src/google/protobuf/BUILD.bazel @@ -1073,16 +1073,6 @@ cc_test( ], ) -# Legacy target: all test sources used to be part of this rule. It is -# still kept around for now. -cc_test( - name = "protobuf_test", - srcs = [], - deps = [ - "@com_google_googletest//:gtest_main", - ], -) - ################################################################################ # Helper targets for Kotlin tests ################################################################################ diff --git a/third_party/googletest b/third_party/googletest index 5ec7f0c4a113e..4c9a3bb62bf3b 160000 --- a/third_party/googletest +++ b/third_party/googletest @@ -1 +1 @@ -Subproject commit 5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081 +Subproject commit 4c9a3bb62bf3ba1f1010bf96f9c8ed767b363774 From 4c5454b86db0aa9e97d06e39d969edf5d9ac7c1f Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Thu, 11 Aug 2022 20:53:29 -0700 Subject: [PATCH 6/6] Fixing php proto generation script to work properly during sync (#10395) --- php/generate_descriptor_protos.sh | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/php/generate_descriptor_protos.sh b/php/generate_descriptor_protos.sh index 2239312ab5d54..1a600abc63925 100755 --- a/php/generate_descriptor_protos.sh +++ b/php/generate_descriptor_protos.sh @@ -5,10 +5,10 @@ set -e -PROTOC=protoc +PROTOC=$(realpath protoc) if [ ! -f $PROTOC ]; then bazel build -c opt //:protoc - PROTOC=bazel-bin/protoc + PROTOC=$(realpath bazel-bin/protoc) fi if test ! -e src/google/protobuf/stubs/common.h; then @@ -19,16 +19,17 @@ __EOF__ exit 1 fi -$PROTOC --php_out=internal:php/src google/protobuf/descriptor.proto -$PROTOC --php_out=internal_generate_c_wkt:php/src \ - src/google/protobuf/any.proto \ - src/google/protobuf/api.proto \ - src/google/protobuf/duration.proto \ - src/google/protobuf/empty.proto \ - src/google/protobuf/field_mask.proto \ - src/google/protobuf/source_context.proto \ - src/google/protobuf/struct.proto \ - src/google/protobuf/type.proto \ - src/google/protobuf/timestamp.proto \ - src/google/protobuf/wrappers.proto +pushd src +$PROTOC --php_out=internal:../php/src google/protobuf/descriptor.proto +$PROTOC --php_out=internal_generate_c_wkt:../php/src \ + google/protobuf/any.proto \ + google/protobuf/api.proto \ + google/protobuf/duration.proto \ + google/protobuf/empty.proto \ + google/protobuf/field_mask.proto \ + google/protobuf/source_context.proto \ + google/protobuf/struct.proto \ + google/protobuf/type.proto \ + google/protobuf/timestamp.proto \ + google/protobuf/wrappers.proto popd