From 8533dab1fdb12cf98e1576b6ff3e1377fe959b11 Mon Sep 17 00:00:00 2001 From: zhangskz <89936743+zhangskz@users.noreply.github.com> Date: Thu, 1 Sep 2022 10:21:07 -0400 Subject: [PATCH 01/20] Update README.md Fix conformance test command for jruby to use conformance_test_jruby target. --- conformance/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/README.md b/conformance/README.md index 2f62f0ff90..8569a6a7b3 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -81,7 +81,7 @@ Ruby: JRuby: $ [[ $(ruby --version) == "jruby"* ]] || echo "Switch to Java Ruby!" - $ bazel test //ruby:conformance_test --define=ruby_platform=java \ + $ bazel test //ruby:conformance_test_jruby --define=ruby_platform=java \ --action_env=PATH --action_env=GEM_PATH --action_env=GEM_HOME Testing other Protocol Buffer implementations From 63e94a4e3390a0fbf193b2be25993e9c50ec2610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ch=C3=A1bek?= Date: Thu, 1 Sep 2022 21:36:37 +0200 Subject: [PATCH 02/20] Move note to the top --- src/google/protobuf/descriptor.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto index 2e19d33262..f264b13abd 100644 --- a/src/google/protobuf/descriptor.proto +++ b/src/google/protobuf/descriptor.proto @@ -502,6 +502,10 @@ message MessageOptions { reserved 4, 5, 6; + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + // // Whether the message is an automatically generated map entry type for the // maps field. // @@ -519,10 +523,6 @@ message MessageOptions { // use a native map in the target language to hold the keys and values. // The reflection APIs in such implementations still need to work as // if the field is a repeated message field. - // - // NOTE: Do not set the option in .proto files. Always use the maps syntax - // instead. The option should only be implicitly set by the proto compiler - // parser. optional bool map_entry = 7; reserved 8; // javalite_serializable From 63cfbc00499dadd317b321b80e16add834afa389 Mon Sep 17 00:00:00 2001 From: Matt Kulukundis Date: Tue, 6 Sep 2022 18:31:43 -0400 Subject: [PATCH 03/20] move portable_strdup into the windows ifdef --- src/google/protobuf/compiler/subprocess.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/google/protobuf/compiler/subprocess.cc b/src/google/protobuf/compiler/subprocess.cc index 6faab05137..4bbd4faded 100644 --- a/src/google/protobuf/compiler/subprocess.cc +++ b/src/google/protobuf/compiler/subprocess.cc @@ -53,16 +53,6 @@ namespace google { namespace protobuf { namespace compiler { -namespace { -char* portable_strdup(const char* s) { - char* ns = (char*)malloc(strlen(s) + 1); - if (ns != nullptr) { - strcpy(ns, s); - } - return ns; -} -} // namespace - #ifdef _WIN32 static void CloseHandleOrDie(HANDLE handle) { @@ -317,6 +307,16 @@ Subprocess::~Subprocess() { } } +namespace { +char* portable_strdup(const char* s) { + char* ns = (char*)malloc(strlen(s) + 1); + if (ns != nullptr) { + strcpy(ns, s); + } + return ns; +} +} // namespace + void Subprocess::Start(const std::string& program, SearchMode search_mode) { // Note that we assume that there are no other threads, thus we don't have to // do crazy stuff like using socket pairs or avoiding libc locks. From a4fd21618635b891fefe34d5e440d6d9464e659f Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 7 Sep 2022 09:38:29 +0100 Subject: [PATCH 04/20] Retain existing array in RepeatedField.Clear Fixes #7828. (Also tweaks the comment for Capacity.) --- .../Collections/RepeatedFieldTest.cs | 12 ++++++++++++ .../src/Google.Protobuf/Collections/RepeatedField.cs | 10 +++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs b/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs index 766b4cb5db..5a8977d611 100644 --- a/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs +++ b/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs @@ -888,5 +888,17 @@ namespace Google.Protobuf.Collections Assert.DoesNotThrow(() => list.Capacity = 0, "Can set Capacity to 0"); Assert.AreEqual(0, list.Capacity); } + + [Test] + public void Clear_CapacityUnaffected() + { + var list = new RepeatedField { 1 }; + Assert.AreEqual(1, list.Count); + Assert.AreEqual(8, list.Capacity); + + list.Clear(); + Assert.AreEqual(0, list.Count); + Assert.AreEqual(8, list.Capacity); + } } } diff --git a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs index 832e166943..56117fd325 100644 --- a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs +++ b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs @@ -279,8 +279,9 @@ namespace Google.Protobuf.Collections } /// - /// Gets and sets the capacity of the RepeatedField's internal array. WHen set, the internal array is reallocated to the given capacity. - /// The new value is less than Count -or- when Count is less than 0. + /// Gets and sets the capacity of the RepeatedField's internal array. + /// When set, the internal array is reallocated to the given capacity. + /// The new value is less than . /// public int Capacity { @@ -338,7 +339,10 @@ namespace Google.Protobuf.Collections /// public void Clear() { - array = EmptyArray; + // Clear the content of the array (so that any objects it referred to can be garbage collected) + // but keep the capacity the same. This allows large repeated fields to be reused without + // array reallocation. + Array.Clear(array, 0, count); count = 0; } From d20e9a92eb9928aeeef841895b082f25659ed23f Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Wed, 7 Sep 2022 11:20:17 -0700 Subject: [PATCH 05/20] Add deprecated python proto alias (#10515) --- protobuf.bzl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/protobuf.bzl b/protobuf.bzl index 46a8493903..8ed2cfa442 100644 --- a/protobuf.bzl +++ b/protobuf.bzl @@ -555,6 +555,21 @@ def internal_py_proto_library( **kargs ) +def py_proto_library( + *args, + **kwargs): + """Deprecated alias for use before Bazel 5.3. + + Args: + *args: the name of the py_proto_library. + **kwargs: other keyword arguments that are passed to py_library. + + Deprecated: + This is provided for backwards compatibility only. Bazel 5.3 will + introduce support for py_proto_library, which should be used instead. + """ + internal_py_proto_library(*args, **kwargs) + def _source_proto_library( name, srcs = [], From 444d25eb1f442a658f21786db9fa213f781e5111 Mon Sep 17 00:00:00 2001 From: deannagarcia <69992229+deannagarcia@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:37:10 -0700 Subject: [PATCH 06/20] Delete performance.md Remove documents on benchmark tests since they are no longer supported --- docs/performance.md | 304 -------------------------------------------- 1 file changed, 304 deletions(-) delete mode 100644 docs/performance.md diff --git a/docs/performance.md b/docs/performance.md deleted file mode 100644 index 245fdf1450..0000000000 --- a/docs/performance.md +++ /dev/null @@ -1,304 +0,0 @@ -# Protobuf Performance -The following benchmark test results were produced on a workstation utilizing an Intel® Xeon® Processor E5-2630 with 32GB of RAM. - -This table contains the results of three separate languages: - -* **C++** - For C++, there are three parsing methods: - * **new** - This is for using a new operator for creating a message instance. - * **new arena** - This is for using arena for creating a new message instance. - * **reuse** - This is for reusing the same message instance for parsing. -* **Java** - For Java, there are three parsing/serialization methods: - * **byte[]** - This is for parsing from a Byte Array. - * **ByteString** - This is for parsing from a - com.google.protobuf.ByteString. - * **InputStream** - This is for parsing from an InputStream. -* **Python** - For Python, there are three types of Python protobuf for testing: - * **C++-generated-code** - This is for using C++ generated code of the - proto file as a dynamic linked library. - * **C++-reflection** - This is for using C++ reflection, for which there's no - generated code, but still using C++ protobuf library as a dynamic linked - library. - * **pure-Python** - This is for the pure version of Python, which does not link with - any C++ protobuf library. - -## Parsing performance - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
C++C++ with tcmallocjavapython
newnew arenareusenewnew arenareusebyte[]ByteStringInputStreamC++-generated-codeC++-reflectionpure-Python
google_message1_proto2368.717MB/s261.847MB/s799.403MB/s645.183MB/s441.023MB/s1.122GB/s425.437MB/s425.937MB/s251.018MB/s82.8314MB/s47.6763MB/s3.76299MB/s
google_message1_proto3294.517MB/s229.116MB/s469.982MB/s434.510MB/s394.701MB/s591.931MB/s357.597MB/s378.568MB/s221.676MB/s82.0498MB/s39.9467MB/s3.77751MB/s
google_message2277.242MB/s347.611MB/s793.67MB/s503.721MB/s596.333MB/s922.533MB/s416.778MB/s419.543MB/s367.145MB/s241.46MB/s71.5723MB/s2.73538MB/s
google_message3_1213.478MB/s291.58MB/s543.398MB/s539.704MB/s717.300MB/s927.333MB/s684.241MB/s704.47MB/s648.624MB/s209.036MB/s142.356MB/s15.3324MB/s
google_message3_2672.685MB/s802.767MB/s1.21505GB/s985.790MB/s1.136GB/s1.367GB/s1.54439GB/s1.60603GB/s1.33443GB/s573.835MB/s314.33MB/s15.0169MB/s
google_message3_3207.681MB/s140.591MB/s535.181MB/s369.743MB/s262.301MB/s556.644MB/s279.385MB/s304.853MB/s107.575MB/s32.248MB/s26.1431MB/s2.63541MB/s
google_message3_47.96091GB/s7.10024GB/s9.3013GB/s8.518GB/s8.171GB/s9.917GB/s5.78006GB/s5.85198GB/s4.62609GB/s2.49631GB/s2.35442GB/s802.061MB/s
google_message3_576.0072MB/s51.6769MB/s237.856MB/s178.495MB/s111.751MB/s329.569MB/s121.038MB/s132.866MB/s36.9197MB/s10.3962MB/s8.84659MB/s1.25203MB/s
google_message4331.46MB/s404.862MB/s427.99MB/s589.887MB/s720.367MB/s705.373MB/s606.228MB/s589.13MB/s530.692MB/s305.543MB/s174.834MB/s7.86485MB/s
- -## Serialization performance - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
C++C++ with tcmallocjavapython
byte[]ByteStringInputStreamC++-generated-codeC++-reflectionpure-Python
google_message1_proto21.39698GB/s1.701GB/s1.12915GB/s1.13589GB/s758.609MB/s260.911MB/s58.4815MB/s5.77824MB/s
google_message1_proto3959.305MB/s939.404MB/s1.15372GB/s1.07824GB/s802.337MB/s239.4MB/s33.6336MB/s5.80524MB/s
google_message21.27429GB/s1.402GB/s1.01039GB/s1022.99MB/s798.736MB/s996.755MB/s57.9601MB/s4.09246MB/s
google_message3_11.31916GB/s2.049GB/s991.496MB/s860.332MB/s662.88MB/s1.48625GB/s421.287MB/s18.002MB/s
google_message3_22.15676GB/s2.632GB/s2.14736GB/s2.08136GB/s1.55997GB/s2.39597GB/s326.777MB/s16.0527MB/s
google_message3_3650.456MB/s1.040GB/s593.52MB/s580.667MB/s346.839MB/s123.978MB/s35.893MB/s2.32834MB/s
google_message3_48.70154GB/s9.825GB/s5.88645GB/s5.93946GB/s2.44388GB/s5.9241GB/s4.05837GB/s876.87MB/s
google_message3_5246.33MB/s443.993MB/s283.278MB/s259.167MB/s206.37MB/s37.0285MB/s12.2228MB/s1.1979MB/s
google_message41.56674GB/s2.19601GB/s776.907MB/s770.707MB/s702.931MB/s1.49623GB/s205.116MB/s8.93428MB/s
- -\* The cpp performance can be improved by using [tcmalloc](https://gperftools.github.io/gperftools/tcmalloc.html), please follow the (instruction)[https://github.com/protocolbuffers/protobuf/blob/main/benchmarks/README.md] to link with tcmalloc to get the faster result. From 4efbcc44605731dc31507b94f0b81d2bd5ec169b Mon Sep 17 00:00:00 2001 From: Christian Blichmann Date: Thu, 8 Sep 2022 01:59:32 +0200 Subject: [PATCH 07/20] CMake: Enable projects to set the C++ version (#10464) This change enables projects that consume protobuf via `FetchContent_MakeAvailable()` to set the C++ version to be used. This is necessary, as linking code compiled for different C++ standards is asking for trouble (and will simply not work in some cases). Check that any version that might be set in `CMAKE_CXX_STANDARD` is new enough (C++14 or later). On Cygwin, check if any `-std=gnu++XX` has already been set. In all cases, default to C++14. --- CMakeLists.txt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f9b7517f3..76e2c4e96a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,11 +32,23 @@ if(protobuf_DEPRECATED_CMAKE_SUBDIRECTORY_USAGE) get_filename_component(protobuf_SOURCE_DIR ${protobuf_SOURCE_DIR} DIRECTORY) endif() -# Add c++14 flags -if (CYGWIN) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14") -else() +# Add C++14 flags +if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 14) +endif() +if(CYGWIN) + string(REGEX_MATCH "-std=gnu\\+\\+([0-9]+)" _protobuf_CXX_STD "${CMAKE_CXX_FLAGS}") +endif() +if(NOT _protobuf_CXX_STD) + set(_protobuf_CXX_STD "${CMAKE_CXX_STANDARD}") +endif() +if(_protobuf_CXX_STD LESS "14") + message(FATAL_ERROR "Protocol Buffers requires at least C++14, but is configured for C++${_protobuf_CXX_STD}") +endif() +if(CYGWIN) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++${_protobuf_CXX_STD}") +else() + set(CMAKE_CXX_STANDARD ${_protobuf_CXX_STD}) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) endif() From 80868f14d09f45b2fdf9b63c9a8b726759a5f01c Mon Sep 17 00:00:00 2001 From: Alexander Reynolds Date: Thu, 8 Sep 2022 01:21:48 -0700 Subject: [PATCH 08/20] Update docs for MessageToJson indent parameter See https://github.com/protocolbuffers/protobuf/issues/10518 --- python/google/protobuf/json_format.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/google/protobuf/json_format.py b/python/google/protobuf/json_format.py index 5024ed89d7..f35a432126 100644 --- a/python/google/protobuf/json_format.py +++ b/python/google/protobuf/json_format.py @@ -109,7 +109,8 @@ def MessageToJson( names as defined in the .proto file. If False, convert the field names to lowerCamelCase. indent: The JSON object will be pretty-printed with this indent level. - An indent level of 0 or negative will only insert newlines. + An indent level of 0 or negative will only insert newlines. If the + indent level is None, no newlines will be inserted. sort_keys: If True, then the output will be sorted by field names. use_integers_for_enums: If true, print integers instead of enum names. descriptor_pool: A Descriptor Pool for resolving types. If None use the From 687fbffd9bcbc6e59c86ba0f5d319b10d68a93c4 Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Fri, 9 Sep 2022 08:16:46 -0700 Subject: [PATCH 09/20] Fixing mac php tests (#10523) * Manually run brew cleanup and initialize php * Add debug loggin for visibility * Allow underscores in php folder name * Add logging to php tests * Add tracing * Only use the latest installation of php --- kokoro/macos/php74/build.sh | 3 ++- kokoro/macos/php80/build.sh | 3 ++- php/tests/compile_extension.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/kokoro/macos/php74/build.sh b/kokoro/macos/php74/build.sh index 2b50a0a6ee..2ad4eab598 100755 --- a/kokoro/macos/php74/build.sh +++ b/kokoro/macos/php74/build.sh @@ -9,10 +9,11 @@ cd $(dirname $0)/../../.. source kokoro/macos/prepare_build_macos_rc # Install Dependencies +brew cleanup brew install coreutils php@7.4 # Configure path -PHP_FOLDER=$(find $HOMEBREW_PREFIX -type d -regex ".*php.*/7.4.[0-9]*") +PHP_FOLDER=$(find $HOMEBREW_PREFIX -type d -regex ".*php.*/7.4.[0-9_.]*" | sort -n | tail -n 1) test ! -z "$PHP_FOLDER" export PATH="$PHP_FOLDER/bin:$PATH" diff --git a/kokoro/macos/php80/build.sh b/kokoro/macos/php80/build.sh index 4051822e97..e703ffc18f 100755 --- a/kokoro/macos/php80/build.sh +++ b/kokoro/macos/php80/build.sh @@ -9,10 +9,11 @@ cd $(dirname $0)/../../.. source kokoro/macos/prepare_build_macos_rc # Install Dependencies +brew cleanup brew install coreutils php@8.0 # Configure path -PHP_FOLDER=$(find $HOMEBREW_PREFIX -type d -regex ".*php.*/8.0.[0-9]*") +PHP_FOLDER=$(find $HOMEBREW_PREFIX -type d -regex ".*php.*/8.0.[0-9_.]*" | sort -n | tail -n 1) test ! -z "$PHP_FOLDER" export PATH="$PHP_FOLDER/bin:$PATH" diff --git a/php/tests/compile_extension.sh b/php/tests/compile_extension.sh index 326191738f..dc42aa32ee 100755 --- a/php/tests/compile_extension.sh +++ b/php/tests/compile_extension.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -ex cd $(dirname $0)/.. From 5036705c8d1c35e3e4b13b0d8633a3d228683581 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 8 Sep 2022 10:02:08 +0100 Subject: [PATCH 10/20] Apply Obsolete attribute to deprecated enums and enum values in C# generated code Fixes #10513 --- csharp/protos/unittest_issues.proto | 4 +- .../UnittestIssues.cs | 78 +++++++++--------- .../DeprecatedMemberTest.cs | 21 ++++- csharp/src/Google.Protobuf.Test/testprotos.pb | Bin 346547 -> 346639 bytes .../protobuf/compiler/csharp/csharp_enum.cc | 6 ++ 5 files changed, 67 insertions(+), 42 deletions(-) diff --git a/csharp/protos/unittest_issues.proto b/csharp/protos/unittest_issues.proto index 45df7a19a0..d5907bb642 100644 --- a/csharp/protos/unittest_issues.proto +++ b/csharp/protos/unittest_issues.proto @@ -59,10 +59,12 @@ message NegativeEnumMessage { // Decorate fields with [deprecated=true] as [System.Obsolete] message DeprecatedChild { + option deprecated = true; } enum DeprecatedEnum { - DEPRECATED_ZERO = 0; + option deprecated = true; + DEPRECATED_ZERO = 0 [deprecated = true]; one = 1; } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs index d65a65662f..3278517d33 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs @@ -30,43 +30,44 @@ namespace UnitTest.Issues.TestProtos { "EiwKBXZhbHVlGAEgASgOMh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51", "bRIxCgZ2YWx1ZXMYAiADKA4yHS51bml0dGVzdF9pc3N1ZXMuTmVnYXRpdmVF", "bnVtQgIQABI4Cg1wYWNrZWRfdmFsdWVzGAMgAygOMh0udW5pdHRlc3RfaXNz", - "dWVzLk5lZ2F0aXZlRW51bUICEAEiEQoPRGVwcmVjYXRlZENoaWxkIrkCChdE", - "ZXByZWNhdGVkRmllbGRzTWVzc2FnZRIaCg5QcmltaXRpdmVWYWx1ZRgBIAEo", - "BUICGAESGgoOUHJpbWl0aXZlQXJyYXkYAiADKAVCAhgBEjoKDE1lc3NhZ2VW", - "YWx1ZRgDIAEoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRC", - "AhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5E", - "ZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1WYWx1ZRgFIAEoDjIfLnVuaXR0", - "ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAESNgoJRW51bUFycmF5GAYg", - "AygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJlY2F0ZWRFbnVtQgIYASIZCglJ", - "dGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNlcnZlZE5hbWVzEg0KBXR5", - "cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUaEAoOU29tZU5lc3RlZFR5", - "cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxITCgtwbGFpbl9pbnQzMhgE", - "IAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghvMV9pbnQzMhgFIAEoBUgA", - "EhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9pbnQzMhgGIAEoBUgBEhMK", - "CW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8yIksKDFRlc3RKc29uTmFt", - "ZRIMCgRuYW1lGAEgASgJEhkKC2Rlc2NyaXB0aW9uGAIgASgJUgRkZXNjEhIK", - "BGd1aWQYAyABKAlSBGV4aWQifwoMT25lb2ZNZXJnaW5nEg4KBHRleHQYASAB", - "KAlIABI2CgZuZXN0ZWQYAiABKAsyJC51bml0dGVzdF9pc3N1ZXMuT25lb2ZN", - "ZXJnaW5nLk5lc3RlZEgAGh4KBk5lc3RlZBIJCgF4GAEgASgFEgkKAXkYAiAB", - "KAVCBwoFdmFsdWUiawoWTnVsbFZhbHVlT3V0c2lkZVN0cnVjdBIWCgxzdHJp", - "bmdfdmFsdWUYASABKAlIABIwCgpudWxsX3ZhbHVlGAIgASgOMhouZ29vZ2xl", - "LnByb3RvYnVmLk51bGxWYWx1ZUgAQgcKBXZhbHVlIkUKE051bGxWYWx1ZU5v", - "dEluT25lb2YSLgoKbnVsbF92YWx1ZRgCIAEoDjIaLmdvb2dsZS5wcm90b2J1", - "Zi5OdWxsVmFsdWUiYAoXTWl4ZWRSZWd1bGFyQW5kT3B0aW9uYWwSFQoNcmVn", - "dWxhcl9maWVsZBgBIAEoCRIbCg5vcHRpb25hbF9maWVsZBgCIAEoCUgAiAEB", - "QhEKD19vcHRpb25hbF9maWVsZCI5ChJPbmVvZldpdGhOb25lRmllbGQSCwoB", - "eBgBIAEoCUgAEg4KBG5vbmUYAiABKAlIAEIGCgR0ZXN0IjUKEU9uZW9mV2l0", - "aE5vbmVOYW1lEgsKAXgYASABKAlIABILCgF5GAIgASgJSABCBgoEbm9uZSKT", - "AgoZRGlzYW1iaWd1YXRlQ29tbW9uTWVtYmVycxIjChtkaXNhbWJpZ3VhdGVf", - "Y29tbW9uX21lbWJlcnMYASABKAUSDQoFdHlwZXMYAiABKAUSEgoKZGVzY3Jp", - "cHRvchgDIAEoBRIOCgZlcXVhbHMYBCABKAUSEQoJdG9fc3RyaW5nGAUgASgF", - "EhUKDWdldF9oYXNoX2NvZGUYBiABKAUSEAoId3JpdGVfdG8YByABKAUSDQoF", - "Y2xvbmUYCCABKAUSFgoOY2FsY3VsYXRlX3NpemUYCSABKAUSEgoKbWVyZ2Vf", - "ZnJvbRgKIAEoBRIXCg9vbl9jb25zdHJ1Y3Rpb24YCyABKAUSDgoGcGFyc2Vy", - "GAwgASgFKlUKDE5lZ2F0aXZlRW51bRIWChJORUdBVElWRV9FTlVNX1pFUk8Q", - "ABIWCglGaXZlQmVsb3cQ+///////////ARIVCghNaW51c09uZRD/////////", - "//8BKi4KDkRlcHJlY2F0ZWRFbnVtEhMKD0RFUFJFQ0FURURfWkVSTxAAEgcK", - "A29uZRABQh2qAhpVbml0VGVzdC5Jc3N1ZXMuVGVzdFByb3Rvc2IGcHJvdG8z")); + "dWVzLk5lZ2F0aXZlRW51bUICEAEiFQoPRGVwcmVjYXRlZENoaWxkOgIYASK5", + "AgoXRGVwcmVjYXRlZEZpZWxkc01lc3NhZ2USGgoOUHJpbWl0aXZlVmFsdWUY", + "ASABKAVCAhgBEhoKDlByaW1pdGl2ZUFycmF5GAIgAygFQgIYARI6CgxNZXNz", + "YWdlVmFsdWUYAyABKAsyIC51bml0dGVzdF9pc3N1ZXMuRGVwcmVjYXRlZENo", + "aWxkQgIYARI6CgxNZXNzYWdlQXJyYXkYBCADKAsyIC51bml0dGVzdF9pc3N1", + "ZXMuRGVwcmVjYXRlZENoaWxkQgIYARI2CglFbnVtVmFsdWUYBSABKA4yHy51", + "bml0dGVzdF9pc3N1ZXMuRGVwcmVjYXRlZEVudW1CAhgBEjYKCUVudW1BcnJh", + "eRgGIAMoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAEi", + "GQoJSXRlbUZpZWxkEgwKBGl0ZW0YASABKAUiRAoNUmVzZXJ2ZWROYW1lcxIN", + "CgV0eXBlcxgBIAEoBRISCgpkZXNjcmlwdG9yGAIgASgFGhAKDlNvbWVOZXN0", + "ZWRUeXBlIqABChVUZXN0SnNvbkZpZWxkT3JkZXJpbmcSEwoLcGxhaW5faW50", + "MzIYBCABKAUSEwoJbzFfc3RyaW5nGAIgASgJSAASEgoIbzFfaW50MzIYBSAB", + "KAVIABIUCgxwbGFpbl9zdHJpbmcYASABKAkSEgoIbzJfaW50MzIYBiABKAVI", + "ARITCglvMl9zdHJpbmcYAyABKAlIAUIECgJvMUIECgJvMiJLCgxUZXN0SnNv", + "bk5hbWUSDAoEbmFtZRgBIAEoCRIZCgtkZXNjcmlwdGlvbhgCIAEoCVIEZGVz", + "YxISCgRndWlkGAMgASgJUgRleGlkIn8KDE9uZW9mTWVyZ2luZxIOCgR0ZXh0", + "GAEgASgJSAASNgoGbmVzdGVkGAIgASgLMiQudW5pdHRlc3RfaXNzdWVzLk9u", + "ZW9mTWVyZ2luZy5OZXN0ZWRIABoeCgZOZXN0ZWQSCQoBeBgBIAEoBRIJCgF5", + "GAIgASgFQgcKBXZhbHVlImsKFk51bGxWYWx1ZU91dHNpZGVTdHJ1Y3QSFgoM", + "c3RyaW5nX3ZhbHVlGAEgASgJSAASMAoKbnVsbF92YWx1ZRgCIAEoDjIaLmdv", + "b2dsZS5wcm90b2J1Zi5OdWxsVmFsdWVIAEIHCgV2YWx1ZSJFChNOdWxsVmFs", + "dWVOb3RJbk9uZW9mEi4KCm51bGxfdmFsdWUYAiABKA4yGi5nb29nbGUucHJv", + "dG9idWYuTnVsbFZhbHVlImAKF01peGVkUmVndWxhckFuZE9wdGlvbmFsEhUK", + "DXJlZ3VsYXJfZmllbGQYASABKAkSGwoOb3B0aW9uYWxfZmllbGQYAiABKAlI", + "AIgBAUIRCg9fb3B0aW9uYWxfZmllbGQiOQoST25lb2ZXaXRoTm9uZUZpZWxk", + "EgsKAXgYASABKAlIABIOCgRub25lGAIgASgJSABCBgoEdGVzdCI1ChFPbmVv", + "ZldpdGhOb25lTmFtZRILCgF4GAEgASgJSAASCwoBeRgCIAEoCUgAQgYKBG5v", + "bmUikwIKGURpc2FtYmlndWF0ZUNvbW1vbk1lbWJlcnMSIwobZGlzYW1iaWd1", + "YXRlX2NvbW1vbl9tZW1iZXJzGAEgASgFEg0KBXR5cGVzGAIgASgFEhIKCmRl", + "c2NyaXB0b3IYAyABKAUSDgoGZXF1YWxzGAQgASgFEhEKCXRvX3N0cmluZxgF", + "IAEoBRIVCg1nZXRfaGFzaF9jb2RlGAYgASgFEhAKCHdyaXRlX3RvGAcgASgF", + "Eg0KBWNsb25lGAggASgFEhYKDmNhbGN1bGF0ZV9zaXplGAkgASgFEhIKCm1l", + "cmdlX2Zyb20YCiABKAUSFwoPb25fY29uc3RydWN0aW9uGAsgASgFEg4KBnBh", + "cnNlchgMIAEoBSpVCgxOZWdhdGl2ZUVudW0SFgoSTkVHQVRJVkVfRU5VTV9a", + "RVJPEAASFgoJRml2ZUJlbG93EPv//////////wESFQoITWludXNPbmUQ////", + "////////ASo2Cg5EZXByZWNhdGVkRW51bRIXCg9ERVBSRUNBVEVEX1pFUk8Q", + "ABoCCAESBwoDb25lEAEaAhgBQh2qAhpVbml0VGVzdC5Jc3N1ZXMuVGVzdFBy", + "b3Rvc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -97,7 +98,9 @@ namespace UnitTest.Issues.TestProtos { [pbr::OriginalName("MinusOne")] MinusOne = -1, } + [global::System.ObsoleteAttribute] public enum DeprecatedEnum { + [global::System.ObsoleteAttribute] [pbr::OriginalName("DEPRECATED_ZERO")] DeprecatedZero = 0, [pbr::OriginalName("one")] One = 1, } @@ -826,6 +829,7 @@ namespace UnitTest.Issues.TestProtos { } + [global::System.ObsoleteAttribute] public sealed partial class DeprecatedChild : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage diff --git a/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs b/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs index f291b1eeee..6d31441e04 100644 --- a/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs +++ b/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs @@ -34,7 +34,9 @@ using System; using System.Reflection; using Google.Protobuf.TestProtos; using NUnit.Framework; +using UnitTest.Issues.TestProtos; +#pragma warning disable CS0612 // Type or member is obsolete namespace Google.Protobuf { public class DeprecatedMemberTest @@ -46,9 +48,20 @@ namespace Google.Protobuf } [Test] - public void TestDepreatedPrimitiveValue() - { - AssertIsDeprecated(typeof(TestDeprecatedFields).GetProperty("DeprecatedInt32")); - } + public void TestDepreatedPrimitiveValue() => + AssertIsDeprecated(typeof(TestDeprecatedFields).GetProperty(nameof(TestDeprecatedFields.DeprecatedInt32))); + + [Test] + public void TestDeprecatedMessage() => + AssertIsDeprecated(typeof(DeprecatedChild)); + + [Test] + public void TestDeprecatedEnum() => + AssertIsDeprecated(typeof(DeprecatedEnum)); + + [Test] + public void TestDeprecatedEnumValue() => + AssertIsDeprecated(typeof(DeprecatedEnum).GetField(nameof(DeprecatedEnum.DeprecatedZero))); } } +#pragma warning restore CS0612 // Type or member is obsolete diff --git a/csharp/src/Google.Protobuf.Test/testprotos.pb b/csharp/src/Google.Protobuf.Test/testprotos.pb index bdfe1cce5a5d996252548abe5d1b636be71a6c25..ae89679da6e66985e6955eb8d3fe26b7cb71d2f5 100644 GIT binary patch delta 3678 zcmYk9+iz4=6vofmXPq-=_H?H0>4kQ<6_Bd5V!aCyLR$*8wbf8#Kx&B5CK{wQm12z2 zV`88vpwU5Njm2=$AfN#%AQvwW`eH(2{1^1WN2C9M-`bZc4Zq(*Dt}*Ik^gV4&ZSWh{4k$h`8}eI zl|OIHWg)9v8gAgFx}X{V4=re|B1(Bvu$i>hVMLUMo1zB$f8=yqK}6y0pn^2);Z9wn zqli=hO%FGCQlREVo*?UK>CjnG$C4UKZtEH`0R;4NjZ2l*y`1xeGQCKHK@L;i5f`NO0M`t|)~4yxwIJ z3mK2dB(&%+ramT_4J$mMNdFzHJ)uK?`#RTwGHKC&=cBF#1~1E+Ov*rG zn~y;@u<8y^C_1qEQCCz+&4KnuTus0r_qfauwg;=W!#D#L{pe*52bbRMQ$^T$k0-Pk zT-)thgwkU0-c7CriVpEZE|XzLXqLS{2(IO9$vG-b%>*tIRGH(gnF&WNfvl>zWDqRiIA*^vD_lGr5&q0~rio!N*{%FhJP*^P)}6F!qP z=`I|nC=62Gu69)Z`l&11j!h?LERr5Om7O2}dhB#PKv3^Yil#pZJ$BYvYmsb#QDqJg zYRHZot;*z#j3&M$K{nddtp5!$%sAy;!5g%4zVh=wla(DCr?$a$WETBT0!Ez>c}HQe&n(r_7xhfl};twbDtTxV%)}W z25*zyH#y|JnKbGFj4datv%k{u%M;mtHzxdqg#CHDH9)Ad-))VY%+j=4YkC0Cf4VA@ z@lEG#f5af0Mtiv#K{y@Lt@en6G^lKDZ;1)DXPsuUbFxO6y3^@ojk0P7>7G@M$+BcH zW;-Z!$kKLCsF^j`lZui;%UA1J!ZuCP_y7eT5S8Dfw#Q$4ZECFTf&06R{UUUz$Feze3;bx-lZH9K1}9VBP`UVUdrbYlX^kJ2U6S@G;_h zTu=-HmwGhOWp{am^cZ!>7F4X$_)`i#Bg%|pjnq#mv1PS5nkCg?gdmg!F7}ArSz6NW z5oKrT?lq=tA&oz$;0reo1!R6s_-+uh1*tmc%YZOWV3wFVU?k5`-cCLcW#_0>ZXnSj zc%0N~my7QMK|4nXqSSG}GC-4@w)tdKI!@*}S6q|ECn)&J8LT0!{|QRUW~FLmrB0Ii z(ybI2l}?g*m6&T}0H=uU1^}Te(3$`u_Y@UsOjjVfo+3P9;=e}xpZ2>F1SwFYStL;t zcH0sN?Psjx(D2~r9XvHzmYsK(6KUm~KdQPNeY^_onU!dTJ%Fu7E*#%1EOO3fCUM`Zd zn-PS1z?_*aAnIMDWR*wMyGZSFBZ?HkON2LFZY2<;Kra<5m*h0LD5RIjT#?LK30Eu6 z6CQRO#oa3CwNiN=_q2~fJ5P9bY+KNGq#9fhZ=j%;;&Tp|lzh}A*UMWfj*f5-scB$x0E@il+2L68DP zip>p%_8KMjU<0AO<_~sB+_*Amv$wLeDZRH}pzOX)dNUu|qe9VYro$?J*_O=5- z3iMLB(QXV-;#XcndxOgItt{F?$~Q^bR{{hr&}-%1y1B5n1xRnc({XF2;}+qc!oTop J$1Ohe*8hRZL52VT delta 3578 zcmYk9*>6=<6vofmXP=>^{w^oebzqv^whbE z+3AXzpYDnOI%Z$o>!7$ym24XrIXLji$72I~-}!WKXzy(0{X3~btI99@zJ33p;kYpU z$6O&Dr<8wS|3E37|8s}mn7-MnQgPsU&u8l&{~pk$>A#;}Nkl-g-0W>7rIa5K#s21? zpfXAZB)r(~kc(7S1q=vv$busQs;sh!2yKyB8{!&UWXcf|w;)X^A^lix^WM{)q>rp^ zQA5HNq|dFk%k`{b2$<52khxuH8yxdNi)&ph0@bytoC-M>aj<@!tqEPHe9LB%WYQjy zN$Aj-i&Zw!4cT&MVTnscmCof&j?kjBd4p|1+@f}qO9&4hgmF51=nrY#ESmRoJA58vHI-#%J&=iKUf54-DDxlGorS?dTb zx?8tc+dg;bUe{qepk|MJgEJGfmnhmJu^DtmH+EcbYy(bCz!Ui?GJo~TZn2-(D-FsA^3YJ;{K z2-OB7Gk73W8^qDf!h0BDLHophU%LPyb6=!vNx+b-HX(f^hNN=Du}pd55H*LY%zlId zQ$H-t!T_)`Y!534x?yD&27+uD3*&7J8Ae2nt>{BGA|gkSjif6aapod6mhckrf;uP; zxh3${9V{*ZV>Vi}B2ja+XoUxPv}lC~d9-K+iDSi;2b$coZnxm zSRVF1H)E4R+To~Ny^E!#_~DFCPyO1PjN2vQCnSug&18Vke%ww*iZ^LOwCWZBw4W%- zczF|P(;hL%CeWRaCJ1L^qS~BrkOI}LaWSUm18ekNr}z;~iWN4-k7%;kfxAx@jqy{N zgfY`Wpu=R`>>+-5r3SVUKj<28i8B!%C-IeY$)`ddCw+<$W{)RGmYXH;QDamNk$ZwNB@X>K0mpp! zSc~XMl9e_}ILtt&WnU*LQ|6*@b&|??>V-_l;VJUY5!?1<8kwgks@L0^X2YjROk2ZX zgikxeNtzv>Az7>Ig5Vfvx&o1WhB8$yimqpS+B+hmfA7 z79KevRUCdp-UTAQ!hNZb`VB>jV>9LE|b2!h0Mm`Rr0>G2D60cf0d#d{iL$|q^^;;X`d7rm9CM#grv;! z0_5x?Z@8%hK?-DP5^z+9?N|b#yarcvz|1xK&R!m>yw4&lZNyORhTcPJgzzUl!SQ& zf*=JtDZl2PQe>VyqL6NUN;Uks%&X1B@)-$pb%3A+IxWAb N`19wdUdk^g{s$QFH|GEV diff --git a/src/google/protobuf/compiler/csharp/csharp_enum.cc b/src/google/protobuf/compiler/csharp/csharp_enum.cc index 23f44a4c93..8ee38bcd1e 100644 --- a/src/google/protobuf/compiler/csharp/csharp_enum.cc +++ b/src/google/protobuf/compiler/csharp/csharp_enum.cc @@ -61,6 +61,9 @@ EnumGenerator::~EnumGenerator() { void EnumGenerator::Generate(io::Printer* printer) { WriteEnumDocComment(printer, descriptor_); + if (descriptor_->options().deprecated()) { + printer->Print("[global::System.ObsoleteAttribute]\n"); + } printer->Print("$access_level$ enum $name$ {\n", "access_level", class_access_level(), "name", descriptor_->name()); @@ -69,6 +72,9 @@ void EnumGenerator::Generate(io::Printer* printer) { std::set used_number; for (int i = 0; i < descriptor_->value_count(); i++) { WriteEnumValueDocComment(printer, descriptor_->value(i)); + if (descriptor_->value(i)->options().deprecated()) { + printer->Print("[global::System.ObsoleteAttribute]\n"); + } std::string original_name = descriptor_->value(i)->name(); std::string name = GetEnumValueName(descriptor_->name(), descriptor_->value(i)->name()); From 87f8593fb879f753105ec5638b31717a11179a33 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Fri, 9 Sep 2022 10:44:18 -0700 Subject: [PATCH 11/20] Updating changelog --- CHANGES.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index cd2fbcc42f..929ff134ee 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -12,6 +12,13 @@ * Use table-driven parser for reflection based objects. * Update Map's InternalSwap() to take a pointer to the other Map. * Add ARM-optimized Varint decoding functions. + * Minor optimization for parsing groups + * Declare ReflectiveProtoHook class + * Reduce size of VarintParse code in protocol buffers, by calling the shared routine after handling just one-byte varint encoding inline, rather than handling one-byte and two-byte varints inline. + * Avoid inlining some large heavily duplicated routines in repeated_ptr_field.h + * Add ReflectiveProtoHook to Reflection. + * Turns on table-driven parser for reflection based objects. + Kotlin * Suppress deprecation warnings in Kotlin generated code. From 78b1dc169c16477fc98ec36813584050603b14f9 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Fri, 9 Sep 2022 10:59:39 -0700 Subject: [PATCH 12/20] Spelling fixes --- src/google/protobuf/compiler/cpp/generator.cc | 6 ++---- src/google/protobuf/io/printer.cc | 4 ++-- src/google/protobuf/io/printer.h | 8 ++++---- src/google/protobuf/parse_context.cc | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/google/protobuf/compiler/cpp/generator.cc b/src/google/protobuf/compiler/cpp/generator.cc index 578d0d6969..3c25ec84d1 100644 --- a/src/google/protobuf/compiler/cpp/generator.cc +++ b/src/google/protobuf/compiler/cpp/generator.cc @@ -83,11 +83,9 @@ absl::flat_hash_map CommonVars( : "GOOGLE3_PROTOBU" "F"}, {"CHK", is_oss ? "GOOGLE_CHECK" - : "CHEC" - "K"}, + : "CHECK"}, {"DCHK", is_oss ? "GOOGLE_DCHECK" - : "DCHEC" - "K"}, + : "DCHECK"}, }; } } // namespace diff --git a/src/google/protobuf/io/printer.cc b/src/google/protobuf/io/printer.cc index f357b766be..0b8e053ea2 100644 --- a/src/google/protobuf/io/printer.cc +++ b/src/google/protobuf/io/printer.cc @@ -320,8 +320,8 @@ bool Printer::ValidateIndexLookupInBounds(size_t index, void Printer::PrintImpl(absl::string_view format, absl::Span args, PrintOptions opts) { - // Inside of this function, we set intentation as we print new lines from the - // format string. No matter how we exit this functon, we should fix up the + // Inside of this function, we set indentation as we print new lines from the + // format string. No matter how we exit this function, we should fix up the // indent to what it was before we entered; a cleanup makes it easy to avoid // this mistake. size_t original_indent = indent_; diff --git a/src/google/protobuf/io/printer.h b/src/google/protobuf/io/printer.h index 844eed2a83..b2d6d05e4f 100644 --- a/src/google/protobuf/io/printer.h +++ b/src/google/protobuf/io/printer.h @@ -220,7 +220,7 @@ class AnnotationProtoCollector : public AnnotationCollector { // pointer (which will cause the Printer to store a pointer, potentially // avoiding a copy.) // -// p.Emit(vars, "..."); is effecitvely syntax sugar for +// p.Emit(vars, "..."); is effectively syntax sugar for // // { auto v = p.WithVars(vars); p.Emit("..."); } // @@ -230,7 +230,7 @@ class AnnotationProtoCollector : public AnnotationCollector { // # Annotations // // If Printer is given an AnnotationCollector, it will use it to record which -// spans of genreated code correspond to user-indicated descriptors. There are +// spans of generated code correspond to user-indicated descriptors. There are // a few different ways of indicating when to emit annotations. // // The WithAnnotations() function is like WithVars(), but accepts maps with @@ -428,7 +428,7 @@ class PROTOBUF_EXPORT Printer { size_t spaces_per_indent = 2; // Whether to emit a "codegen trace" for calls to Emit(). If true, each call // to Emit() will print a comment indicating where in the source of the - // compiler the Emit() call occured. + // compiler the Emit() call occurred. // // If disengaged, defaults to whether or not the environment variable // `PROTOC_CODEGEN_TRACE` is set. @@ -689,7 +689,7 @@ class PROTOBUF_EXPORT Printer { // If set, leading whitespace will be stripped from the format string to // determine the "extraneous indentation" that is produced when the format // string is a C++ raw string. This is used to remove leading spaces from - // a raw string that would otherwise result in eratic indentation in the + // a raw string that would otherwise result in erratic indentation in the // output. bool strip_raw_string_indentation = false; // If set, the annotation lookup frames are searched, per the annotation diff --git a/src/google/protobuf/parse_context.cc b/src/google/protobuf/parse_context.cc index 29f53e278b..afbc1ee38b 100644 --- a/src/google/protobuf/parse_context.cc +++ b/src/google/protobuf/parse_context.cc @@ -581,7 +581,7 @@ const char* UnknownFieldParse(uint32_t tag, std::string* unknown, // // 2) Calculate the index of the cleared continuation bit in order to determine // where the encoded Varint ends and the size of the decoded value. The -// easist way to do this is mask off all data bits, leaving just the +// easiest way to do this is mask off all data bits, leaving just the // continuation bits. We actually need to do the masking on an inverted // copy of the data, which leaves a 1 in all continuation bits which were // originally clear. The number of trailing zeroes in this value indicates From 081901beab702acf0cae0c8eec8dd1ae679c12c1 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Fri, 9 Sep 2022 13:03:37 -0700 Subject: [PATCH 13/20] Bump upb version to head --- protobuf_deps.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index e276c88884..427f29fb60 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -115,6 +115,6 @@ def protobuf_deps(): _github_archive( name = "upb", repo = "https://github.com/protocolbuffers/upb", - commit = "470f06cccbf26f98dd2df7ddecf24a78f140fe11", - sha256 = "c3137f3da811142d33d2ad278d093152610d3a773b17839d272bca4b1a6e304b", + commit = "5485645125ba3783ae2b597bd7b77679721cb1c6", + sha256 = "86de85c58eb3cb04b0987a7642ce84e55629f704ab4a9a0210a660a1115f1dd0", ) From 39ab3f9684211ac3909a6cf0a992b28721d8df85 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Fri, 9 Sep 2022 12:08:23 -0700 Subject: [PATCH 14/20] Fix breakages from sync --- CHANGES.txt | 4 +- python/google/protobuf/pyext/map_container.cc | 1 - python/google/protobuf/pyext/message.cc | 38 +++++++++---------- .../pyext/repeated_composite_container.cc | 1 - .../compiler/csharp/csharp_map_field.cc | 2 +- .../protobuf/io/coded_stream_unittest.cc | 6 +-- src/google/protobuf/io/printer.h | 9 ++++- .../protobuf/io/zero_copy_stream_unittest.cc | 2 +- src/google/protobuf/parse_context.cc | 4 -- 9 files changed, 34 insertions(+), 33 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 929ff134ee..9593319d0e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,7 +14,9 @@ * Add ARM-optimized Varint decoding functions. * Minor optimization for parsing groups * Declare ReflectiveProtoHook class - * Reduce size of VarintParse code in protocol buffers, by calling the shared routine after handling just one-byte varint encoding inline, rather than handling one-byte and two-byte varints inline. + * Reduce size of VarintParse code in protocol buffers, by calling the shared + routine after handling just one-byte varint encoding inline, rather than + handling one-byte and two-byte varints inline. * Avoid inlining some large heavily duplicated routines in repeated_ptr_field.h * Add ReflectiveProtoHook to Reflection. * Turns on table-driven parser for reflection based objects. diff --git a/python/google/protobuf/pyext/map_container.cc b/python/google/protobuf/pyext/map_container.cc index e7ff1c8b63..e5496105bb 100644 --- a/python/google/protobuf/pyext/map_container.cc +++ b/python/google/protobuf/pyext/map_container.cc @@ -44,7 +44,6 @@ #include "google/protobuf/pyext/message_factory.h" #include "google/protobuf/pyext/repeated_composite_container.h" #include "google/protobuf/pyext/scoped_pyobject_ptr.h" -#include "util/gtl/map_util.h" namespace google { namespace protobuf { diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc index a56264ea81..13495851f5 100644 --- a/python/google/protobuf/pyext/message.cc +++ b/python/google/protobuf/pyext/message.cc @@ -73,7 +73,6 @@ #include "google/protobuf/io/coded_stream.h" #include "google/protobuf/io/strtod.h" #include "google/protobuf/io/zero_copy_stream_impl_lite.h" -#include "util/gtl/map_util.h" // clang-format off #include "google/protobuf/port_def.inc" @@ -2677,22 +2676,22 @@ CMessage* CMessage::BuildSubMessageFromPointer( if (!this->child_submessages) { this->child_submessages = new CMessage::SubMessagesMap(); } - CMessage* cmsg = gtl::FindPtrOrNull( - *this->child_submessages, sub_message); - if (cmsg) { - Py_INCREF(cmsg); - } else { - cmsg = cmessage::NewEmptyMessage(message_class); + auto it = this->child_submessages->find(sub_message); + if (it != this->child_submessages->end()) { + Py_INCREF(it->second); + return it->second; + } - if (cmsg == nullptr) { - return nullptr; - } - cmsg->message = sub_message; - Py_INCREF(this); - cmsg->parent = this; - cmsg->parent_field_descriptor = field_descriptor; - cmessage::SetSubmessage(this, cmsg); + CMessage* cmsg = cmessage::NewEmptyMessage(message_class); + + if (cmsg == nullptr) { + return nullptr; } + cmsg->message = sub_message; + Py_INCREF(this); + cmsg->parent = this; + cmsg->parent_field_descriptor = field_descriptor; + cmessage::SetSubmessage(this, cmsg); return cmsg; } @@ -2700,11 +2699,10 @@ CMessage* CMessage::MaybeReleaseSubMessage(Message* sub_message) { if (!this->child_submessages) { return nullptr; } - CMessage* released = gtl::FindPtrOrNull( - *this->child_submessages, sub_message); - if (!released) { - return nullptr; - } + auto it = this->child_submessages->find(sub_message); + if (it == this->child_submessages->end()) return nullptr; + CMessage* released = it->second; + // The target message will now own its content. Py_CLEAR(released->parent); released->parent_field_descriptor = nullptr; diff --git a/python/google/protobuf/pyext/repeated_composite_container.cc b/python/google/protobuf/pyext/repeated_composite_container.cc index c813e32221..a191670876 100644 --- a/python/google/protobuf/pyext/repeated_composite_container.cc +++ b/python/google/protobuf/pyext/repeated_composite_container.cc @@ -46,7 +46,6 @@ #include "google/protobuf/pyext/message.h" #include "google/protobuf/pyext/message_factory.h" #include "google/protobuf/pyext/scoped_pyobject_ptr.h" -#include "util/gtl/map_util.h" namespace google { namespace protobuf { diff --git a/src/google/protobuf/compiler/csharp/csharp_map_field.cc b/src/google/protobuf/compiler/csharp/csharp_map_field.cc index 5511536b8e..34ea3e9b72 100644 --- a/src/google/protobuf/compiler/csharp/csharp_map_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_map_field.cc @@ -98,7 +98,7 @@ void MapFieldGenerator::GenerateMembers(io::Printer* printer) { void MapFieldGenerator::GenerateMergingCode(io::Printer* printer) { printer->Print( variables_, - "$name$_.Add(other.$name$_);\n"); + "$name$_.MergeFrom(other.$name$_);\n"); } void MapFieldGenerator::GenerateParsingCode(io::Printer* printer) { diff --git a/src/google/protobuf/io/coded_stream_unittest.cc b/src/google/protobuf/io/coded_stream_unittest.cc index 6f12482900..1fca15c49c 100644 --- a/src/google/protobuf/io/coded_stream_unittest.cc +++ b/src/google/protobuf/io/coded_stream_unittest.cc @@ -136,7 +136,7 @@ class CodedStreamTest : public testing::Test { static uint8_t buffer_[kBufferSize]; }; -uint8_t CodedStreamTest::buffer_[CodedStreamTest::kBufferSize]; +uint8_t CodedStreamTest::buffer_[CodedStreamTest::kBufferSize] = {}; // We test each operation over a variety of block sizes to insure that // we test cases where reads or writes cross buffer boundaries, cases @@ -727,7 +727,7 @@ TEST_1D(CodedStreamTest, ReadStringImpossiblyLarge, kBlockSizes) { TEST_F(CodedStreamTest, ReadStringImpossiblyLargeFromStringOnStack) { // Same test as above, except directly use a buffer. This used to cause // crashes while the above did not. - uint8_t buffer[8]; + uint8_t buffer[8] = {}; CodedInputStream coded_input(buffer, 8); std::string str; EXPECT_FALSE(coded_input.ReadString(&str, 1 << 30)); @@ -1318,7 +1318,7 @@ class ReallyBigInputStream : public ZeroCopyInputStream { int backup_amount_; private: - char buffer_[1024]; + char buffer_[1024] = {}; int64_t buffer_count_; }; diff --git a/src/google/protobuf/io/printer.h b/src/google/protobuf/io/printer.h index b2d6d05e4f..3c096a48d2 100644 --- a/src/google/protobuf/io/printer.h +++ b/src/google/protobuf/io/printer.h @@ -414,6 +414,13 @@ class PROTOBUF_EXPORT Printer { // Options for controlling how the output of a Printer is formatted. struct Options { + Options() = default; + Options(const Options&) = default; + Options(Options&&) = default; + Options(char variable_delimiter, AnnotationCollector* annotation_collector) + : variable_delimiter(variable_delimiter), + annotation_collector(annotation_collector) {} + // The delimiter for variable substitutions, e.g. $foo$. char variable_delimiter = kDefaultVariableDelimiter; // An optional listener the Printer calls whenever it emits a source @@ -432,7 +439,7 @@ class PROTOBUF_EXPORT Printer { // // If disengaged, defaults to whether or not the environment variable // `PROTOC_CODEGEN_TRACE` is set. - absl::optional enable_codegen_trace; + absl::optional enable_codegen_trace = absl::nullopt; }; // Constructs a new Printer with the default options to output to diff --git a/src/google/protobuf/io/zero_copy_stream_unittest.cc b/src/google/protobuf/io/zero_copy_stream_unittest.cc index 81a5e0589c..d82354e571 100644 --- a/src/google/protobuf/io/zero_copy_stream_unittest.cc +++ b/src/google/protobuf/io/zero_copy_stream_unittest.cc @@ -1053,7 +1053,7 @@ TEST_F(IoTest, LimitingInputStream) { TEST_F(IoTest, LimitingInputStreamByteCount) { const int kHalfBufferSize = 128; const int kBufferSize = kHalfBufferSize * 2; - uint8 buffer[kBufferSize]; + uint8 buffer[kBufferSize] = {}; // Set up input. Only allow half to be read at once. ArrayInputStream array_input(buffer, kBufferSize, kHalfBufferSize); diff --git a/src/google/protobuf/parse_context.cc b/src/google/protobuf/parse_context.cc index afbc1ee38b..34063195c8 100644 --- a/src/google/protobuf/parse_context.cc +++ b/src/google/protobuf/parse_context.cc @@ -30,10 +30,6 @@ #include "google/protobuf/parse_context.h" -#ifdef __aarch64__ -#include -#endif - #include "google/protobuf/io/coded_stream.h" #include "google/protobuf/io/zero_copy_stream.h" #include "google/protobuf/arenastring.h" From fcd26beabe034142c0f1a693f7cb6e1517b03de3 Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Fri, 9 Sep 2022 15:07:56 -0700 Subject: [PATCH 15/20] Dedupe kokoro builds (#10400) * Attempt to dedupe Bazel test * Intentionally break a test to make sure presubmits still run * Moving some shared configs to higher directories * Adding root common.cfg * Adding action cfgs at root directory * Adding empty presubmit/continuous * Going back to leaf directories * Adding empty presubmit/continuous * Unify continuous and presubmit configs * Consolidate all presubmit/continuous into a common config file * Revert "Intentionally break a test to make sure presubmits still run" This reverts commit 978eb19f80ea46f4a0e07789f86e791c5f9790ac. * Fixing POC config files --- kokoro/linux/32-bit/common.cfg | 11 +++++++ kokoro/linux/32-bit/continuous.cfg | 12 +------- kokoro/linux/32-bit/presubmit.cfg | 12 +------- kokoro/linux/bazel/common.cfg | 16 ++++++++++ kokoro/linux/bazel/continuous.cfg | 17 +---------- kokoro/linux/bazel/presubmit.cfg | 17 +---------- kokoro/linux/cmake/common.cfg | 11 +++++++ kokoro/linux/cmake/continuous.cfg | 12 +------- kokoro/linux/cmake/presubmit.cfg | 12 +------- kokoro/linux/cmake_install/common.cfg | 11 +++++++ kokoro/linux/cmake_install/continuous.cfg | 12 +------- kokoro/linux/cmake_install/presubmit.cfg | 12 +------- kokoro/linux/cmake_ninja/common.cfg | 11 +++++++ kokoro/linux/cmake_ninja/continuous.cfg | 12 +------- kokoro/linux/cmake_ninja/presubmit.cfg | 12 +------- kokoro/linux/cmake_shared/common.cfg | 11 +++++++ kokoro/linux/cmake_shared/continuous.cfg | 12 +------- kokoro/linux/cmake_shared/presubmit.cfg | 12 +------- kokoro/linux/cpp_aarch64/common.cfg | 21 ++++++++++++++ kokoro/linux/cpp_aarch64/continuous.cfg | 22 +------------- kokoro/linux/cpp_aarch64/presubmit.cfg | 22 +------------- kokoro/linux/cpp_tcmalloc/common.cfg | 21 ++++++++++++++ kokoro/linux/cpp_tcmalloc/continuous.cfg | 22 +------------- kokoro/linux/cpp_tcmalloc/presubmit.cfg | 22 +------------- kokoro/linux/csharp/common.cfg | 27 +++++++++++++++++ kokoro/linux/csharp/continuous.cfg | 28 +----------------- kokoro/linux/csharp/presubmit.cfg | 28 +----------------- kokoro/linux/csharp_aarch64/common.cfg | 11 +++++++ kokoro/linux/csharp_aarch64/continuous.cfg | 12 +------- kokoro/linux/csharp_aarch64/presubmit.cfg | 12 +------- kokoro/linux/java_aarch64/common.cfg | 21 ++++++++++++++ kokoro/linux/java_aarch64/continuous.cfg | 22 +------------- kokoro/linux/java_aarch64/presubmit.cfg | 21 +------------- kokoro/linux/java_jdk11/common.cfg | 16 ++++++++++ kokoro/linux/java_jdk11/continuous.cfg | 17 +---------- kokoro/linux/java_jdk11/presubmit.cfg | 17 +---------- kokoro/linux/java_jdk17/common.cfg | 21 ++++++++++++++ kokoro/linux/java_jdk17/continuous.cfg | 22 +------------- kokoro/linux/java_jdk17/presubmit.cfg | 22 +------------- kokoro/linux/java_linkage_monitor/common.cfg | 12 ++++++++ .../linux/java_linkage_monitor/continuous.cfg | 12 +------- .../linux/java_linkage_monitor/presubmit.cfg | 13 +-------- kokoro/linux/jruby92/common.cfg | 26 +++++++++++++++++ kokoro/linux/jruby92/continuous.cfg | 27 +---------------- kokoro/linux/jruby92/presubmit.cfg | 27 +---------------- kokoro/linux/jruby93/common.cfg | 26 +++++++++++++++++ kokoro/linux/jruby93/continuous.cfg | 27 +---------------- kokoro/linux/jruby93/presubmit.cfg | 27 +---------------- kokoro/linux/php_aarch64/common.cfg | 11 +++++++ kokoro/linux/php_aarch64/continuous.cfg | 12 +------- kokoro/linux/php_aarch64/presubmit.cfg | 12 +------- kokoro/linux/php_all/common.cfg | 11 +++++++ kokoro/linux/php_all/continuous.cfg | 12 +------- kokoro/linux/php_all/presubmit.cfg | 12 +------- kokoro/linux/python310/common.cfg | 21 ++++++++++++++ kokoro/linux/python310/continuous.cfg | 22 +------------- kokoro/linux/python310/presubmit.cfg | 22 +------------- kokoro/linux/python310_cpp/common.cfg | 27 +++++++++++++++++ kokoro/linux/python310_cpp/continuous.cfg | 29 +------------------ kokoro/linux/python310_cpp/presubmit.cfg | 28 +----------------- kokoro/linux/python37/common.cfg | 21 ++++++++++++++ kokoro/linux/python37/continuous.cfg | 22 +------------- kokoro/linux/python37/presubmit.cfg | 22 +------------- kokoro/linux/python37_cpp/common.cfg | 27 +++++++++++++++++ kokoro/linux/python37_cpp/continuous.cfg | 28 +----------------- kokoro/linux/python37_cpp/presubmit.cfg | 28 +----------------- kokoro/linux/python38/common.cfg | 21 ++++++++++++++ kokoro/linux/python38/continuous.cfg | 22 +------------- kokoro/linux/python38/presubmit.cfg | 22 +------------- kokoro/linux/python38_cpp/common.cfg | 27 +++++++++++++++++ kokoro/linux/python38_cpp/continuous.cfg | 28 +----------------- kokoro/linux/python38_cpp/presubmit.cfg | 28 +----------------- kokoro/linux/python39/common.cfg | 21 ++++++++++++++ kokoro/linux/python39/continuous.cfg | 22 +------------- kokoro/linux/python39/presubmit.cfg | 22 +------------- kokoro/linux/python39_cpp/common.cfg | 27 +++++++++++++++++ kokoro/linux/python39_cpp/continuous.cfg | 28 +----------------- kokoro/linux/python39_cpp/presubmit.cfg | 28 +----------------- kokoro/linux/python_aarch64/common.cfg | 11 +++++++ kokoro/linux/python_aarch64/continuous.cfg | 12 +------- kokoro/linux/python_aarch64/presubmit.cfg | 12 +------- kokoro/linux/ruby25/common.cfg | 26 +++++++++++++++++ kokoro/linux/ruby25/continuous.cfg | 27 +---------------- kokoro/linux/ruby25/presubmit.cfg | 27 +---------------- kokoro/linux/ruby26/common.cfg | 26 +++++++++++++++++ kokoro/linux/ruby26/continuous.cfg | 27 +---------------- kokoro/linux/ruby26/presubmit.cfg | 27 +---------------- kokoro/linux/ruby27/common.cfg | 26 +++++++++++++++++ kokoro/linux/ruby27/continuous.cfg | 27 +---------------- kokoro/linux/ruby27/presubmit.cfg | 27 +---------------- kokoro/linux/ruby30/common.cfg | 26 +++++++++++++++++ kokoro/linux/ruby30/continuous.cfg | 27 +---------------- kokoro/linux/ruby30/presubmit.cfg | 27 +---------------- kokoro/linux/ruby31/common.cfg | 26 +++++++++++++++++ kokoro/linux/ruby31/continuous.cfg | 27 +---------------- kokoro/linux/ruby31/presubmit.cfg | 27 +---------------- kokoro/linux/ruby_aarch64/common.cfg | 11 +++++++ kokoro/linux/ruby_aarch64/continuous.cfg | 12 +------- kokoro/linux/ruby_aarch64/presubmit.cfg | 12 +------- kokoro/macos-next/cpp/common.cfg | 13 +++++++++ kokoro/macos-next/cpp/continuous.cfg | 14 +-------- kokoro/macos-next/cpp/presubmit.cfg | 14 +-------- kokoro/macos/cpp/common.cfg | 5 ++++ kokoro/macos/cpp/continuous.cfg | 6 +--- kokoro/macos/cpp/presubmit.cfg | 6 +--- kokoro/macos/objectivec_ios_debug/common.cfg | 5 ++++ .../macos/objectivec_ios_debug/continuous.cfg | 6 +--- .../macos/objectivec_ios_debug/presubmit.cfg | 6 +--- .../macos/objectivec_ios_release/common.cfg | 5 ++++ .../objectivec_ios_release/continuous.cfg | 6 +--- .../objectivec_ios_release/presubmit.cfg | 6 +--- kokoro/macos/objectivec_osx/common.cfg | 5 ++++ kokoro/macos/objectivec_osx/continuous.cfg | 6 +--- kokoro/macos/objectivec_osx/presubmit.cfg | 6 +--- kokoro/macos/php74/common.cfg | 5 ++++ kokoro/macos/php74/continuous.cfg | 6 +--- kokoro/macos/php74/presubmit.cfg | 6 +--- kokoro/macos/php80/common.cfg | 5 ++++ kokoro/macos/php80/continuous.cfg | 6 +--- kokoro/macos/php80/presubmit.cfg | 6 +--- kokoro/macos/python/common.cfg | 11 +++++++ kokoro/macos/python/continuous.cfg | 6 +--- kokoro/macos/python/presubmit.cfg | 12 +------- kokoro/macos/python_cpp/common.cfg | 5 ++++ kokoro/macos/python_cpp/continuous.cfg | 6 +--- kokoro/macos/python_cpp/presubmit.cfg | 6 +--- kokoro/macos/ruby25/common.cfg | 5 ++++ kokoro/macos/ruby25/continuous.cfg | 6 +--- kokoro/macos/ruby25/presubmit.cfg | 6 +--- kokoro/macos/ruby26/common.cfg | 5 ++++ kokoro/macos/ruby26/continuous.cfg | 6 +--- kokoro/macos/ruby26/presubmit.cfg | 6 +--- kokoro/macos/ruby27/common.cfg | 5 ++++ kokoro/macos/ruby27/continuous.cfg | 6 +--- kokoro/macos/ruby27/presubmit.cfg | 6 +--- kokoro/macos/ruby30/common.cfg | 5 ++++ kokoro/macos/ruby30/continuous.cfg | 6 +--- kokoro/macos/ruby30/presubmit.cfg | 6 +--- kokoro/macos/ruby31/common.cfg | 5 ++++ kokoro/macos/ruby31/continuous.cfg | 6 +--- kokoro/macos/ruby31/presubmit.cfg | 6 +--- kokoro/release/csharp/windows/common.cfg | 11 +++++++ kokoro/release/csharp/windows/continuous.cfg | 12 +------- kokoro/release/csharp/windows/presubmit.cfg | 12 +------- kokoro/release/ruby/linux/common.cfg | 8 +++++ kokoro/release/ruby/linux/continuous.cfg | 9 +----- kokoro/release/ruby/linux/presubmit.cfg | 9 +----- kokoro/release/ruby/macos/common.cfg | 8 +++++ kokoro/release/ruby/macos/continuous.cfg | 9 +----- kokoro/release/ruby/macos/presubmit.cfg | 9 +----- kokoro/windows/bazel/common.cfg | 5 ++++ kokoro/windows/bazel/continuous.cfg | 6 +--- kokoro/windows/bazel/presubmit.cfg | 6 +--- kokoro/windows/cmake/common.cfg | 5 ++++ kokoro/windows/cmake/continuous.cfg | 6 +--- kokoro/windows/cmake/presubmit.cfg | 6 +--- kokoro/windows/cmake_install/common.cfg | 5 ++++ kokoro/windows/cmake_install/continuous.cfg | 6 +--- kokoro/windows/cmake_install/presubmit.cfg | 6 +--- kokoro/windows/cmake_nmake/common.cfg | 5 ++++ kokoro/windows/cmake_nmake/continuous.cfg | 6 +--- kokoro/windows/cmake_nmake/presubmit.cfg | 6 +--- kokoro/windows/cmake_shared/common.cfg | 5 ++++ kokoro/windows/cmake_shared/continuous.cfg | 6 +--- kokoro/windows/cmake_shared/presubmit.cfg | 6 +--- kokoro/windows/csharp/common.cfg | 5 ++++ kokoro/windows/csharp/continuous.cfg | 6 +--- kokoro/windows/csharp/presubmit.cfg | 6 +--- 168 files changed, 892 insertions(+), 1553 deletions(-) create mode 100644 kokoro/linux/32-bit/common.cfg create mode 100644 kokoro/linux/bazel/common.cfg create mode 100644 kokoro/linux/cmake/common.cfg create mode 100644 kokoro/linux/cmake_install/common.cfg create mode 100644 kokoro/linux/cmake_ninja/common.cfg create mode 100644 kokoro/linux/cmake_shared/common.cfg create mode 100644 kokoro/linux/cpp_aarch64/common.cfg create mode 100644 kokoro/linux/cpp_tcmalloc/common.cfg create mode 100644 kokoro/linux/csharp/common.cfg create mode 100644 kokoro/linux/csharp_aarch64/common.cfg create mode 100644 kokoro/linux/java_aarch64/common.cfg create mode 100644 kokoro/linux/java_jdk11/common.cfg create mode 100644 kokoro/linux/java_jdk17/common.cfg create mode 100644 kokoro/linux/java_linkage_monitor/common.cfg create mode 100644 kokoro/linux/jruby92/common.cfg create mode 100644 kokoro/linux/jruby93/common.cfg create mode 100644 kokoro/linux/php_aarch64/common.cfg create mode 100644 kokoro/linux/php_all/common.cfg create mode 100644 kokoro/linux/python310/common.cfg create mode 100644 kokoro/linux/python310_cpp/common.cfg create mode 100644 kokoro/linux/python37/common.cfg create mode 100644 kokoro/linux/python37_cpp/common.cfg create mode 100644 kokoro/linux/python38/common.cfg create mode 100644 kokoro/linux/python38_cpp/common.cfg create mode 100644 kokoro/linux/python39/common.cfg create mode 100644 kokoro/linux/python39_cpp/common.cfg create mode 100644 kokoro/linux/python_aarch64/common.cfg create mode 100644 kokoro/linux/ruby25/common.cfg create mode 100644 kokoro/linux/ruby26/common.cfg create mode 100644 kokoro/linux/ruby27/common.cfg create mode 100644 kokoro/linux/ruby30/common.cfg create mode 100644 kokoro/linux/ruby31/common.cfg create mode 100644 kokoro/linux/ruby_aarch64/common.cfg create mode 100644 kokoro/macos-next/cpp/common.cfg create mode 100644 kokoro/macos/cpp/common.cfg create mode 100644 kokoro/macos/objectivec_ios_debug/common.cfg create mode 100644 kokoro/macos/objectivec_ios_release/common.cfg create mode 100644 kokoro/macos/objectivec_osx/common.cfg create mode 100644 kokoro/macos/php74/common.cfg create mode 100644 kokoro/macos/php80/common.cfg create mode 100644 kokoro/macos/python/common.cfg create mode 100644 kokoro/macos/python_cpp/common.cfg create mode 100644 kokoro/macos/ruby25/common.cfg create mode 100644 kokoro/macos/ruby26/common.cfg create mode 100644 kokoro/macos/ruby27/common.cfg create mode 100644 kokoro/macos/ruby30/common.cfg create mode 100644 kokoro/macos/ruby31/common.cfg create mode 100644 kokoro/release/csharp/windows/common.cfg create mode 100644 kokoro/release/ruby/linux/common.cfg create mode 100644 kokoro/release/ruby/macos/common.cfg create mode 100644 kokoro/windows/bazel/common.cfg create mode 100644 kokoro/windows/cmake/common.cfg create mode 100644 kokoro/windows/cmake_install/common.cfg create mode 100644 kokoro/windows/cmake_nmake/common.cfg create mode 100644 kokoro/windows/cmake_shared/common.cfg create mode 100644 kokoro/windows/csharp/common.cfg diff --git a/kokoro/linux/32-bit/common.cfg b/kokoro/linux/32-bit/common.cfg new file mode 100644 index 0000000000..28b66c07c2 --- /dev/null +++ b/kokoro/linux/32-bit/common.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/32-bit/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/32-bit/continuous.cfg b/kokoro/linux/32-bit/continuous.cfg index 28b66c07c2..8523c22536 100644 --- a/kokoro/linux/32-bit/continuous.cfg +++ b/kokoro/linux/32-bit/continuous.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/32-bit/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/32-bit/presubmit.cfg b/kokoro/linux/32-bit/presubmit.cfg index 28b66c07c2..8523c22536 100644 --- a/kokoro/linux/32-bit/presubmit.cfg +++ b/kokoro/linux/32-bit/presubmit.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/32-bit/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/bazel/common.cfg b/kokoro/linux/bazel/common.cfg new file mode 100644 index 0000000000..6d35d8bbaa --- /dev/null +++ b/kokoro/linux/bazel/common.cfg @@ -0,0 +1,16 @@ +# Default setup for the all of our Kokoro builds. + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 15 + +env_vars { + key: "BAZEL_TARGETS" + value: "//src/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/bazel/continuous.cfg b/kokoro/linux/bazel/continuous.cfg index 21fe759f6e..8523c22536 100644 --- a/kokoro/linux/bazel/continuous.cfg +++ b/kokoro/linux/bazel/continuous.cfg @@ -1,16 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 15 - -env_vars { - key: "BAZEL_TARGETS" - value: "//src/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/bazel/presubmit.cfg b/kokoro/linux/bazel/presubmit.cfg index 103128b98d..8523c22536 100644 --- a/kokoro/linux/bazel/presubmit.cfg +++ b/kokoro/linux/bazel/presubmit.cfg @@ -1,16 +1 @@ -# Config file for running C++ Bazel tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 15 - -env_vars { - key: "BAZEL_TARGETS" - value: "//src/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/cmake/common.cfg b/kokoro/linux/cmake/common.cfg new file mode 100644 index 0000000000..f03bd3945f --- /dev/null +++ b/kokoro/linux/cmake/common.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/cmake/build.sh" +timeout_mins: 1440 + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/cmake/continuous.cfg b/kokoro/linux/cmake/continuous.cfg index f03bd3945f..8523c22536 100644 --- a/kokoro/linux/cmake/continuous.cfg +++ b/kokoro/linux/cmake/continuous.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/cmake/build.sh" -timeout_mins: 1440 - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/cmake/presubmit.cfg b/kokoro/linux/cmake/presubmit.cfg index f03bd3945f..8523c22536 100644 --- a/kokoro/linux/cmake/presubmit.cfg +++ b/kokoro/linux/cmake/presubmit.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/cmake/build.sh" -timeout_mins: 1440 - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/cmake_install/common.cfg b/kokoro/linux/cmake_install/common.cfg new file mode 100644 index 0000000000..f1ae0b351f --- /dev/null +++ b/kokoro/linux/cmake_install/common.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/cmake_install/build.sh" +timeout_mins: 1440 + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/cmake_install/continuous.cfg b/kokoro/linux/cmake_install/continuous.cfg index f1ae0b351f..8523c22536 100644 --- a/kokoro/linux/cmake_install/continuous.cfg +++ b/kokoro/linux/cmake_install/continuous.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/cmake_install/build.sh" -timeout_mins: 1440 - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/cmake_install/presubmit.cfg b/kokoro/linux/cmake_install/presubmit.cfg index f1ae0b351f..8523c22536 100644 --- a/kokoro/linux/cmake_install/presubmit.cfg +++ b/kokoro/linux/cmake_install/presubmit.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/cmake_install/build.sh" -timeout_mins: 1440 - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/cmake_ninja/common.cfg b/kokoro/linux/cmake_ninja/common.cfg new file mode 100644 index 0000000000..144fc90a82 --- /dev/null +++ b/kokoro/linux/cmake_ninja/common.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/cmake_ninja/build.sh" +timeout_mins: 1440 + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/cmake_ninja/continuous.cfg b/kokoro/linux/cmake_ninja/continuous.cfg index 144fc90a82..8523c22536 100644 --- a/kokoro/linux/cmake_ninja/continuous.cfg +++ b/kokoro/linux/cmake_ninja/continuous.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/cmake_ninja/build.sh" -timeout_mins: 1440 - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/cmake_ninja/presubmit.cfg b/kokoro/linux/cmake_ninja/presubmit.cfg index 144fc90a82..8523c22536 100644 --- a/kokoro/linux/cmake_ninja/presubmit.cfg +++ b/kokoro/linux/cmake_ninja/presubmit.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/cmake_ninja/build.sh" -timeout_mins: 1440 - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/cmake_shared/common.cfg b/kokoro/linux/cmake_shared/common.cfg new file mode 100644 index 0000000000..f03bd3945f --- /dev/null +++ b/kokoro/linux/cmake_shared/common.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/cmake/build.sh" +timeout_mins: 1440 + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/cmake_shared/continuous.cfg b/kokoro/linux/cmake_shared/continuous.cfg index f03bd3945f..8523c22536 100644 --- a/kokoro/linux/cmake_shared/continuous.cfg +++ b/kokoro/linux/cmake_shared/continuous.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/cmake/build.sh" -timeout_mins: 1440 - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/cmake_shared/presubmit.cfg b/kokoro/linux/cmake_shared/presubmit.cfg index f03bd3945f..8523c22536 100644 --- a/kokoro/linux/cmake_shared/presubmit.cfg +++ b/kokoro/linux/cmake_shared/presubmit.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/cmake/build.sh" -timeout_mins: 1440 - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/cpp_aarch64/common.cfg b/kokoro/linux/cpp_aarch64/common.cfg new file mode 100644 index 0000000000..f77f73b928 --- /dev/null +++ b/kokoro/linux/cpp_aarch64/common.cfg @@ -0,0 +1,21 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//src/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/cpp_aarch64/continuous.cfg b/kokoro/linux/cpp_aarch64/continuous.cfg index f77f73b928..8523c22536 100644 --- a/kokoro/linux/cpp_aarch64/continuous.cfg +++ b/kokoro/linux/cpp_aarch64/continuous.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//src/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/cpp_aarch64/presubmit.cfg b/kokoro/linux/cpp_aarch64/presubmit.cfg index f77f73b928..8523c22536 100644 --- a/kokoro/linux/cpp_aarch64/presubmit.cfg +++ b/kokoro/linux/cpp_aarch64/presubmit.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//src/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/cpp_tcmalloc/common.cfg b/kokoro/linux/cpp_tcmalloc/common.cfg new file mode 100644 index 0000000000..fb76204e90 --- /dev/null +++ b/kokoro/linux/cpp_tcmalloc/common.cfg @@ -0,0 +1,21 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 1440 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/tcmalloc/linux:64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//src/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/cpp_tcmalloc/continuous.cfg b/kokoro/linux/cpp_tcmalloc/continuous.cfg index fb76204e90..8523c22536 100644 --- a/kokoro/linux/cpp_tcmalloc/continuous.cfg +++ b/kokoro/linux/cpp_tcmalloc/continuous.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 1440 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/tcmalloc/linux:64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//src/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/cpp_tcmalloc/presubmit.cfg b/kokoro/linux/cpp_tcmalloc/presubmit.cfg index fb76204e90..8523c22536 100644 --- a/kokoro/linux/cpp_tcmalloc/presubmit.cfg +++ b/kokoro/linux/cpp_tcmalloc/presubmit.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 1440 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/tcmalloc/linux:64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//src/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/csharp/common.cfg b/kokoro/linux/csharp/common.cfg new file mode 100644 index 0000000000..2332c00dce --- /dev/null +++ b/kokoro/linux/csharp/common.cfg @@ -0,0 +1,27 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 1440 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/csharp/linux:3.1.415-6.0.100-6bbe70439ba5b0404bb12662cebc0296909389fa" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//csharp/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 " + "--test_env=DOTNET_CLI_HOME=/home/bazel" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/csharp/continuous.cfg b/kokoro/linux/csharp/continuous.cfg index 2332c00dce..8523c22536 100644 --- a/kokoro/linux/csharp/continuous.cfg +++ b/kokoro/linux/csharp/continuous.cfg @@ -1,27 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 1440 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/csharp/linux:3.1.415-6.0.100-6bbe70439ba5b0404bb12662cebc0296909389fa" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//csharp/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 " - "--test_env=DOTNET_CLI_HOME=/home/bazel" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/csharp/presubmit.cfg b/kokoro/linux/csharp/presubmit.cfg index 2332c00dce..8523c22536 100644 --- a/kokoro/linux/csharp/presubmit.cfg +++ b/kokoro/linux/csharp/presubmit.cfg @@ -1,27 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 1440 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/csharp/linux:3.1.415-6.0.100-6bbe70439ba5b0404bb12662cebc0296909389fa" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//csharp/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 " - "--test_env=DOTNET_CLI_HOME=/home/bazel" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/csharp_aarch64/common.cfg b/kokoro/linux/csharp_aarch64/common.cfg new file mode 100644 index 0000000000..df28ef368f --- /dev/null +++ b/kokoro/linux/csharp_aarch64/common.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/csharp_aarch64/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/csharp_aarch64/continuous.cfg b/kokoro/linux/csharp_aarch64/continuous.cfg index df28ef368f..8523c22536 100644 --- a/kokoro/linux/csharp_aarch64/continuous.cfg +++ b/kokoro/linux/csharp_aarch64/continuous.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/csharp_aarch64/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/csharp_aarch64/presubmit.cfg b/kokoro/linux/csharp_aarch64/presubmit.cfg index df28ef368f..8523c22536 100644 --- a/kokoro/linux/csharp_aarch64/presubmit.cfg +++ b/kokoro/linux/csharp_aarch64/presubmit.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/csharp_aarch64/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/java_aarch64/common.cfg b/kokoro/linux/java_aarch64/common.cfg new file mode 100644 index 0000000000..75e3f0bddb --- /dev/null +++ b/kokoro/linux/java_aarch64/common.cfg @@ -0,0 +1,21 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//java/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/java_aarch64/continuous.cfg b/kokoro/linux/java_aarch64/continuous.cfg index 75e3f0bddb..8523c22536 100644 --- a/kokoro/linux/java_aarch64/continuous.cfg +++ b/kokoro/linux/java_aarch64/continuous.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//java/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/java_aarch64/presubmit.cfg b/kokoro/linux/java_aarch64/presubmit.cfg index bca25d1ea5..8523c22536 100644 --- a/kokoro/linux/java_aarch64/presubmit.cfg +++ b/kokoro/linux/java_aarch64/presubmit.cfg @@ -1,20 +1 @@ -# Config file for running tests in Kokoro - -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//java/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/java_jdk11/common.cfg b/kokoro/linux/java_jdk11/common.cfg new file mode 100644 index 0000000000..3db5cd0fd4 --- /dev/null +++ b/kokoro/linux/java_jdk11/common.cfg @@ -0,0 +1,16 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "BAZEL_TARGETS" + value: "//java/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/java_jdk11/continuous.cfg b/kokoro/linux/java_jdk11/continuous.cfg index 3db5cd0fd4..8523c22536 100644 --- a/kokoro/linux/java_jdk11/continuous.cfg +++ b/kokoro/linux/java_jdk11/continuous.cfg @@ -1,16 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "BAZEL_TARGETS" - value: "//java/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/java_jdk11/presubmit.cfg b/kokoro/linux/java_jdk11/presubmit.cfg index 04d8214b67..8523c22536 100644 --- a/kokoro/linux/java_jdk11/presubmit.cfg +++ b/kokoro/linux/java_jdk11/presubmit.cfg @@ -1,16 +1 @@ -# Config file for running Linkage Monitor in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "BAZEL_TARGETS" - value: "//java/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/java_jdk17/common.cfg b/kokoro/linux/java_jdk17/common.cfg new file mode 100644 index 0000000000..cd31eda405 --- /dev/null +++ b/kokoro/linux/java_jdk17/common.cfg @@ -0,0 +1,21 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/java/linux:17-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//java/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/java_jdk17/continuous.cfg b/kokoro/linux/java_jdk17/continuous.cfg index cd31eda405..8523c22536 100644 --- a/kokoro/linux/java_jdk17/continuous.cfg +++ b/kokoro/linux/java_jdk17/continuous.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/java/linux:17-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//java/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/java_jdk17/presubmit.cfg b/kokoro/linux/java_jdk17/presubmit.cfg index 4574a0fd1c..8523c22536 100644 --- a/kokoro/linux/java_jdk17/presubmit.cfg +++ b/kokoro/linux/java_jdk17/presubmit.cfg @@ -1,21 +1 @@ -# Config file for running Linkage Monitor in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/java/linux:17-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//java/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/java_linkage_monitor/common.cfg b/kokoro/linux/java_linkage_monitor/common.cfg new file mode 100644 index 0000000000..c02a52f0fa --- /dev/null +++ b/kokoro/linux/java_linkage_monitor/common.cfg @@ -0,0 +1,12 @@ +# Config file for running Linkage Monitor in Kokoro +# https://github.com/GoogleCloudPlatform/cloud-opensource-java/tree/master/linkage-monitor + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/java_linkage_monitor/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/java_linkage_monitor/continuous.cfg b/kokoro/linux/java_linkage_monitor/continuous.cfg index d0486cce41..8523c22536 100644 --- a/kokoro/linux/java_linkage_monitor/continuous.cfg +++ b/kokoro/linux/java_linkage_monitor/continuous.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_linkage_monitor/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/java_linkage_monitor/presubmit.cfg b/kokoro/linux/java_linkage_monitor/presubmit.cfg index c02a52f0fa..8523c22536 100644 --- a/kokoro/linux/java_linkage_monitor/presubmit.cfg +++ b/kokoro/linux/java_linkage_monitor/presubmit.cfg @@ -1,12 +1 @@ -# Config file for running Linkage Monitor in Kokoro -# https://github.com/GoogleCloudPlatform/cloud-opensource-java/tree/master/linkage-monitor - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_linkage_monitor/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/jruby92/common.cfg b/kokoro/linux/jruby92/common.cfg new file mode 100644 index 0000000000..9db8f50637 --- /dev/null +++ b/kokoro/linux/jruby92/common.cfg @@ -0,0 +1,26 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:jruby-9.2.20.1-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=java" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/jruby92/continuous.cfg b/kokoro/linux/jruby92/continuous.cfg index 9db8f50637..8523c22536 100644 --- a/kokoro/linux/jruby92/continuous.cfg +++ b/kokoro/linux/jruby92/continuous.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:jruby-9.2.20.1-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=java" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/jruby92/presubmit.cfg b/kokoro/linux/jruby92/presubmit.cfg index 9db8f50637..8523c22536 100644 --- a/kokoro/linux/jruby92/presubmit.cfg +++ b/kokoro/linux/jruby92/presubmit.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:jruby-9.2.20.1-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=java" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/jruby93/common.cfg b/kokoro/linux/jruby93/common.cfg new file mode 100644 index 0000000000..a5a9bd2374 --- /dev/null +++ b/kokoro/linux/jruby93/common.cfg @@ -0,0 +1,26 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:jruby-9.3.4.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=java" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/jruby93/continuous.cfg b/kokoro/linux/jruby93/continuous.cfg index a5a9bd2374..8523c22536 100644 --- a/kokoro/linux/jruby93/continuous.cfg +++ b/kokoro/linux/jruby93/continuous.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:jruby-9.3.4.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=java" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/jruby93/presubmit.cfg b/kokoro/linux/jruby93/presubmit.cfg index a5a9bd2374..8523c22536 100644 --- a/kokoro/linux/jruby93/presubmit.cfg +++ b/kokoro/linux/jruby93/presubmit.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:jruby-9.3.4.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=java" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/php_aarch64/common.cfg b/kokoro/linux/php_aarch64/common.cfg new file mode 100644 index 0000000000..ff20682dfb --- /dev/null +++ b/kokoro/linux/php_aarch64/common.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/php_aarch64/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/php_aarch64/continuous.cfg b/kokoro/linux/php_aarch64/continuous.cfg index ff20682dfb..8523c22536 100644 --- a/kokoro/linux/php_aarch64/continuous.cfg +++ b/kokoro/linux/php_aarch64/continuous.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/php_aarch64/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/php_aarch64/presubmit.cfg b/kokoro/linux/php_aarch64/presubmit.cfg index ff20682dfb..8523c22536 100644 --- a/kokoro/linux/php_aarch64/presubmit.cfg +++ b/kokoro/linux/php_aarch64/presubmit.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/php_aarch64/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/php_all/common.cfg b/kokoro/linux/php_all/common.cfg new file mode 100644 index 0000000000..dfa8037ef8 --- /dev/null +++ b/kokoro/linux/php_all/common.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/php_all/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/php_all/continuous.cfg b/kokoro/linux/php_all/continuous.cfg index dfa8037ef8..8523c22536 100644 --- a/kokoro/linux/php_all/continuous.cfg +++ b/kokoro/linux/php_all/continuous.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/php_all/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/php_all/presubmit.cfg b/kokoro/linux/php_all/presubmit.cfg index dfa8037ef8..8523c22536 100644 --- a/kokoro/linux/php_all/presubmit.cfg +++ b/kokoro/linux/php_all/presubmit.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/php_all/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python310/common.cfg b/kokoro/linux/python310/common.cfg new file mode 100644 index 0000000000..7e4a798ddd --- /dev/null +++ b/kokoro/linux/python310/common.cfg @@ -0,0 +1,21 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.10-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/python310/continuous.cfg b/kokoro/linux/python310/continuous.cfg index 7e4a798ddd..8523c22536 100644 --- a/kokoro/linux/python310/continuous.cfg +++ b/kokoro/linux/python310/continuous.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.10-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//python/... @upb//python/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python310/presubmit.cfg b/kokoro/linux/python310/presubmit.cfg index 7e4a798ddd..8523c22536 100644 --- a/kokoro/linux/python310/presubmit.cfg +++ b/kokoro/linux/python310/presubmit.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.10-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//python/... @upb//python/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python310_cpp/common.cfg b/kokoro/linux/python310_cpp/common.cfg new file mode 100644 index 0000000000..5b87fd6c51 --- /dev/null +++ b/kokoro/linux/python310_cpp/common.cfg @@ -0,0 +1,27 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.10-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + # Note: upb tests don't work since the C++ extension takes precedence here. + value: "//python/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=use_fast_cpp_protos=true" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/python310_cpp/continuous.cfg b/kokoro/linux/python310_cpp/continuous.cfg index e76abe18a0..8523c22536 100644 --- a/kokoro/linux/python310_cpp/continuous.cfg +++ b/kokoro/linux/python310_cpp/continuous.cfg @@ -1,28 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.10-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - # 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 { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=use_fast_cpp_protos=true" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python310_cpp/presubmit.cfg b/kokoro/linux/python310_cpp/presubmit.cfg index 5b87fd6c51..8523c22536 100644 --- a/kokoro/linux/python310_cpp/presubmit.cfg +++ b/kokoro/linux/python310_cpp/presubmit.cfg @@ -1,27 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.10-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - # Note: upb tests don't work since the C++ extension takes precedence here. - value: "//python/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=use_fast_cpp_protos=true" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python37/common.cfg b/kokoro/linux/python37/common.cfg new file mode 100644 index 0000000000..3ae100cb00 --- /dev/null +++ b/kokoro/linux/python37/common.cfg @@ -0,0 +1,21 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.7-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/python37/continuous.cfg b/kokoro/linux/python37/continuous.cfg index 3ae100cb00..8523c22536 100644 --- a/kokoro/linux/python37/continuous.cfg +++ b/kokoro/linux/python37/continuous.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.7-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//python/... @upb//python/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python37/presubmit.cfg b/kokoro/linux/python37/presubmit.cfg index 3ae100cb00..8523c22536 100644 --- a/kokoro/linux/python37/presubmit.cfg +++ b/kokoro/linux/python37/presubmit.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.7-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//python/... @upb//python/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python37_cpp/common.cfg b/kokoro/linux/python37_cpp/common.cfg new file mode 100644 index 0000000000..ebef92806f --- /dev/null +++ b/kokoro/linux/python37_cpp/common.cfg @@ -0,0 +1,27 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.7-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + # Note: upb tests don't work since the C++ extension takes precedence here. + value: "//python/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=use_fast_cpp_protos=true" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/python37_cpp/continuous.cfg b/kokoro/linux/python37_cpp/continuous.cfg index ebef92806f..8523c22536 100644 --- a/kokoro/linux/python37_cpp/continuous.cfg +++ b/kokoro/linux/python37_cpp/continuous.cfg @@ -1,27 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.7-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - # Note: upb tests don't work since the C++ extension takes precedence here. - value: "//python/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=use_fast_cpp_protos=true" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python37_cpp/presubmit.cfg b/kokoro/linux/python37_cpp/presubmit.cfg index ebef92806f..8523c22536 100644 --- a/kokoro/linux/python37_cpp/presubmit.cfg +++ b/kokoro/linux/python37_cpp/presubmit.cfg @@ -1,27 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.7-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - # Note: upb tests don't work since the C++ extension takes precedence here. - value: "//python/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=use_fast_cpp_protos=true" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python38/common.cfg b/kokoro/linux/python38/common.cfg new file mode 100644 index 0000000000..7d9e7aaadb --- /dev/null +++ b/kokoro/linux/python38/common.cfg @@ -0,0 +1,21 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.8-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/python38/continuous.cfg b/kokoro/linux/python38/continuous.cfg index 7d9e7aaadb..8523c22536 100644 --- a/kokoro/linux/python38/continuous.cfg +++ b/kokoro/linux/python38/continuous.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.8-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//python/... @upb//python/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python38/presubmit.cfg b/kokoro/linux/python38/presubmit.cfg index 7d9e7aaadb..8523c22536 100644 --- a/kokoro/linux/python38/presubmit.cfg +++ b/kokoro/linux/python38/presubmit.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.8-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//python/... @upb//python/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python38_cpp/common.cfg b/kokoro/linux/python38_cpp/common.cfg new file mode 100644 index 0000000000..decd466494 --- /dev/null +++ b/kokoro/linux/python38_cpp/common.cfg @@ -0,0 +1,27 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.8-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + # Note: upb tests don't work since the C++ extension takes precedence here. + value: "//python/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=use_fast_cpp_protos=true" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/python38_cpp/continuous.cfg b/kokoro/linux/python38_cpp/continuous.cfg index decd466494..8523c22536 100644 --- a/kokoro/linux/python38_cpp/continuous.cfg +++ b/kokoro/linux/python38_cpp/continuous.cfg @@ -1,27 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.8-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - # Note: upb tests don't work since the C++ extension takes precedence here. - value: "//python/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=use_fast_cpp_protos=true" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python38_cpp/presubmit.cfg b/kokoro/linux/python38_cpp/presubmit.cfg index decd466494..8523c22536 100644 --- a/kokoro/linux/python38_cpp/presubmit.cfg +++ b/kokoro/linux/python38_cpp/presubmit.cfg @@ -1,27 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.8-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - # Note: upb tests don't work since the C++ extension takes precedence here. - value: "//python/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=use_fast_cpp_protos=true" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python39/common.cfg b/kokoro/linux/python39/common.cfg new file mode 100644 index 0000000000..5133ab5629 --- /dev/null +++ b/kokoro/linux/python39/common.cfg @@ -0,0 +1,21 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.9-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/python39/continuous.cfg b/kokoro/linux/python39/continuous.cfg index 5133ab5629..8523c22536 100644 --- a/kokoro/linux/python39/continuous.cfg +++ b/kokoro/linux/python39/continuous.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.9-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//python/... @upb//python/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python39/presubmit.cfg b/kokoro/linux/python39/presubmit.cfg index 5133ab5629..8523c22536 100644 --- a/kokoro/linux/python39/presubmit.cfg +++ b/kokoro/linux/python39/presubmit.cfg @@ -1,21 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.9-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//python/... @upb//python/..." -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python39_cpp/common.cfg b/kokoro/linux/python39_cpp/common.cfg new file mode 100644 index 0000000000..97970087b0 --- /dev/null +++ b/kokoro/linux/python39_cpp/common.cfg @@ -0,0 +1,27 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.9-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + # Note: upb tests don't work since the C++ extension takes precedence here. + value: "//python/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=use_fast_cpp_protos=true" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/python39_cpp/continuous.cfg b/kokoro/linux/python39_cpp/continuous.cfg index 97970087b0..8523c22536 100644 --- a/kokoro/linux/python39_cpp/continuous.cfg +++ b/kokoro/linux/python39_cpp/continuous.cfg @@ -1,27 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.9-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - # Note: upb tests don't work since the C++ extension takes precedence here. - value: "//python/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=use_fast_cpp_protos=true" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python39_cpp/presubmit.cfg b/kokoro/linux/python39_cpp/presubmit.cfg index 97970087b0..8523c22536 100644 --- a/kokoro/linux/python39_cpp/presubmit.cfg +++ b/kokoro/linux/python39_cpp/presubmit.cfg @@ -1,27 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/python/linux:3.9-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - # Note: upb tests don't work since the C++ extension takes precedence here. - value: "//python/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=use_fast_cpp_protos=true" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python_aarch64/common.cfg b/kokoro/linux/python_aarch64/common.cfg new file mode 100644 index 0000000000..dee4a47367 --- /dev/null +++ b/kokoro/linux/python_aarch64/common.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/python_aarch64/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/python_aarch64/continuous.cfg b/kokoro/linux/python_aarch64/continuous.cfg index dee4a47367..8523c22536 100644 --- a/kokoro/linux/python_aarch64/continuous.cfg +++ b/kokoro/linux/python_aarch64/continuous.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_aarch64/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/python_aarch64/presubmit.cfg b/kokoro/linux/python_aarch64/presubmit.cfg index dee4a47367..8523c22536 100644 --- a/kokoro/linux/python_aarch64/presubmit.cfg +++ b/kokoro/linux/python_aarch64/presubmit.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_aarch64/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/ruby25/common.cfg b/kokoro/linux/ruby25/common.cfg new file mode 100644 index 0000000000..ec975cd7d2 --- /dev/null +++ b/kokoro/linux/ruby25/common.cfg @@ -0,0 +1,26 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-2.5.1-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/ruby25/continuous.cfg b/kokoro/linux/ruby25/continuous.cfg index ec975cd7d2..8523c22536 100644 --- a/kokoro/linux/ruby25/continuous.cfg +++ b/kokoro/linux/ruby25/continuous.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:ruby-2.5.1-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=c" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/ruby25/presubmit.cfg b/kokoro/linux/ruby25/presubmit.cfg index ec975cd7d2..8523c22536 100644 --- a/kokoro/linux/ruby25/presubmit.cfg +++ b/kokoro/linux/ruby25/presubmit.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:ruby-2.5.1-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=c" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/ruby26/common.cfg b/kokoro/linux/ruby26/common.cfg new file mode 100644 index 0000000000..d09a405d8c --- /dev/null +++ b/kokoro/linux/ruby26/common.cfg @@ -0,0 +1,26 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-2.6.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/ruby26/continuous.cfg b/kokoro/linux/ruby26/continuous.cfg index d09a405d8c..8523c22536 100644 --- a/kokoro/linux/ruby26/continuous.cfg +++ b/kokoro/linux/ruby26/continuous.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:ruby-2.6.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=c" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/ruby26/presubmit.cfg b/kokoro/linux/ruby26/presubmit.cfg index d09a405d8c..8523c22536 100644 --- a/kokoro/linux/ruby26/presubmit.cfg +++ b/kokoro/linux/ruby26/presubmit.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:ruby-2.6.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=c" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/ruby27/common.cfg b/kokoro/linux/ruby27/common.cfg new file mode 100644 index 0000000000..51afa75d27 --- /dev/null +++ b/kokoro/linux/ruby27/common.cfg @@ -0,0 +1,26 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-2.7.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/ruby27/continuous.cfg b/kokoro/linux/ruby27/continuous.cfg index 51afa75d27..8523c22536 100644 --- a/kokoro/linux/ruby27/continuous.cfg +++ b/kokoro/linux/ruby27/continuous.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:ruby-2.7.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=c" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/ruby27/presubmit.cfg b/kokoro/linux/ruby27/presubmit.cfg index 51afa75d27..8523c22536 100644 --- a/kokoro/linux/ruby27/presubmit.cfg +++ b/kokoro/linux/ruby27/presubmit.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:ruby-2.7.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=c" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/ruby30/common.cfg b/kokoro/linux/ruby30/common.cfg new file mode 100644 index 0000000000..338505e57e --- /dev/null +++ b/kokoro/linux/ruby30/common.cfg @@ -0,0 +1,26 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-3.0.2-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/ruby30/continuous.cfg b/kokoro/linux/ruby30/continuous.cfg index 338505e57e..8523c22536 100644 --- a/kokoro/linux/ruby30/continuous.cfg +++ b/kokoro/linux/ruby30/continuous.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:ruby-3.0.2-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=c" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/ruby30/presubmit.cfg b/kokoro/linux/ruby30/presubmit.cfg index 338505e57e..8523c22536 100644 --- a/kokoro/linux/ruby30/presubmit.cfg +++ b/kokoro/linux/ruby30/presubmit.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:ruby-3.0.2-2f706fd1ab49f4e97af769388be486069b63efee" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=c" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/ruby31/common.cfg b/kokoro/linux/ruby31/common.cfg new file mode 100644 index 0000000000..588fe13637 --- /dev/null +++ b/kokoro/linux/ruby31/common.cfg @@ -0,0 +1,26 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-3.1.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/ruby31/continuous.cfg b/kokoro/linux/ruby31/continuous.cfg index 588fe13637..8523c22536 100644 --- a/kokoro/linux/ruby31/continuous.cfg +++ b/kokoro/linux/ruby31/continuous.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:ruby-3.1.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=c" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/ruby31/presubmit.cfg b/kokoro/linux/ruby31/presubmit.cfg index 588fe13637..8523c22536 100644 --- a/kokoro/linux/ruby31/presubmit.cfg +++ b/kokoro/linux/ruby31/presubmit.cfg @@ -1,26 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel.sh" -timeout_mins: 120 - -env_vars { - key: "CONTAINER_IMAGE" - value: "gcr.io/protobuf-build/ruby/linux:ruby-3.1.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" -} - -env_vars { - key: "BAZEL_TARGETS" - value: "//ruby/..." -} - -env_vars { - key: "BAZEL_EXTRA_FLAGS" - value: "--define=ruby_platform=c" -} - -action { - define_artifacts { - regex: "**/sponge_log.*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/ruby_aarch64/common.cfg b/kokoro/linux/ruby_aarch64/common.cfg new file mode 100644 index 0000000000..ae82696404 --- /dev/null +++ b/kokoro/linux/ruby_aarch64/common.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/ruby_aarch64/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/ruby_aarch64/continuous.cfg b/kokoro/linux/ruby_aarch64/continuous.cfg index ae82696404..8523c22536 100644 --- a/kokoro/linux/ruby_aarch64/continuous.cfg +++ b/kokoro/linux/ruby_aarch64/continuous.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby_aarch64/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/linux/ruby_aarch64/presubmit.cfg b/kokoro/linux/ruby_aarch64/presubmit.cfg index ae82696404..8523c22536 100644 --- a/kokoro/linux/ruby_aarch64/presubmit.cfg +++ b/kokoro/linux/ruby_aarch64/presubmit.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby_aarch64/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos-next/cpp/common.cfg b/kokoro/macos-next/cpp/common.cfg new file mode 100644 index 0000000000..166caa5f91 --- /dev/null +++ b/kokoro/macos-next/cpp/common.cfg @@ -0,0 +1,13 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos-next/cpp/build.sh" +timeout_mins: 1440 + +# Upload logs +action: { + define_artifacts: { + regex: "**/*sponge_log.log" + regex: "**/*sponge_log.xml" + } +} diff --git a/kokoro/macos-next/cpp/continuous.cfg b/kokoro/macos-next/cpp/continuous.cfg index 166caa5f91..8523c22536 100644 --- a/kokoro/macos-next/cpp/continuous.cfg +++ b/kokoro/macos-next/cpp/continuous.cfg @@ -1,13 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos-next/cpp/build.sh" -timeout_mins: 1440 - -# Upload logs -action: { - define_artifacts: { - regex: "**/*sponge_log.log" - regex: "**/*sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos-next/cpp/presubmit.cfg b/kokoro/macos-next/cpp/presubmit.cfg index 166caa5f91..8523c22536 100644 --- a/kokoro/macos-next/cpp/presubmit.cfg +++ b/kokoro/macos-next/cpp/presubmit.cfg @@ -1,13 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos-next/cpp/build.sh" -timeout_mins: 1440 - -# Upload logs -action: { - define_artifacts: { - regex: "**/*sponge_log.log" - regex: "**/*sponge_log.xml" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/cpp/common.cfg b/kokoro/macos/cpp/common.cfg new file mode 100644 index 0000000000..4bea1cbbb1 --- /dev/null +++ b/kokoro/macos/cpp/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/cpp/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/cpp/continuous.cfg b/kokoro/macos/cpp/continuous.cfg index 4bea1cbbb1..8523c22536 100644 --- a/kokoro/macos/cpp/continuous.cfg +++ b/kokoro/macos/cpp/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/cpp/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/cpp/presubmit.cfg b/kokoro/macos/cpp/presubmit.cfg index 4bea1cbbb1..8523c22536 100644 --- a/kokoro/macos/cpp/presubmit.cfg +++ b/kokoro/macos/cpp/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/cpp/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/objectivec_ios_debug/common.cfg b/kokoro/macos/objectivec_ios_debug/common.cfg new file mode 100644 index 0000000000..473d54554a --- /dev/null +++ b/kokoro/macos/objectivec_ios_debug/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/objectivec_ios_debug/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/objectivec_ios_debug/continuous.cfg b/kokoro/macos/objectivec_ios_debug/continuous.cfg index 473d54554a..8523c22536 100644 --- a/kokoro/macos/objectivec_ios_debug/continuous.cfg +++ b/kokoro/macos/objectivec_ios_debug/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_ios_debug/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/objectivec_ios_debug/presubmit.cfg b/kokoro/macos/objectivec_ios_debug/presubmit.cfg index 473d54554a..8523c22536 100644 --- a/kokoro/macos/objectivec_ios_debug/presubmit.cfg +++ b/kokoro/macos/objectivec_ios_debug/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_ios_debug/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/objectivec_ios_release/common.cfg b/kokoro/macos/objectivec_ios_release/common.cfg new file mode 100644 index 0000000000..3cbfb685d8 --- /dev/null +++ b/kokoro/macos/objectivec_ios_release/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/objectivec_ios_release/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/objectivec_ios_release/continuous.cfg b/kokoro/macos/objectivec_ios_release/continuous.cfg index 3cbfb685d8..8523c22536 100644 --- a/kokoro/macos/objectivec_ios_release/continuous.cfg +++ b/kokoro/macos/objectivec_ios_release/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_ios_release/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/objectivec_ios_release/presubmit.cfg b/kokoro/macos/objectivec_ios_release/presubmit.cfg index 3cbfb685d8..8523c22536 100644 --- a/kokoro/macos/objectivec_ios_release/presubmit.cfg +++ b/kokoro/macos/objectivec_ios_release/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_ios_release/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/objectivec_osx/common.cfg b/kokoro/macos/objectivec_osx/common.cfg new file mode 100644 index 0000000000..41bd46aa87 --- /dev/null +++ b/kokoro/macos/objectivec_osx/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/objectivec_osx/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/objectivec_osx/continuous.cfg b/kokoro/macos/objectivec_osx/continuous.cfg index 41bd46aa87..8523c22536 100644 --- a/kokoro/macos/objectivec_osx/continuous.cfg +++ b/kokoro/macos/objectivec_osx/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_osx/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/objectivec_osx/presubmit.cfg b/kokoro/macos/objectivec_osx/presubmit.cfg index 41bd46aa87..8523c22536 100644 --- a/kokoro/macos/objectivec_osx/presubmit.cfg +++ b/kokoro/macos/objectivec_osx/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_osx/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/php74/common.cfg b/kokoro/macos/php74/common.cfg new file mode 100644 index 0000000000..cf7e80beb8 --- /dev/null +++ b/kokoro/macos/php74/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/php74/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/php74/continuous.cfg b/kokoro/macos/php74/continuous.cfg index cf7e80beb8..8523c22536 100644 --- a/kokoro/macos/php74/continuous.cfg +++ b/kokoro/macos/php74/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/php74/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/php74/presubmit.cfg b/kokoro/macos/php74/presubmit.cfg index cf7e80beb8..8523c22536 100644 --- a/kokoro/macos/php74/presubmit.cfg +++ b/kokoro/macos/php74/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/php74/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/php80/common.cfg b/kokoro/macos/php80/common.cfg new file mode 100644 index 0000000000..ded43e62c5 --- /dev/null +++ b/kokoro/macos/php80/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/php80/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/php80/continuous.cfg b/kokoro/macos/php80/continuous.cfg index ded43e62c5..8523c22536 100644 --- a/kokoro/macos/php80/continuous.cfg +++ b/kokoro/macos/php80/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/php80/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/php80/presubmit.cfg b/kokoro/macos/php80/presubmit.cfg index ded43e62c5..8523c22536 100644 --- a/kokoro/macos/php80/presubmit.cfg +++ b/kokoro/macos/php80/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/php80/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/python/common.cfg b/kokoro/macos/python/common.cfg new file mode 100644 index 0000000000..ac3cbeebf5 --- /dev/null +++ b/kokoro/macos/python/common.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/python/build.sh" +timeout_mins: 1440 + +action { + define_artifacts { + regex: "**/*" + } +} diff --git a/kokoro/macos/python/continuous.cfg b/kokoro/macos/python/continuous.cfg index 0fc8b503e8..8523c22536 100644 --- a/kokoro/macos/python/continuous.cfg +++ b/kokoro/macos/python/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/python/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/python/presubmit.cfg b/kokoro/macos/python/presubmit.cfg index ac3cbeebf5..8523c22536 100644 --- a/kokoro/macos/python/presubmit.cfg +++ b/kokoro/macos/python/presubmit.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/python/build.sh" -timeout_mins: 1440 - -action { - define_artifacts { - regex: "**/*" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/python_cpp/common.cfg b/kokoro/macos/python_cpp/common.cfg new file mode 100644 index 0000000000..22f4a0e4c9 --- /dev/null +++ b/kokoro/macos/python_cpp/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/python_cpp/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/python_cpp/continuous.cfg b/kokoro/macos/python_cpp/continuous.cfg index 22f4a0e4c9..8523c22536 100644 --- a/kokoro/macos/python_cpp/continuous.cfg +++ b/kokoro/macos/python_cpp/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/python_cpp/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/python_cpp/presubmit.cfg b/kokoro/macos/python_cpp/presubmit.cfg index 22f4a0e4c9..8523c22536 100644 --- a/kokoro/macos/python_cpp/presubmit.cfg +++ b/kokoro/macos/python_cpp/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/python_cpp/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/ruby25/common.cfg b/kokoro/macos/ruby25/common.cfg new file mode 100644 index 0000000000..b3755e4104 --- /dev/null +++ b/kokoro/macos/ruby25/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/ruby25/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/ruby25/continuous.cfg b/kokoro/macos/ruby25/continuous.cfg index b3755e4104..8523c22536 100644 --- a/kokoro/macos/ruby25/continuous.cfg +++ b/kokoro/macos/ruby25/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby25/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/ruby25/presubmit.cfg b/kokoro/macos/ruby25/presubmit.cfg index b3755e4104..8523c22536 100644 --- a/kokoro/macos/ruby25/presubmit.cfg +++ b/kokoro/macos/ruby25/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby25/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/ruby26/common.cfg b/kokoro/macos/ruby26/common.cfg new file mode 100644 index 0000000000..688f63c2bc --- /dev/null +++ b/kokoro/macos/ruby26/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/ruby26/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/ruby26/continuous.cfg b/kokoro/macos/ruby26/continuous.cfg index 688f63c2bc..8523c22536 100644 --- a/kokoro/macos/ruby26/continuous.cfg +++ b/kokoro/macos/ruby26/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby26/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/ruby26/presubmit.cfg b/kokoro/macos/ruby26/presubmit.cfg index 688f63c2bc..8523c22536 100644 --- a/kokoro/macos/ruby26/presubmit.cfg +++ b/kokoro/macos/ruby26/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby26/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/ruby27/common.cfg b/kokoro/macos/ruby27/common.cfg new file mode 100644 index 0000000000..b10b455da3 --- /dev/null +++ b/kokoro/macos/ruby27/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/ruby27/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/ruby27/continuous.cfg b/kokoro/macos/ruby27/continuous.cfg index b10b455da3..8523c22536 100644 --- a/kokoro/macos/ruby27/continuous.cfg +++ b/kokoro/macos/ruby27/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby27/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/ruby27/presubmit.cfg b/kokoro/macos/ruby27/presubmit.cfg index b10b455da3..8523c22536 100644 --- a/kokoro/macos/ruby27/presubmit.cfg +++ b/kokoro/macos/ruby27/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby27/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/ruby30/common.cfg b/kokoro/macos/ruby30/common.cfg new file mode 100644 index 0000000000..d5051170be --- /dev/null +++ b/kokoro/macos/ruby30/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/ruby30/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/ruby30/continuous.cfg b/kokoro/macos/ruby30/continuous.cfg index d5051170be..8523c22536 100644 --- a/kokoro/macos/ruby30/continuous.cfg +++ b/kokoro/macos/ruby30/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby30/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/ruby30/presubmit.cfg b/kokoro/macos/ruby30/presubmit.cfg index d5051170be..8523c22536 100644 --- a/kokoro/macos/ruby30/presubmit.cfg +++ b/kokoro/macos/ruby30/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby30/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/ruby31/common.cfg b/kokoro/macos/ruby31/common.cfg new file mode 100644 index 0000000000..19e16b3eaf --- /dev/null +++ b/kokoro/macos/ruby31/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/macos/ruby31/build.sh" +timeout_mins: 1440 diff --git a/kokoro/macos/ruby31/continuous.cfg b/kokoro/macos/ruby31/continuous.cfg index 19e16b3eaf..8523c22536 100644 --- a/kokoro/macos/ruby31/continuous.cfg +++ b/kokoro/macos/ruby31/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby31/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/macos/ruby31/presubmit.cfg b/kokoro/macos/ruby31/presubmit.cfg index 19e16b3eaf..8523c22536 100644 --- a/kokoro/macos/ruby31/presubmit.cfg +++ b/kokoro/macos/ruby31/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby31/build.sh" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/release/csharp/windows/common.cfg b/kokoro/release/csharp/windows/common.cfg new file mode 100644 index 0000000000..f508c65bda --- /dev/null +++ b/kokoro/release/csharp/windows/common.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/release/csharp/windows/build_nuget.bat" +timeout_mins: 60 + +action { + define_artifacts { + regex: "**/*.nupkg" + } +} diff --git a/kokoro/release/csharp/windows/continuous.cfg b/kokoro/release/csharp/windows/continuous.cfg index f508c65bda..8523c22536 100644 --- a/kokoro/release/csharp/windows/continuous.cfg +++ b/kokoro/release/csharp/windows/continuous.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/release/csharp/windows/build_nuget.bat" -timeout_mins: 60 - -action { - define_artifacts { - regex: "**/*.nupkg" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/release/csharp/windows/presubmit.cfg b/kokoro/release/csharp/windows/presubmit.cfg index f508c65bda..8523c22536 100644 --- a/kokoro/release/csharp/windows/presubmit.cfg +++ b/kokoro/release/csharp/windows/presubmit.cfg @@ -1,11 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/release/csharp/windows/build_nuget.bat" -timeout_mins: 60 - -action { - define_artifacts { - regex: "**/*.nupkg" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/release/ruby/linux/common.cfg b/kokoro/release/ruby/linux/common.cfg new file mode 100644 index 0000000000..dbc71b2ceb --- /dev/null +++ b/kokoro/release/ruby/linux/common.cfg @@ -0,0 +1,8 @@ +# Configuration for Linux release builds +build_file: "protobuf/kokoro/release/ruby/linux/build_artifacts.sh" + +action { + define_artifacts { + regex: "github/protobuf/artifacts/**" + } +} diff --git a/kokoro/release/ruby/linux/continuous.cfg b/kokoro/release/ruby/linux/continuous.cfg index dbc71b2ceb..8523c22536 100644 --- a/kokoro/release/ruby/linux/continuous.cfg +++ b/kokoro/release/ruby/linux/continuous.cfg @@ -1,8 +1 @@ -# Configuration for Linux release builds -build_file: "protobuf/kokoro/release/ruby/linux/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/release/ruby/linux/presubmit.cfg b/kokoro/release/ruby/linux/presubmit.cfg index dbc71b2ceb..8523c22536 100644 --- a/kokoro/release/ruby/linux/presubmit.cfg +++ b/kokoro/release/ruby/linux/presubmit.cfg @@ -1,8 +1 @@ -# Configuration for Linux release builds -build_file: "protobuf/kokoro/release/ruby/linux/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/release/ruby/macos/common.cfg b/kokoro/release/ruby/macos/common.cfg new file mode 100644 index 0000000000..cb1c08bb88 --- /dev/null +++ b/kokoro/release/ruby/macos/common.cfg @@ -0,0 +1,8 @@ +# Configuration for Mac OSX release builds +build_file: "protobuf/kokoro/release/ruby/macos/build_artifacts.sh" + +action { + define_artifacts { + regex: "github/protobuf/artifacts/**" + } +} diff --git a/kokoro/release/ruby/macos/continuous.cfg b/kokoro/release/ruby/macos/continuous.cfg index cb1c08bb88..8523c22536 100644 --- a/kokoro/release/ruby/macos/continuous.cfg +++ b/kokoro/release/ruby/macos/continuous.cfg @@ -1,8 +1 @@ -# Configuration for Mac OSX release builds -build_file: "protobuf/kokoro/release/ruby/macos/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/release/ruby/macos/presubmit.cfg b/kokoro/release/ruby/macos/presubmit.cfg index cb1c08bb88..8523c22536 100644 --- a/kokoro/release/ruby/macos/presubmit.cfg +++ b/kokoro/release/ruby/macos/presubmit.cfg @@ -1,8 +1 @@ -# Configuration for Mac OSX release builds -build_file: "protobuf/kokoro/release/ruby/macos/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/windows/bazel/common.cfg b/kokoro/windows/bazel/common.cfg new file mode 100644 index 0000000000..5978a7aa0d --- /dev/null +++ b/kokoro/windows/bazel/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/windows/bazel/build.bat" +timeout_mins: 1440 diff --git a/kokoro/windows/bazel/continuous.cfg b/kokoro/windows/bazel/continuous.cfg index 5978a7aa0d..8523c22536 100644 --- a/kokoro/windows/bazel/continuous.cfg +++ b/kokoro/windows/bazel/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/bazel/build.bat" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/windows/bazel/presubmit.cfg b/kokoro/windows/bazel/presubmit.cfg index 5978a7aa0d..8523c22536 100644 --- a/kokoro/windows/bazel/presubmit.cfg +++ b/kokoro/windows/bazel/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/bazel/build.bat" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/windows/cmake/common.cfg b/kokoro/windows/cmake/common.cfg new file mode 100644 index 0000000000..37e89e068b --- /dev/null +++ b/kokoro/windows/cmake/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/windows/cmake/build.bat" +timeout_mins: 1440 diff --git a/kokoro/windows/cmake/continuous.cfg b/kokoro/windows/cmake/continuous.cfg index 37e89e068b..8523c22536 100644 --- a/kokoro/windows/cmake/continuous.cfg +++ b/kokoro/windows/cmake/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/cmake/build.bat" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/windows/cmake/presubmit.cfg b/kokoro/windows/cmake/presubmit.cfg index 37e89e068b..8523c22536 100644 --- a/kokoro/windows/cmake/presubmit.cfg +++ b/kokoro/windows/cmake/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/cmake/build.bat" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/windows/cmake_install/common.cfg b/kokoro/windows/cmake_install/common.cfg new file mode 100644 index 0000000000..2efc0dced2 --- /dev/null +++ b/kokoro/windows/cmake_install/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/windows/cmake_install/build.bat" +timeout_mins: 1440 diff --git a/kokoro/windows/cmake_install/continuous.cfg b/kokoro/windows/cmake_install/continuous.cfg index 2efc0dced2..8523c22536 100644 --- a/kokoro/windows/cmake_install/continuous.cfg +++ b/kokoro/windows/cmake_install/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/cmake_install/build.bat" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/windows/cmake_install/presubmit.cfg b/kokoro/windows/cmake_install/presubmit.cfg index 2efc0dced2..8523c22536 100644 --- a/kokoro/windows/cmake_install/presubmit.cfg +++ b/kokoro/windows/cmake_install/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/cmake_install/build.bat" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/windows/cmake_nmake/common.cfg b/kokoro/windows/cmake_nmake/common.cfg new file mode 100644 index 0000000000..3c279fe421 --- /dev/null +++ b/kokoro/windows/cmake_nmake/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/windows/cmake_nmake/build.bat" +timeout_mins: 1440 diff --git a/kokoro/windows/cmake_nmake/continuous.cfg b/kokoro/windows/cmake_nmake/continuous.cfg index 3c279fe421..8523c22536 100644 --- a/kokoro/windows/cmake_nmake/continuous.cfg +++ b/kokoro/windows/cmake_nmake/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/cmake_nmake/build.bat" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/windows/cmake_nmake/presubmit.cfg b/kokoro/windows/cmake_nmake/presubmit.cfg index 3c279fe421..8523c22536 100644 --- a/kokoro/windows/cmake_nmake/presubmit.cfg +++ b/kokoro/windows/cmake_nmake/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/cmake_nmake/build.bat" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/windows/cmake_shared/common.cfg b/kokoro/windows/cmake_shared/common.cfg new file mode 100644 index 0000000000..0ba52e2a98 --- /dev/null +++ b/kokoro/windows/cmake_shared/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/windows/cmake_shared/build.bat" +timeout_mins: 1440 diff --git a/kokoro/windows/cmake_shared/continuous.cfg b/kokoro/windows/cmake_shared/continuous.cfg index 0ba52e2a98..8523c22536 100644 --- a/kokoro/windows/cmake_shared/continuous.cfg +++ b/kokoro/windows/cmake_shared/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/cmake_shared/build.bat" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/windows/cmake_shared/presubmit.cfg b/kokoro/windows/cmake_shared/presubmit.cfg index 0ba52e2a98..8523c22536 100644 --- a/kokoro/windows/cmake_shared/presubmit.cfg +++ b/kokoro/windows/cmake_shared/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/cmake_shared/build.bat" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/windows/csharp/common.cfg b/kokoro/windows/csharp/common.cfg new file mode 100644 index 0000000000..f586585176 --- /dev/null +++ b/kokoro/windows/csharp/common.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/windows/csharp/build.bat" +timeout_mins: 1440 diff --git a/kokoro/windows/csharp/continuous.cfg b/kokoro/windows/csharp/continuous.cfg index f586585176..8523c22536 100644 --- a/kokoro/windows/csharp/continuous.cfg +++ b/kokoro/windows/csharp/continuous.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/csharp/build.bat" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. diff --git a/kokoro/windows/csharp/presubmit.cfg b/kokoro/windows/csharp/presubmit.cfg index f586585176..8523c22536 100644 --- a/kokoro/windows/csharp/presubmit.cfg +++ b/kokoro/windows/csharp/presubmit.cfg @@ -1,5 +1 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/csharp/build.bat" -timeout_mins: 1440 +# Keep this file empty! Use common.cfg instead. From da973aff2adab60a9e516d3202c111dbdde1a50f Mon Sep 17 00:00:00 2001 From: Alexander Shadchin Date: Sun, 14 Aug 2022 21:13:49 +0300 Subject: [PATCH 16/20] Fix build with Python 3.11 The PyFrameObject structure members have been removed from the public C API. --- python/google/protobuf/pyext/descriptor.cc | 75 ++++++++++++++++++---- 1 file changed, 62 insertions(+), 13 deletions(-) diff --git a/python/google/protobuf/pyext/descriptor.cc b/python/google/protobuf/pyext/descriptor.cc index fc83acf01a..fc97b0fa6c 100644 --- a/python/google/protobuf/pyext/descriptor.cc +++ b/python/google/protobuf/pyext/descriptor.cc @@ -58,6 +58,37 @@ : 0) \ : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) +#if PY_VERSION_HEX < 0x030900B1 && !defined(PYPY_VERSION) +static PyCodeObject* PyFrame_GetCode(PyFrameObject *frame) +{ + Py_INCREF(frame->f_code); + return frame->f_code; +} + +static PyFrameObject* PyFrame_GetBack(PyFrameObject *frame) +{ + Py_XINCREF(frame->f_back); + return frame->f_back; +} +#endif + +#if PY_VERSION_HEX < 0x030B00A7 && !defined(PYPY_VERSION) +static PyObject* PyFrame_GetLocals(PyFrameObject *frame) +{ + if (PyFrame_FastToLocalsWithError(frame) < 0) { + return NULL; + } + Py_INCREF(frame->f_locals); + return frame->f_locals; +} + +static PyObject* PyFrame_GetGlobals(PyFrameObject *frame) +{ + Py_INCREF(frame->f_globals); + return frame->f_globals; +} +#endif + namespace google { namespace protobuf { namespace python { @@ -96,48 +127,66 @@ bool _CalledFromGeneratedFile(int stacklevel) { // This check is not critical and is somewhat difficult to implement correctly // in PyPy. PyFrameObject* frame = PyEval_GetFrame(); + PyCodeObject* frame_code = nullptr; + PyObject* frame_globals = nullptr; + PyObject* frame_locals = nullptr; + bool result = false; + if (frame == nullptr) { - return false; + goto exit; } + Py_INCREF(frame); while (stacklevel-- > 0) { - frame = frame->f_back; + PyFrameObject* next_frame = PyFrame_GetBack(frame); + Py_DECREF(frame); + frame = next_frame; if (frame == nullptr) { - return false; + goto exit; } } - if (frame->f_code->co_filename == nullptr) { - return false; + frame_code = PyFrame_GetCode(frame); + if (frame_code->co_filename == nullptr) { + goto exit; } char* filename; Py_ssize_t filename_size; - if (PyString_AsStringAndSize(frame->f_code->co_filename, + if (PyString_AsStringAndSize(frame_code->co_filename, &filename, &filename_size) < 0) { // filename is not a string. PyErr_Clear(); - return false; + goto exit; } if ((filename_size < 3) || (strcmp(&filename[filename_size - 3], ".py") != 0)) { // Cython's stack does not have .py file name and is not at global module // scope. - return true; + result = true; + goto exit; } if (filename_size < 7) { // filename is too short. - return false; + goto exit; } if (strcmp(&filename[filename_size - 7], "_pb2.py") != 0) { // Filename is not ending with _pb2. - return false; + goto exit; } - if (frame->f_globals != frame->f_locals) { + frame_globals = PyFrame_GetGlobals(frame); + frame_locals = PyFrame_GetLocals(frame); + if (frame_globals != frame_locals) { // Not at global module scope - return false; + goto exit; } #endif - return true; + result = true; +exit: + Py_XDECREF(frame_globals); + Py_XDECREF(frame_locals); + Py_XDECREF(frame_code); + Py_XDECREF(frame); + return result; } // If the calling code is not a _pb2.py file, raise AttributeError. From dfd7b19b3c9c771c7bfa0b10cbb06c31ec09225e Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Mon, 12 Sep 2022 12:42:08 -0700 Subject: [PATCH 17/20] Update changelog --- CHANGES.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 9593319d0e..8cd58aa13b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -20,6 +20,8 @@ * Avoid inlining some large heavily duplicated routines in repeated_ptr_field.h * Add ReflectiveProtoHook to Reflection. * Turns on table-driven parser for reflection based objects. + * Save code space by avoiding inlining of large-in-aggregate code-space MessageLite::~MessageLite destructor. + * Undefine the macro `linux` when compiling protobuf Kotlin From 6cf8108271ea35f9a07ad25da30b362eddd9cf63 Mon Sep 17 00:00:00 2001 From: Deanna Garcia Date: Tue, 13 Sep 2022 16:45:27 +0000 Subject: [PATCH 18/20] Apply patch --- src/google/protobuf/extension_set_inl.h | 27 +++-- src/google/protobuf/wire_format.cc | 26 +++-- src/google/protobuf/wire_format_lite.h | 27 +++-- src/google/protobuf/wire_format_unittest.inc | 104 +++++++++++++++++-- 4 files changed, 149 insertions(+), 35 deletions(-) diff --git a/src/google/protobuf/extension_set_inl.h b/src/google/protobuf/extension_set_inl.h index f98065c607..8256455407 100644 --- a/src/google/protobuf/extension_set_inl.h +++ b/src/google/protobuf/extension_set_inl.h @@ -206,16 +206,21 @@ const char* ExtensionSet::ParseMessageSetItemTmpl( const char* ptr, const Msg* extendee, internal::InternalMetadata* metadata, internal::ParseContext* ctx) { std::string payload; - uint32_t type_id = 0; - bool payload_read = false; + uint32_t type_id; + enum class State { kNoTag, kHasType, kHasPayload, kDone }; + State state = State::kNoTag; + while (!ctx->Done(&ptr)) { uint32_t tag = static_cast(*ptr++); if (tag == WireFormatLite::kMessageSetTypeIdTag) { uint64_t tmp; ptr = ParseBigVarint(ptr, &tmp); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - type_id = tmp; - if (payload_read) { + if (state == State::kNoTag) { + type_id = tmp; + state = State::kHasType; + } else if (state == State::kHasPayload) { + type_id = tmp; ExtensionInfo extension; bool was_packed_on_wire; if (!FindExtension(2, type_id, extendee, ctx, &extension, @@ -241,20 +246,24 @@ const char* ExtensionSet::ParseMessageSetItemTmpl( GOOGLE_PROTOBUF_PARSER_ASSERT(value->_InternalParse(p, &tmp_ctx) && tmp_ctx.EndedAtLimit()); } - type_id = 0; + state = State::kDone; } } else if (tag == WireFormatLite::kMessageSetMessageTag) { - if (type_id != 0) { + if (state == State::kHasType) { ptr = ParseFieldMaybeLazily(static_cast(type_id) * 8 + 2, ptr, extendee, metadata, ctx); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); - type_id = 0; + state = State::kDone; } else { + std::string tmp; int32_t size = ReadSize(&ptr); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - ptr = ctx->ReadString(ptr, size, &payload); + ptr = ctx->ReadString(ptr, size, &tmp); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - payload_read = true; + if (state == State::kNoTag) { + payload = std::move(tmp); + state = State::kHasPayload; + } } } else { ptr = ReadTag(ptr - 1, &tag); diff --git a/src/google/protobuf/wire_format.cc b/src/google/protobuf/wire_format.cc index e42d44a9f7..d9d2913051 100644 --- a/src/google/protobuf/wire_format.cc +++ b/src/google/protobuf/wire_format.cc @@ -657,9 +657,11 @@ struct WireFormat::MessageSetParser { const char* _InternalParse(const char* ptr, internal::ParseContext* ctx) { // Parse a MessageSetItem auto metadata = reflection->MutableInternalMetadata(msg); + enum class State { kNoTag, kHasType, kHasPayload, kDone }; + State state = State::kNoTag; + std::string payload; uint32_t type_id = 0; - bool payload_read = false; while (!ctx->Done(&ptr)) { // We use 64 bit tags in order to allow typeid's that span the whole // range of 32 bit numbers. @@ -668,8 +670,11 @@ struct WireFormat::MessageSetParser { uint64_t tmp; ptr = ParseBigVarint(ptr, &tmp); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - type_id = tmp; - if (payload_read) { + if (state == State::kNoTag) { + type_id = tmp; + state = State::kHasType; + } else if (state == State::kHasPayload) { + type_id = tmp; const FieldDescriptor* field; if (ctx->data().pool == nullptr) { field = reflection->FindKnownExtensionByNumber(type_id); @@ -696,17 +701,17 @@ struct WireFormat::MessageSetParser { GOOGLE_PROTOBUF_PARSER_ASSERT(value->_InternalParse(p, &tmp_ctx) && tmp_ctx.EndedAtLimit()); } - type_id = 0; + state = State::kDone; } continue; } else if (tag == WireFormatLite::kMessageSetMessageTag) { - if (type_id == 0) { + if (state == State::kNoTag) { int32_t size = ReadSize(&ptr); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); ptr = ctx->ReadString(ptr, size, &payload); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - payload_read = true; - } else { + state = State::kHasPayload; + } else if (state == State::kHasType) { // We're now parsing the payload const FieldDescriptor* field = nullptr; if (descriptor->IsExtensionNumber(type_id)) { @@ -720,7 +725,12 @@ struct WireFormat::MessageSetParser { ptr = WireFormat::_InternalParseAndMergeField( msg, ptr, ctx, static_cast(type_id) * 8 + 2, reflection, field); - type_id = 0; + state = State::kDone; + } else { + int32_t size = ReadSize(&ptr); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ptr = ctx->Skip(ptr, size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); } } else { // An unknown field in MessageSetItem. diff --git a/src/google/protobuf/wire_format_lite.h b/src/google/protobuf/wire_format_lite.h index 5f5dd80f8a..1af4d06258 100644 --- a/src/google/protobuf/wire_format_lite.h +++ b/src/google/protobuf/wire_format_lite.h @@ -1834,6 +1834,9 @@ bool ParseMessageSetItemImpl(io::CodedInputStream* input, MS ms) { // we can parse it later. std::string message_data; + enum class State { kNoTag, kHasType, kHasPayload, kDone }; + State state = State::kNoTag; + while (true) { const uint32_t tag = input->ReadTagNoLastTag(); if (tag == 0) return false; @@ -1842,26 +1845,34 @@ bool ParseMessageSetItemImpl(io::CodedInputStream* input, MS ms) { case WireFormatLite::kMessageSetTypeIdTag: { uint32_t type_id; if (!input->ReadVarint32(&type_id)) return false; - last_type_id = type_id; - - if (!message_data.empty()) { + if (state == State::kNoTag) { + last_type_id = type_id; + state = State::kHasType; + } else if (state == State::kHasPayload) { // We saw some message data before the type_id. Have to parse it // now. io::CodedInputStream sub_input( reinterpret_cast(message_data.data()), static_cast(message_data.size())); sub_input.SetRecursionLimit(input->RecursionBudget()); - if (!ms.ParseField(last_type_id, &sub_input)) { + if (!ms.ParseField(type_id, &sub_input)) { return false; } message_data.clear(); + state = State::kDone; } break; } case WireFormatLite::kMessageSetMessageTag: { - if (last_type_id == 0) { + if (state == State::kHasType) { + // Already saw type_id, so we can parse this directly. + if (!ms.ParseField(last_type_id, input)) { + return false; + } + state = State::kDone; + } else if (state == State::kNoTag) { // We haven't seen a type_id yet. Append this data to message_data. uint32_t length; if (!input->ReadVarint32(&length)) return false; @@ -1872,11 +1883,9 @@ bool ParseMessageSetItemImpl(io::CodedInputStream* input, MS ms) { auto ptr = reinterpret_cast(&message_data[0]); ptr = io::CodedOutputStream::WriteVarint32ToArray(length, ptr); if (!input->ReadRaw(ptr, length)) return false; + state = State::kHasPayload; } else { - // Already saw type_id, so we can parse this directly. - if (!ms.ParseField(last_type_id, input)) { - return false; - } + if (!ms.SkipField(tag, input)) return false; } break; diff --git a/src/google/protobuf/wire_format_unittest.inc b/src/google/protobuf/wire_format_unittest.inc index c2d2a00afd..5653be7962 100644 --- a/src/google/protobuf/wire_format_unittest.inc +++ b/src/google/protobuf/wire_format_unittest.inc @@ -581,28 +581,54 @@ TEST(WireFormatTest, ParseMessageSet) { EXPECT_EQ(message_set.DebugString(), dynamic_message_set.DebugString()); } -TEST(WireFormatTest, ParseMessageSetWithReverseTagOrder) { +namespace { +std::string BuildMessageSetItemStart() { std::string data; { - UNITTEST::TestMessageSetExtension1 message; - message.set_i(123); - // Build a MessageSet manually with its message content put before its - // type_id. io::StringOutputStream output_stream(&data); io::CodedOutputStream coded_output(&output_stream); coded_output.WriteTag(WireFormatLite::kMessageSetItemStartTag); + } + return data; +} +std::string BuildMessageSetItemEnd() { + std::string data; + { + io::StringOutputStream output_stream(&data); + io::CodedOutputStream coded_output(&output_stream); + coded_output.WriteTag(WireFormatLite::kMessageSetItemEndTag); + } + return data; +} +std::string BuildMessageSetTestExtension1(int value = 123) { + std::string data; + { + UNITTEST::TestMessageSetExtension1 message; + message.set_i(value); + io::StringOutputStream output_stream(&data); + io::CodedOutputStream coded_output(&output_stream); // Write the message content first. WireFormatLite::WriteTag(WireFormatLite::kMessageSetMessageNumber, WireFormatLite::WIRETYPE_LENGTH_DELIMITED, &coded_output); coded_output.WriteVarint32(message.ByteSizeLong()); message.SerializeWithCachedSizes(&coded_output); - // Write the type id. - uint32_t type_id = message.GetDescriptor()->extension(0)->number(); + } + return data; +} +std::string BuildMessageSetItemTypeId(int extension_number) { + std::string data; + { + io::StringOutputStream output_stream(&data); + io::CodedOutputStream coded_output(&output_stream); WireFormatLite::WriteUInt32(WireFormatLite::kMessageSetTypeIdNumber, - type_id, &coded_output); - coded_output.WriteTag(WireFormatLite::kMessageSetItemEndTag); + extension_number, &coded_output); } + return data; +} +void ValidateTestMessageSet(const std::string& test_case, + const std::string& data) { + SCOPED_TRACE(test_case); { PROTO2_WIREFORMAT_UNITTEST::TestMessageSet message_set; ASSERT_TRUE(message_set.ParseFromString(data)); @@ -612,6 +638,11 @@ TEST(WireFormatTest, ParseMessageSetWithReverseTagOrder) { .GetExtension( UNITTEST::TestMessageSetExtension1::message_set_extension) .i()); + + // Make sure it does not contain anything else. + message_set.ClearExtension( + UNITTEST::TestMessageSetExtension1::message_set_extension); + EXPECT_EQ(message_set.SerializeAsString(), ""); } { // Test parse the message via Reflection. @@ -627,6 +658,61 @@ TEST(WireFormatTest, ParseMessageSetWithReverseTagOrder) { UNITTEST::TestMessageSetExtension1::message_set_extension) .i()); } + { + // Test parse the message via DynamicMessage. + DynamicMessageFactory factory; + std::unique_ptr msg( + factory + .GetPrototype( + PROTO2_WIREFORMAT_UNITTEST::TestMessageSet::descriptor()) + ->New()); + msg->ParseFromString(data); + auto* reflection = msg->GetReflection(); + std::vector fields; + reflection->ListFields(*msg, &fields); + ASSERT_EQ(fields.size(), 1); + const auto& sub = reflection->GetMessage(*msg, fields[0]); + reflection = sub.GetReflection(); + EXPECT_EQ(123, reflection->GetInt32( + sub, sub.GetDescriptor()->FindFieldByName("i"))); + } +} +} // namespace + +TEST(WireFormatTest, ParseMessageSetWithAnyTagOrder) { + std::string start = BuildMessageSetItemStart(); + std::string end = BuildMessageSetItemEnd(); + std::string id = BuildMessageSetItemTypeId( + UNITTEST::TestMessageSetExtension1::descriptor()->extension(0)->number()); + std::string message = BuildMessageSetTestExtension1(); + + ValidateTestMessageSet("id + message", start + id + message + end); + ValidateTestMessageSet("message + id", start + message + id + end); +} + +TEST(WireFormatTest, ParseMessageSetWithDuplicateTags) { + std::string start = BuildMessageSetItemStart(); + std::string end = BuildMessageSetItemEnd(); + std::string id = BuildMessageSetItemTypeId( + UNITTEST::TestMessageSetExtension1::descriptor()->extension(0)->number()); + std::string other_id = BuildMessageSetItemTypeId(123456); + std::string message = BuildMessageSetTestExtension1(); + std::string other_message = BuildMessageSetTestExtension1(321); + + // Double id + ValidateTestMessageSet("id + other_id + message", + start + id + other_id + message + end); + ValidateTestMessageSet("id + message + other_id", + start + id + message + other_id + end); + ValidateTestMessageSet("message + id + other_id", + start + message + id + other_id + end); + // Double message + ValidateTestMessageSet("id + message + other_message", + start + id + message + other_message + end); + ValidateTestMessageSet("message + id + other_message", + start + message + id + other_message + end); + ValidateTestMessageSet("message + other_message + id", + start + message + other_message + id + end); } void SerializeReverseOrder( From 4877014174100b7ed9607478e15cf33f1ca0fcde Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Wed, 14 Sep 2022 14:38:29 -0700 Subject: [PATCH 19/20] Fix stale descriptor files after comment change (#10577) --- .../Google.Protobuf/Reflection/Descriptor.cs | 8 +++---- .../Protobuf/Internal/MessageOptions.php | 24 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs index c290558135..e252372edd 100644 --- a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs @@ -6641,6 +6641,10 @@ namespace Google.Protobuf.Reflection { private bool mapEntry_; /// + /// NOTE: Do not set the option in .proto files. Always use the maps syntax + /// instead. The option should only be implicitly set by the proto compiler + /// parser. + /// /// Whether the message is an automatically generated map entry type for the /// maps field. /// @@ -6658,10 +6662,6 @@ namespace Google.Protobuf.Reflection { /// use a native map in the target language to hold the keys and values. /// The reflection APIs in such implementations still need to work as /// if the field is a repeated message field. - /// - /// NOTE: Do not set the option in .proto files. Always use the maps syntax - /// instead. The option should only be implicitly set by the proto compiler - /// parser. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] diff --git a/php/src/Google/Protobuf/Internal/MessageOptions.php b/php/src/Google/Protobuf/Internal/MessageOptions.php index 5c6158019c..96e6f5291e 100644 --- a/php/src/Google/Protobuf/Internal/MessageOptions.php +++ b/php/src/Google/Protobuf/Internal/MessageOptions.php @@ -53,6 +53,9 @@ class MessageOptions extends \Google\Protobuf\Internal\Message */ protected $deprecated = null; /** + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. * Whether the message is an automatically generated map entry type for the * maps field. * For maps fields: @@ -68,9 +71,6 @@ class MessageOptions extends \Google\Protobuf\Internal\Message * use a native map in the target language to hold the keys and values. * The reflection APIs in such implementations still need to work as * if the field is a repeated message field. - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. * * Generated from protobuf field optional bool map_entry = 7; */ @@ -114,6 +114,9 @@ class MessageOptions extends \Google\Protobuf\Internal\Message * for the message, or it will be completely ignored; in the very least, * this is a formalization for deprecating messages. * @type bool $map_entry + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. * Whether the message is an automatically generated map entry type for the * maps field. * For maps fields: @@ -129,9 +132,6 @@ class MessageOptions extends \Google\Protobuf\Internal\Message * use a native map in the target language to hold the keys and values. * The reflection APIs in such implementations still need to work as * if the field is a repeated message field. - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option * The parser stores options it doesn't recognize here. See above. * } @@ -288,6 +288,9 @@ class MessageOptions extends \Google\Protobuf\Internal\Message } /** + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. * Whether the message is an automatically generated map entry type for the * maps field. * For maps fields: @@ -303,9 +306,6 @@ class MessageOptions extends \Google\Protobuf\Internal\Message * use a native map in the target language to hold the keys and values. * The reflection APIs in such implementations still need to work as * if the field is a repeated message field. - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. * * Generated from protobuf field optional bool map_entry = 7; * @return bool @@ -326,6 +326,9 @@ class MessageOptions extends \Google\Protobuf\Internal\Message } /** + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. * Whether the message is an automatically generated map entry type for the * maps field. * For maps fields: @@ -341,9 +344,6 @@ class MessageOptions extends \Google\Protobuf\Internal\Message * use a native map in the target language to hold the keys and values. * The reflection APIs in such implementations still need to work as * if the field is a repeated message field. - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. * * Generated from protobuf field optional bool map_entry = 7; * @param bool $var From 0264866ce665911787ba5ca0faf07a5efe2899dd Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Wed, 14 Sep 2022 19:33:54 -0700 Subject: [PATCH 20/20] Use generated WKT code in Bazel builds (#10576) * Use generated WKT code in Bazel builds * Prefer src over external for genrule * Prefer external over src for genrule * Proper fix for windows proto path issues --- BUILD.bazel | 10 -- cmake/install.cmake | 2 +- pkg/BUILD.bazel | 3 +- src/file_lists.cmake | 38 ++++---- src/google/protobuf/BUILD.bazel | 92 ++++++++++++++----- src/google/protobuf/compiler/BUILD.bazel | 39 ++++++-- src/google/protobuf/compiler/cpp/BUILD.bazel | 2 +- .../protobuf/compiler/csharp/BUILD.bazel | 2 +- src/google/protobuf/compiler/java/BUILD.bazel | 2 +- .../protobuf/compiler/objectivec/BUILD.bazel | 2 +- src/google/protobuf/compiler/php/BUILD.bazel | 2 +- .../protobuf/compiler/python/BUILD.bazel | 2 +- src/google/protobuf/compiler/ruby/BUILD.bazel | 2 +- 13 files changed, 127 insertions(+), 71 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 67cd2dbfc4..b63b7bf984 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -294,18 +294,8 @@ alias( proto_lang_toolchain( name = "cc_toolchain", blacklisted_protos = [ - "@com_google_protobuf//:any_proto", - "@com_google_protobuf//:api_proto", "@com_google_protobuf//:compiler_plugin_proto", "@com_google_protobuf//:descriptor_proto", - "@com_google_protobuf//:duration_proto", - "@com_google_protobuf//:empty_proto", - "@com_google_protobuf//:field_mask_proto", - "@com_google_protobuf//:source_context_proto", - "@com_google_protobuf//:struct_proto", - "@com_google_protobuf//:timestamp_proto", - "@com_google_protobuf//:type_proto", - "@com_google_protobuf//:wrappers_proto", ], command_line = "--cpp_out=$(OUT)", runtime = ":protobuf", diff --git a/cmake/install.cmake b/cmake/install.cmake index 90230c537e..26a55be8b6 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -47,7 +47,7 @@ include(${protobuf_SOURCE_DIR}/src/file_lists.cmake) set(protobuf_HEADERS ${libprotobuf_hdrs} ${libprotoc_hdrs} - ${wkt_protos_files} + ${wkt_protos_proto_srcs} ${descriptor_proto_proto_srcs} ${plugin_proto_proto_srcs} ) diff --git a/pkg/BUILD.bazel b/pkg/BUILD.bazel index 812224c0e9..65dc37c0c6 100644 --- a/pkg/BUILD.bazel +++ b/pkg/BUILD.bazel @@ -365,7 +365,8 @@ cc_dist_library( }), tags = ["manual"], deps = [ - "//src/google/protobuf", + "//src/google/protobuf:wkt_cc_proto", + "//src/google/protobuf:protobuf_nowkt", "//src/google/protobuf:arena", "//src/google/protobuf:protobuf_lite", "//src/google/protobuf/compiler:importer", diff --git a/src/file_lists.cmake b/src/file_lists.cmake index 220ffe0cb3..0d6a9f850e 100644 --- a/src/file_lists.cmake +++ b/src/file_lists.cmake @@ -11,10 +11,18 @@ endif() # //pkg:protobuf set(libprotobuf_srcs - ${protobuf_SOURCE_DIR}/src/google/protobuf/any.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/any.pb.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/any_lite.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/api.pb.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/duration.pb.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/empty.pb.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/field_mask.pb.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/source_context.pb.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/struct.pb.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/timestamp.pb.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/type.pb.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/wrappers.pb.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/any.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/any_lite.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/arena.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/arena_config.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/arenastring.cc @@ -24,12 +32,9 @@ set(libprotobuf_srcs ${protobuf_SOURCE_DIR}/src/google/protobuf/descriptor.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/descriptor.pb.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/descriptor_database.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/duration.pb.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/dynamic_message.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/empty.pb.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/extension_set.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/extension_set_heavy.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/field_mask.pb.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/generated_enum_util.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/generated_message_bases.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/generated_message_reflection.cc @@ -58,16 +63,12 @@ set(libprotobuf_srcs ${protobuf_SOURCE_DIR}/src/google/protobuf/repeated_field.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/repeated_ptr_field.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/service.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/source_context.pb.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/struct.pb.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/stubs/bytestream.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/stubs/common.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/stubs/stringprintf.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/stubs/structurally_valid.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/stubs/strutil.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/text_format.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/timestamp.pb.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/type.pb.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/unknown_field_set.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/util/delimited_message_util.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/util/field_comparator.cc @@ -91,14 +92,21 @@ set(libprotobuf_srcs ${protobuf_SOURCE_DIR}/src/google/protobuf/util/type_resolver_util.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/wire_format.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/wire_format_lite.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/wrappers.pb.cc ) # //pkg:protobuf set(libprotobuf_hdrs - ${protobuf_SOURCE_DIR}/src/google/protobuf/any.h ${protobuf_SOURCE_DIR}/src/google/protobuf/any.pb.h ${protobuf_SOURCE_DIR}/src/google/protobuf/api.pb.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/duration.pb.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/empty.pb.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/field_mask.pb.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/source_context.pb.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/struct.pb.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/timestamp.pb.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/type.pb.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/wrappers.pb.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/any.h ${protobuf_SOURCE_DIR}/src/google/protobuf/arena.h ${protobuf_SOURCE_DIR}/src/google/protobuf/arena_config.h ${protobuf_SOURCE_DIR}/src/google/protobuf/arena_impl.h @@ -109,15 +117,12 @@ set(libprotobuf_hdrs ${protobuf_SOURCE_DIR}/src/google/protobuf/descriptor.h ${protobuf_SOURCE_DIR}/src/google/protobuf/descriptor.pb.h ${protobuf_SOURCE_DIR}/src/google/protobuf/descriptor_database.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/duration.pb.h ${protobuf_SOURCE_DIR}/src/google/protobuf/dynamic_message.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/empty.pb.h ${protobuf_SOURCE_DIR}/src/google/protobuf/endian.h ${protobuf_SOURCE_DIR}/src/google/protobuf/explicitly_constructed.h ${protobuf_SOURCE_DIR}/src/google/protobuf/extension_set.h ${protobuf_SOURCE_DIR}/src/google/protobuf/extension_set_inl.h ${protobuf_SOURCE_DIR}/src/google/protobuf/field_access_listener.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/field_mask.pb.h ${protobuf_SOURCE_DIR}/src/google/protobuf/generated_enum_reflection.h ${protobuf_SOURCE_DIR}/src/google/protobuf/generated_enum_util.h ${protobuf_SOURCE_DIR}/src/google/protobuf/generated_message_bases.h @@ -158,8 +163,6 @@ set(libprotobuf_hdrs ${protobuf_SOURCE_DIR}/src/google/protobuf/repeated_field.h ${protobuf_SOURCE_DIR}/src/google/protobuf/repeated_ptr_field.h ${protobuf_SOURCE_DIR}/src/google/protobuf/service.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/source_context.pb.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/struct.pb.h ${protobuf_SOURCE_DIR}/src/google/protobuf/stubs/bytestream.h ${protobuf_SOURCE_DIR}/src/google/protobuf/stubs/callback.h ${protobuf_SOURCE_DIR}/src/google/protobuf/stubs/common.h @@ -172,8 +175,6 @@ set(libprotobuf_hdrs ${protobuf_SOURCE_DIR}/src/google/protobuf/stubs/stringprintf.h ${protobuf_SOURCE_DIR}/src/google/protobuf/stubs/strutil.h ${protobuf_SOURCE_DIR}/src/google/protobuf/text_format.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/timestamp.pb.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/type.pb.h ${protobuf_SOURCE_DIR}/src/google/protobuf/unknown_field_set.h ${protobuf_SOURCE_DIR}/src/google/protobuf/util/delimited_message_util.h ${protobuf_SOURCE_DIR}/src/google/protobuf/util/field_comparator.h @@ -202,7 +203,6 @@ set(libprotobuf_hdrs ${protobuf_SOURCE_DIR}/src/google/protobuf/util/type_resolver_util.h ${protobuf_SOURCE_DIR}/src/google/protobuf/wire_format.h ${protobuf_SOURCE_DIR}/src/google/protobuf/wire_format_lite.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/wrappers.pb.h ) # //pkg:protobuf_lite diff --git a/src/google/protobuf/BUILD.bazel b/src/google/protobuf/BUILD.bazel index 7a6fc12db6..91aaab9e30 100644 --- a/src/google/protobuf/BUILD.bazel +++ b/src/google/protobuf/BUILD.bazel @@ -81,6 +81,57 @@ proto_library( strip_import_prefix = "/src", ) +# Generate code for the well-known types on demand. +# This needs to be done in a separate genrule because we publish protoc and the +# C++ runtime with the WKT code linked in. We need to use a stripped down +# compiler and runtime library to generate them, and cc_proto_library doesn't +# support swapping out the compiler binary (even though a custom runtime can +# be passed to proto_lang_toolchain). +# +# TODO(b/246826624) We still check in generated pb.h and pb.cc files purely to +# support CMake builds. These aren't used at all by Bazel and will be removed +# in the future once CMake can generate them too. + +WELL_KNOWN_TYPES = [ + "any", + "api", + "duration", + "empty", + "field_mask", + "source_context", + "struct", + "timestamp", + "type", + "wrappers", +] + +genrule( + name = "gen_wkt_cc_sources", + srcs = [wkt + ".proto" for wkt in WELL_KNOWN_TYPES], + exec_tools = ["//src/google/protobuf/compiler:protoc_nowkt"], + outs = + [wkt + ".pb.h" for wkt in WELL_KNOWN_TYPES] + + [wkt + ".pb.cc" for wkt in WELL_KNOWN_TYPES], + cmd = """ + $(execpath //src/google/protobuf/compiler:protoc_nowkt) \ + --cpp_out=$(RULEDIR)/../.. \ + --proto_path=$$(dirname $$(dirname $$(dirname $(location any.proto)))) \ + $(SRCS) + """, + visibility = ["//visibility:private"], +) + +cc_library( + name = "wkt_cc_proto", + srcs = [wkt + ".pb.cc" for wkt in WELL_KNOWN_TYPES], + hdrs = [wkt + ".pb.h" for wkt in WELL_KNOWN_TYPES], + deps = [":protobuf_nowkt"], + copts = COPTS, + include_prefix = "google/protobuf", + linkopts = LINK_OPTS, + visibility = ["//pkg:__pkg__"], +) + # Built-in runtime types proto_library( @@ -211,19 +262,14 @@ cc_library( ) cc_library( - name = "protobuf", + name = "protobuf_nowkt", srcs = [ "any.cc", - "any.pb.cc", - "api.pb.cc", "descriptor.cc", "descriptor.pb.cc", "descriptor_database.cc", - "duration.pb.cc", "dynamic_message.cc", - "empty.pb.cc", "extension_set_heavy.cc", - "field_mask.pb.cc", "generated_message_bases.cc", "generated_message_reflection.cc", "generated_message_tctable_full.cc", @@ -232,26 +278,16 @@ cc_library( "message.cc", "reflection_ops.cc", "service.cc", - "source_context.pb.cc", - "struct.pb.cc", "text_format.cc", - "timestamp.pb.cc", - "type.pb.cc", "unknown_field_set.cc", "wire_format.cc", - "wrappers.pb.cc", ], hdrs = [ - "any.pb.h", - "api.pb.h", "descriptor.h", "descriptor.pb.h", "descriptor_database.h", - "duration.pb.h", "dynamic_message.h", - "empty.pb.h", "field_access_listener.h", - "field_mask.pb.h", "generated_enum_reflection.h", "generated_message_bases.h", "generated_message_reflection.h", @@ -265,25 +301,19 @@ cc_library( "reflection_internal.h", "reflection_ops.h", "service.h", - "source_context.pb.h", - "struct.pb.h", "text_format.h", - "timestamp.pb.h", - "type.pb.h", "unknown_field_set.h", "wire_format.h", - "wrappers.pb.h", ], copts = COPTS, include_prefix = "google/protobuf", linkopts = LINK_OPTS, visibility = [ - "//:__pkg__", "//pkg:__pkg__", "//src/google/protobuf:__subpackages__", ], deps = [ - ":protobuf_lite", + ":protobuf_lite", "//src/google/protobuf/io", "//src/google/protobuf/io:gzip_stream", "//src/google/protobuf/io:printer", @@ -300,6 +330,22 @@ cc_library( ], ) +cc_library( + name = "protobuf", + deps = [ + ":protobuf_nowkt", + ":wkt_cc_proto", + ], + copts = COPTS, + include_prefix = "google/protobuf", + linkopts = LINK_OPTS, + visibility = [ + "//:__pkg__", + "//pkg:__pkg__", + "//src/google/protobuf:__subpackages__", + ], +) + # This provides just the header files for use in projects that need to build # shared libraries for dynamic loading. This target is available until Bazel # adds native support for such use cases. diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel index 62e0d3992a..50901c3c11 100644 --- a/src/google/protobuf/compiler/BUILD.bazel +++ b/src/google/protobuf/compiler/BUILD.bazel @@ -11,7 +11,7 @@ load( ) load("@rules_proto//proto:defs.bzl", "proto_library") load("//build_defs:arch_tests.bzl", "aarch64_test", "x86_64_test") -load("//build_defs:cpp_opts.bzl", "COPTS") +load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS", "PROTOC_LINK_OPTS") proto_library( name = "plugin_proto", @@ -37,7 +37,7 @@ cc_library( include_prefix = "google/protobuf/compiler", visibility = ["//visibility:public"], deps = [ - "//src/google/protobuf", + "//src/google/protobuf:protobuf_nowkt", "@com_google_absl//absl/strings", ], ) @@ -59,7 +59,7 @@ cc_library( include_prefix = "google/protobuf/compiler", visibility = ["//visibility:public"], deps = [ - "//:protobuf", + "//src/google/protobuf:protobuf_nowkt", "@com_google_absl//absl/strings", ], ) @@ -82,26 +82,22 @@ cc_library( deps = [ ":code_generator", ":importer", - "//:protobuf", + "//src/google/protobuf:protobuf_nowkt", "@com_google_absl//absl/strings", ], ) cc_library( - name = "protoc_lib", + name = "protoc_lib_nowkt", srcs = [ "main.cc", ], copts = COPTS, - visibility = [ - "//:__pkg__", - "//pkg:__pkg__", - ], deps = [ ":code_generator", ":command_line_interface", ":importer", - "//:protobuf", + "//src/google/protobuf:protobuf_nowkt", "//src/google/protobuf/compiler/cpp", "//src/google/protobuf/compiler/csharp", "//src/google/protobuf/compiler/java", @@ -112,6 +108,29 @@ cc_library( ], ) +cc_binary( + name = "protoc_nowkt", + copts = COPTS, + linkopts = LINK_OPTS + PROTOC_LINK_OPTS, + visibility = [ + "//src/google/protobuf:__pkg__", + ], + deps = [":protoc_lib_nowkt"], +) + +cc_library( + name = "protoc_lib", + copts = COPTS, + visibility = [ + "//:__pkg__", + "//pkg:__pkg__", + ], + deps = [ + "//:protobuf", + ":protoc_lib_nowkt", + ], +) + # Note: this is an alias for now. In the future, this rule will become the # cc_binary for protoc, and //:protoc will become an alias. alias( diff --git a/src/google/protobuf/compiler/cpp/BUILD.bazel b/src/google/protobuf/compiler/cpp/BUILD.bazel index 1798fce624..4a17bc10f0 100644 --- a/src/google/protobuf/compiler/cpp/BUILD.bazel +++ b/src/google/protobuf/compiler/cpp/BUILD.bazel @@ -53,7 +53,7 @@ cc_library( "//src/google/protobuf/compiler:__pkg__", ], deps = [ - "//:protobuf", + "//src/google/protobuf:protobuf_nowkt", "//src/google/protobuf/compiler:code_generator", "@com_google_absl//absl/base:core_headers", "@com_google_absl//absl/container:flat_hash_map", diff --git a/src/google/protobuf/compiler/csharp/BUILD.bazel b/src/google/protobuf/compiler/csharp/BUILD.bazel index ce29ea6b5d..df3d7bfb17 100644 --- a/src/google/protobuf/compiler/csharp/BUILD.bazel +++ b/src/google/protobuf/compiler/csharp/BUILD.bazel @@ -56,7 +56,7 @@ cc_library( "//src/google/protobuf/compiler:__pkg__", ], deps = [ - "//:protobuf", + "//src/google/protobuf:protobuf_nowkt", "//src/google/protobuf/compiler:code_generator", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/strings", diff --git a/src/google/protobuf/compiler/java/BUILD.bazel b/src/google/protobuf/compiler/java/BUILD.bazel index 06d90f67ba..5c4d5f162d 100644 --- a/src/google/protobuf/compiler/java/BUILD.bazel +++ b/src/google/protobuf/compiler/java/BUILD.bazel @@ -81,7 +81,7 @@ cc_library( "//src/google/protobuf/compiler:__pkg__", ], deps = [ - "//:protobuf", + "//src/google/protobuf:protobuf_nowkt", "//src/google/protobuf/compiler:code_generator", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/strings", diff --git a/src/google/protobuf/compiler/objectivec/BUILD.bazel b/src/google/protobuf/compiler/objectivec/BUILD.bazel index d1cb4604f1..defcf29183 100644 --- a/src/google/protobuf/compiler/objectivec/BUILD.bazel +++ b/src/google/protobuf/compiler/objectivec/BUILD.bazel @@ -44,7 +44,7 @@ cc_library( "//src/google/protobuf/compiler:__pkg__", ], deps = [ - "//:protobuf", + "//src/google/protobuf:protobuf_nowkt", "//src/google/protobuf/compiler:code_generator", "@com_google_absl//absl/strings", ], diff --git a/src/google/protobuf/compiler/php/BUILD.bazel b/src/google/protobuf/compiler/php/BUILD.bazel index 5911760be9..d2540189d1 100644 --- a/src/google/protobuf/compiler/php/BUILD.bazel +++ b/src/google/protobuf/compiler/php/BUILD.bazel @@ -17,7 +17,7 @@ cc_library( "//src/google/protobuf/compiler:__pkg__", ], deps = [ - "//:protobuf", + "//src/google/protobuf:protobuf_nowkt", "//src/google/protobuf/compiler:code_generator", "@com_google_absl//absl/strings", ], diff --git a/src/google/protobuf/compiler/python/BUILD.bazel b/src/google/protobuf/compiler/python/BUILD.bazel index b45a00b808..fadb1767cc 100644 --- a/src/google/protobuf/compiler/python/BUILD.bazel +++ b/src/google/protobuf/compiler/python/BUILD.bazel @@ -25,7 +25,7 @@ cc_library( "//src/google/protobuf/compiler:__pkg__", ], deps = [ - "//:protobuf", + "//src/google/protobuf:protobuf_nowkt", "//src/google/protobuf/compiler:code_generator", "@com_google_absl//absl/strings", "@com_google_absl//absl/synchronization", diff --git a/src/google/protobuf/compiler/ruby/BUILD.bazel b/src/google/protobuf/compiler/ruby/BUILD.bazel index 73b0fcf96e..7abfeb60dd 100644 --- a/src/google/protobuf/compiler/ruby/BUILD.bazel +++ b/src/google/protobuf/compiler/ruby/BUILD.bazel @@ -17,7 +17,7 @@ cc_library( "//src/google/protobuf/compiler:__pkg__", ], deps = [ - "//:protobuf", + "//src/google/protobuf:protobuf_nowkt", "//src/google/protobuf/compiler:code_generator", ], )