diff --git a/.github/mergeable.yml b/.github/mergeable.yml
index 8577f086ee..4027cf5a9f 100644
--- a/.github/mergeable.yml
+++ b/.github/mergeable.yml
@@ -11,8 +11,8 @@ mergeable:
regex: 'release notes: yes'
message: 'Please include release notes: yes'
- must_include:
- regex: '^(c#|c\+\+|cleanup|conformance tests|integration|java|javascript|go|objective-c|php|python|ruby|bazel|cmake|protoc)'
- message: 'Please include at least a language label (e.g., c++, java, python). Or apply one of the following labels: bazel, cmake, cleanup, conformance tests, integration, protoc.'
+ regex: '^(autotools|bazel|c#|c\+\+|cleanup|cmake|conformance tests|integration|go|java|javascript|objective-c|php|protoc|python|ruby)'
+ message: 'Please include at least a language label (e.g., c++, java, python). Or apply one of the following labels: autotools, bazel, cmake, cleanup, conformance tests, integration, protoc.'
- must_include:
regex: 'release notes: no'
message: 'Please include release notes: no'
diff --git a/BUILD b/BUILD
index 1124321602..07ee629a18 100644
--- a/BUILD
+++ b/BUILD
@@ -14,38 +14,6 @@ exports_files(["LICENSE"])
# build configuration
################################################################################
-# TODO(yannic): Remove in 3.14.0.
-string_flag(
- name = "incompatible_use_com_google_googletest",
- build_setting_default = "true",
- values = ["true", "false"]
-)
-
-config_setting(
- name = "use_com_google_googletest",
- flag_values = {
- "//:incompatible_use_com_google_googletest": "true"
- },
-)
-
-GTEST = select({
- "//:use_com_google_googletest": [
- "@com_google_googletest//:gtest",
- ],
- "//conditions:default": [
- "//external:gtest",
- ],
-})
-
-GTEST_MAIN = select({
- "//:use_com_google_googletest": [
- "@com_google_googletest//:gtest_main",
- ],
- "//conditions:default": [
- "//external:gtest_main",
- ],
-})
-
################################################################################
# ZLIB configuration
################################################################################
@@ -571,6 +539,7 @@ COMMON_TEST_SRCS = [
cc_binary(
name = "test_plugin",
+ testonly = True,
srcs = [
# AUTOGEN(test_plugin_srcs)
"src/google/protobuf/compiler/mock_code_generator.cc",
@@ -580,7 +549,8 @@ cc_binary(
deps = [
":protobuf",
":protoc_lib",
- ] + GTEST,
+ "@com_google_googletest//:gtest",
+ ],
)
cc_test(
@@ -592,7 +562,9 @@ cc_test(
],
deps = [
":protobuf_lite",
- ] + GTEST_MAIN,
+ "@com_google_googletest//:gtest",
+ "@com_google_googletest//:gtest_main",
+ ],
)
cc_test(
@@ -695,7 +667,9 @@ cc_test(
":cc_test_protos",
":protobuf",
":protoc_lib",
- ] + PROTOBUF_DEPS + GTEST_MAIN,
+ "@com_google_googletest//:gtest",
+ "@com_google_googletest//:gtest_main",
+ ] + PROTOBUF_DEPS,
)
################################################################################
diff --git a/CHANGES.txt b/CHANGES.txt
index d73ef274c5..ef79313b59 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,46 @@
+Unreleased Changes (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
+
+ C++
+ * Allow MessageDifferencer::TreatAsSet() (and friends) to override previous
+ calls instead of crashing.
+ * Reduce the size of generated proto headers for protos with `string` or
+ `bytes` fields.
+ * Move arena() operation on uncommon path to out-of-line routine
+ * For iterator-pair function parameter types, take both iterators by value.
+ * Code-space savings and perhaps some modest performance improvements in
+ RepeatedPtrField.
+
+ Java:
+ * Exceptions thrown while reading from an InputStream in parseFrom are now included as causes.
+
+2021-03-10 version 3.15.6 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
+
+ Ruby
+ * Fixed bug in string comparison logic (#8386)
+
+2021-03-04 version 3.15.5 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
+
+ Ruby
+ * Fixed quadratic memory use in array append (#8379)
+
+ PHP
+ * Fixed quadratic memory use in array append (#8379)
+
+ C++
+ * Do not disable RTTI by default in the CMake build (#8377)
+
+2021-03-02 version 3.15.4 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
+
+ Ruby
+ * Fixed SEGV when users pass nil messages (#8363)
+ * Fixed quadratic memory usage when appending to arrays (#8364)
+
+ C++
+ * Create a CMake option to control whether or not RTTI is enabled (#8361)
+
+ PHP
+ * read_property() handler is not supposed to return NULL (#8362)
+
2021-02-25 version 3.15.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Ruby
diff --git a/Makefile.am b/Makefile.am
index 53b259480a..915184213c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -529,7 +529,6 @@ java_EXTRA_DIST=
java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto \
java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto \
java/core/src/test/proto/com/google/protobuf/test_custom_options.proto \
- java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto \
java/core/src/test/proto/com/google/protobuf/wrappers_test.proto \
java/lite.md \
java/lite/BUILD \
diff --git a/Protobuf.podspec b/Protobuf.podspec
index b2958e0283..b61cafc518 100644
--- a/Protobuf.podspec
+++ b/Protobuf.podspec
@@ -5,7 +5,7 @@
# dependent projects use the :git notation to refer to the library.
Pod::Spec.new do |s|
s.name = 'Protobuf'
- s.version = '3.15.3'
+ s.version = '3.15.6'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/protocolbuffers/protobuf'
s.license = '3-Clause BSD License'
diff --git a/WORKSPACE b/WORKSPACE
index 5a767a97c0..4346dbd906 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -17,6 +17,15 @@ http_archive(
],
)
+http_archive(
+ name = "com_github_google_benchmark",
+ sha256 = "2a778d821997df7d8646c9c59b8edb9a573a6e04c534c01892a40aa524a7b68c",
+ strip_prefix = "benchmark-bf585a2789e30585b4e3ce6baf11ef2750b54677",
+ urls = [
+ "https://github.com/google/benchmark/archive/bf585a2789e30585b4e3ce6baf11ef2750b54677.zip",
+ ],
+)
+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//:protobuf_deps.bzl", "protobuf_deps")
@@ -29,18 +38,6 @@ bind(
actual = "//util/python:python_headers",
)
-# TODO(yannic): Remove in 3.14.0.
-bind(
- name = "gtest",
- actual = "@com_google_googletest//:gtest",
-)
-
-# TODO(yannic): Remove in 3.14.0.
-bind(
- name = "gtest_main",
- actual = "@com_google_googletest//:gtest_main",
-)
-
jvm_maven_import_external(
name = "guava_maven",
artifact = "com.google.guava:guava:18.0",
diff --git a/benchmarks/BUILD b/benchmarks/BUILD
new file mode 100644
index 0000000000..8e6063ba83
--- /dev/null
+++ b/benchmarks/BUILD
@@ -0,0 +1,65 @@
+load("@rules_cc//cc:defs.bzl", "cc_proto_library")
+load("@rules_java//java:defs.bzl", "java_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+
+proto_library(
+ name = "benchmarks_proto",
+ srcs = [
+ "benchmarks.proto",
+ ],
+ strip_import_prefix = "/benchmarks",
+ visibility = [
+ "//benchmarks:__subpackages__",
+ ],
+)
+
+cc_proto_library(
+ name = "benchmarks_cc_proto",
+ visibility = [
+ "//benchmarks:__subpackages__",
+ ],
+ deps = [
+ "benchmarks_proto",
+ ],
+)
+
+java_proto_library(
+ name = "benchmarks_java_proto",
+ visibility = [
+ "//benchmarks:__subpackages__",
+ ],
+ deps = [
+ "benchmarks_proto",
+ ],
+)
+
+proto_library(
+ name = "google_size_proto",
+ srcs = [
+ "google_size.proto",
+ ],
+ strip_import_prefix = "/benchmarks",
+ visibility = [
+ "//benchmarks:__subpackages__",
+ ],
+)
+
+cc_proto_library(
+ name = "google_size_cc_proto",
+ visibility = [
+ "//benchmarks:__subpackages__",
+ ],
+ deps = [
+ "google_size_proto",
+ ],
+)
+
+java_proto_library(
+ name = "google_size_java_proto",
+ visibility = [
+ "//benchmarks:__subpackages__",
+ ],
+ deps = [
+ "google_size_proto",
+ ],
+)
diff --git a/benchmarks/cpp/BUILD b/benchmarks/cpp/BUILD
new file mode 100644
index 0000000000..b744f896ad
--- /dev/null
+++ b/benchmarks/cpp/BUILD
@@ -0,0 +1,15 @@
+load("@rules_cc//cc:defs.bzl", "cc_binary")
+
+cc_binary(
+ name = "cpp",
+ srcs = [
+ "cpp_benchmark.cc",
+ ],
+ tags = ["benchmark"],
+ deps = [
+ "//:protobuf",
+ "//benchmarks:benchmarks_cc_proto",
+ "//benchmarks/datasets:cc_protos",
+ "@com_github_google_benchmark//:benchmark_main",
+ ],
+)
diff --git a/benchmarks/datasets/BUILD b/benchmarks/datasets/BUILD
new file mode 100644
index 0000000000..f29a27650b
--- /dev/null
+++ b/benchmarks/datasets/BUILD
@@ -0,0 +1,59 @@
+load("@rules_cc//cc:defs.bzl", "cc_library")
+load("@rules_java//java:defs.bzl", "java_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+
+filegroup(
+ name = "datasets",
+ srcs = [
+ "//benchmarks/datasets/google_message1/proto2:datasets",
+ "//benchmarks/datasets/google_message1/proto3:datasets",
+ "//benchmarks/datasets/google_message2:datasets",
+ "//benchmarks/datasets/google_message3:datasets",
+ "//benchmarks/datasets/google_message4:datasets",
+ ],
+ visibility = [
+ "//benchmarks:__subpackages__",
+ ],
+)
+
+proto_library(
+ name = "protos",
+ visibility = [
+ "//benchmarks:__subpackages__",
+ ],
+ deps = [
+ "//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_proto",
+ "//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_proto",
+ "//benchmarks/datasets/google_message2:benchmark_message2_proto",
+ "//benchmarks/datasets/google_message3:benchmark_message3_proto",
+ "//benchmarks/datasets/google_message4:benchmark_message4_proto",
+ ],
+)
+
+cc_library(
+ name = "cc_protos",
+ visibility = [
+ "//benchmarks:__subpackages__",
+ ],
+ deps = [
+ "//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_cc_proto",
+ "//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_cc_proto",
+ "//benchmarks/datasets/google_message2:benchmark_message2_cc_proto",
+ "//benchmarks/datasets/google_message3:benchmark_message3_cc_proto",
+ "//benchmarks/datasets/google_message4:benchmark_message4_cc_proto",
+ ],
+)
+
+java_library(
+ name = "java_protos",
+ visibility = [
+ "//benchmarks:__subpackages__",
+ ],
+ exports = [
+ "//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_java_proto",
+ "//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_java_proto",
+ "//benchmarks/datasets/google_message2:benchmark_message2_java_proto",
+ "//benchmarks/datasets/google_message3:benchmark_message3_java_proto",
+ "//benchmarks/datasets/google_message4:benchmark_message4_java_proto",
+ ],
+)
diff --git a/benchmarks/datasets/google_message1/proto2/BUILD b/benchmarks/datasets/google_message1/proto2/BUILD
new file mode 100644
index 0000000000..d4d38cec22
--- /dev/null
+++ b/benchmarks/datasets/google_message1/proto2/BUILD
@@ -0,0 +1,44 @@
+load("@rules_cc//cc:defs.bzl", "cc_proto_library")
+load("@rules_java//java:defs.bzl", "java_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+
+filegroup(
+ name = "datasets",
+ srcs = [
+ "dataset.google_message1_proto2.pb",
+ ],
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+)
+
+proto_library(
+ name = "benchmark_message1_proto2_proto",
+ srcs = [
+ "benchmark_message1_proto2.proto",
+ ],
+ strip_import_prefix = "/benchmarks",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+)
+
+cc_proto_library(
+ name = "benchmark_message1_proto2_cc_proto",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+ deps = [
+ "benchmark_message1_proto2_proto",
+ ],
+)
+
+java_proto_library(
+ name = "benchmark_message1_proto2_java_proto",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+ deps = [
+ "benchmark_message1_proto2_proto",
+ ],
+)
diff --git a/benchmarks/datasets/google_message1/proto3/BUILD b/benchmarks/datasets/google_message1/proto3/BUILD
new file mode 100644
index 0000000000..c2d627acd8
--- /dev/null
+++ b/benchmarks/datasets/google_message1/proto3/BUILD
@@ -0,0 +1,44 @@
+load("@rules_cc//cc:defs.bzl", "cc_proto_library")
+load("@rules_java//java:defs.bzl", "java_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+
+filegroup(
+ name = "datasets",
+ srcs = [
+ "dataset.google_message1_proto3.pb",
+ ],
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+)
+
+proto_library(
+ name = "benchmark_message1_proto3_proto",
+ srcs = [
+ "benchmark_message1_proto3.proto",
+ ],
+ strip_import_prefix = "/benchmarks",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+)
+
+cc_proto_library(
+ name = "benchmark_message1_proto3_cc_proto",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+ deps = [
+ "benchmark_message1_proto3_proto",
+ ],
+)
+
+java_proto_library(
+ name = "benchmark_message1_proto3_java_proto",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+ deps = [
+ "benchmark_message1_proto3_proto",
+ ],
+)
diff --git a/benchmarks/datasets/google_message2/BUILD b/benchmarks/datasets/google_message2/BUILD
new file mode 100644
index 0000000000..1ca87fb64f
--- /dev/null
+++ b/benchmarks/datasets/google_message2/BUILD
@@ -0,0 +1,44 @@
+load("@rules_cc//cc:defs.bzl", "cc_proto_library")
+load("@rules_java//java:defs.bzl", "java_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+
+filegroup(
+ name = "datasets",
+ srcs = [
+ "dataset.google_message2.pb",
+ ],
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+)
+
+proto_library(
+ name = "benchmark_message2_proto",
+ srcs = [
+ "benchmark_message2.proto",
+ ],
+ strip_import_prefix = "/benchmarks",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+)
+
+cc_proto_library(
+ name = "benchmark_message2_cc_proto",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+ deps = [
+ "benchmark_message2_proto",
+ ],
+)
+
+java_proto_library(
+ name = "benchmark_message2_java_proto",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+ deps = [
+ "benchmark_message2_proto",
+ ],
+)
diff --git a/benchmarks/datasets/google_message3/BUILD b/benchmarks/datasets/google_message3/BUILD
new file mode 100644
index 0000000000..9a00294464
--- /dev/null
+++ b/benchmarks/datasets/google_message3/BUILD
@@ -0,0 +1,50 @@
+load("@rules_cc//cc:defs.bzl", "cc_proto_library")
+load("@rules_java//java:defs.bzl", "java_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+
+filegroup(
+ name = "datasets",
+ srcs = [],
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+)
+
+proto_library(
+ name = "benchmark_message3_proto",
+ srcs = [
+ "benchmark_message3.proto",
+ "benchmark_message3_1.proto",
+ "benchmark_message3_2.proto",
+ "benchmark_message3_3.proto",
+ "benchmark_message3_4.proto",
+ "benchmark_message3_5.proto",
+ "benchmark_message3_6.proto",
+ "benchmark_message3_7.proto",
+ "benchmark_message3_8.proto",
+ ],
+ strip_import_prefix = "/benchmarks",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+)
+
+cc_proto_library(
+ name = "benchmark_message3_cc_proto",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+ deps = [
+ "benchmark_message3_proto",
+ ],
+)
+
+java_proto_library(
+ name = "benchmark_message3_java_proto",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+ deps = [
+ "benchmark_message3_proto",
+ ],
+)
diff --git a/benchmarks/datasets/google_message4/BUILD b/benchmarks/datasets/google_message4/BUILD
new file mode 100644
index 0000000000..b23a4c955c
--- /dev/null
+++ b/benchmarks/datasets/google_message4/BUILD
@@ -0,0 +1,45 @@
+load("@rules_cc//cc:defs.bzl", "cc_proto_library")
+load("@rules_java//java:defs.bzl", "java_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+
+filegroup(
+ name = "datasets",
+ srcs = [],
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+)
+
+proto_library(
+ name = "benchmark_message4_proto",
+ srcs = [
+ "benchmark_message4.proto",
+ "benchmark_message4_1.proto",
+ "benchmark_message4_2.proto",
+ "benchmark_message4_3.proto",
+ ],
+ strip_import_prefix = "/benchmarks",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+)
+
+cc_proto_library(
+ name = "benchmark_message4_cc_proto",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+ deps = [
+ "benchmark_message4_proto",
+ ],
+)
+
+java_proto_library(
+ name = "benchmark_message4_java_proto",
+ visibility = [
+ "//benchmarks/datasets:__pkg__",
+ ],
+ deps = [
+ "benchmark_message4_proto",
+ ],
+)
diff --git a/conformance/text_format_conformance_suite.cc b/conformance/text_format_conformance_suite.cc
index 4c9dc7dbe0..460bc24900 100644
--- a/conformance/text_format_conformance_suite.cc
+++ b/conformance/text_format_conformance_suite.cc
@@ -451,6 +451,27 @@ void TextFormatConformanceTestSuite::RunSuiteImpl() {
}
)",
prototype);
+
+ prototype.Clear();
+ ConformanceRequestSetting setting_map(
+ REQUIRED, conformance::TEXT_FORMAT, conformance::PROTOBUF,
+ conformance::TEXT_FORMAT_TEST, prototype, "DuplicateMapKey", R"(
+ map_string_nested_message {
+ key: "duplicate"
+ value: { a: 123 }
+ }
+ map_string_nested_message {
+ key: "duplicate"
+ value: { corecursive: {} }
+ }
+ )");
+ // The last-specified value will be retained in a parsed map
+ RunValidInputTest(setting_map, R"(
+ map_string_nested_message {
+ key: "duplicate"
+ value: { corecursive: {} }
+ }
+ )");
}
} // namespace protobuf
diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec
index 60c7fecda9..c6f019a13c 100644
--- a/csharp/Google.Protobuf.Tools.nuspec
+++ b/csharp/Google.Protobuf.Tools.nuspec
@@ -5,7 +5,7 @@
Google Protocol Buffers tools
Tools for Protocol Buffers - Google's data interchange format.
See project site for more info.
- 3.15.3
+ 3.15.6
Google Inc.
protobuf-packages
https://github.com/protocolbuffers/protobuf/blob/master/LICENSE
diff --git a/csharp/src/Google.Protobuf.Test/testprotos.pb b/csharp/src/Google.Protobuf.Test/testprotos.pb
index 3cf55f9d4d..06a17c1038 100644
Binary files a/csharp/src/Google.Protobuf.Test/testprotos.pb and b/csharp/src/Google.Protobuf.Test/testprotos.pb differ
diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj
index 23517d4ca3..9969a45f52 100644
--- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj
+++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj
@@ -4,7 +4,7 @@
C# runtime library for Protocol Buffers - Google's data interchange format.
Copyright 2015, Google Inc.
Google Protocol Buffers
- 3.15.3
+ 3.15.6
7.2
Google Inc.
diff --git a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs
index 0a1f4a7440..5c5b2ffaf4 100644
--- a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs
+++ b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs
@@ -107,57 +107,58 @@ namespace Google.Protobuf.Reflection {
"eV9wYWNrYWdlGC0gASgJEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMo",
"CzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uIjoKDE9w",
"dGltaXplTW9kZRIJCgVTUEVFRBABEg0KCUNPREVfU0laRRACEhAKDExJVEVf",
- "UlVOVElNRRADKgkI6AcQgICAgAJKBAgmECci8gEKDk1lc3NhZ2VPcHRpb25z",
+ "UlVOVElNRRADKgkI6AcQgICAgAJKBAgmECcihAIKDk1lc3NhZ2VPcHRpb25z",
"EiYKF21lc3NhZ2Vfc2V0X3dpcmVfZm9ybWF0GAEgASgIOgVmYWxzZRIuCh9u",
"b19zdGFuZGFyZF9kZXNjcmlwdG9yX2FjY2Vzc29yGAIgASgIOgVmYWxzZRIZ",
"CgpkZXByZWNhdGVkGAMgASgIOgVmYWxzZRIRCgltYXBfZW50cnkYByABKAgS",
"QwoUdW5pbnRlcn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vbhgBIAMoCzIoLmdvb2dsZS5w",
+ "cm90b2J1Zi5Tb3VyY2VDb2RlSW5mby5Mb2NhdGlvbhqGAQoITG9jYXRpb24S",
+ "EAoEcGF0aBgBIAMoBUICEAESEAoEc3BhbhgCIAMoBUICEAESGAoQbGVhZGlu",
+ "Z19jb21tZW50cxgDIAEoCRIZChF0cmFpbGluZ19jb21tZW50cxgEIAEoCRIh",
+ "ChlsZWFkaW5nX2RldGFjaGVkX2NvbW1lbnRzGAYgAygJIqcBChFHZW5lcmF0",
+ "ZWRDb2RlSW5mbxJBCgphbm5vdGF0aW9uGAEgAygLMi0uZ29vZ2xlLnByb3Rv",
+ "YnVmLkdlbmVyYXRlZENvZGVJbmZvLkFubm90YXRpb24aTwoKQW5ub3RhdGlv",
+ "bhIQCgRwYXRoGAEgAygFQgIQARITCgtzb3VyY2VfZmlsZRgCIAEoCRINCgVi",
+ "ZWdpbhgDIAEoBRILCgNlbmQYBCABKAVCfgoTY29tLmdvb2dsZS5wcm90b2J1",
+ "ZkIQRGVzY3JpcHRvclByb3Rvc0gBWi1nb29nbGUuZ29sYW5nLm9yZy9wcm90",
+ "b2J1Zi90eXBlcy9kZXNjcmlwdG9ycGL4AQGiAgNHUEKqAhpHb29nbGUuUHJv",
+ "dG9idWYuUmVmbGVjdGlvbg=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
diff --git a/docs/implementing_proto3_presence.md b/docs/implementing_proto3_presence.md
index 73f21a3829..ae8b369579 100644
--- a/docs/implementing_proto3_presence.md
+++ b/docs/implementing_proto3_presence.md
@@ -261,7 +261,7 @@ bool FieldHasPresence(const google::protobuf::FieldDescriptor* field) {
Old:
```c++
-bool FieldIsInOneof(const google::protobuf::FielDescriptor* field) {
+bool FieldIsInOneof(const google::protobuf::FieldDescriptor* field) {
return field->containing_oneof() != nullptr;
}
```
@@ -269,7 +269,7 @@ bool FieldIsInOneof(const google::protobuf::FielDescriptor* field) {
New:
```c++
-bool FieldIsInOneof(const google::protobuf::FielDescriptor* field) {
+bool FieldIsInOneof(const google::protobuf::FieldDescriptor* field) {
// real_containing_oneof() returns nullptr for synthetic oneofs.
return field->real_containing_oneof() != nullptr;
}
diff --git a/docs/options.md b/docs/options.md
index 907fe5aa02..79a085e0be 100644
--- a/docs/options.md
+++ b/docs/options.md
@@ -268,3 +268,11 @@ with info about your project (name and website) so we can add an entry for you.
1. Protoc-gen-sanitize
* Website: https://github.com/Intrinsec/protoc-gen-sanitize
* Extension: 1102-1106
+
+1. Coach Client Connect (planned release in March 2021)
+ * Website: https://www.coachclientconnect.com
+ * Extension: 1107
+
+1. Kratos API Errors
+ * Website: https://go-kratos.dev
+ * Extension: 1108
diff --git a/docs/third_party.md b/docs/third_party.md
index 7799e308a7..9d490c0a6e 100644
--- a/docs/third_party.md
+++ b/docs/third_party.md
@@ -11,6 +11,7 @@ These are projects we know about implementing Protocol Buffers for other program
* Action Script: https://code.google.com/p/protoc-gen-as3/
* Action Script: https://github.com/matrix3d/JProtoc
* Action Script: https://github.com/zhongfq/protobuf-as3/
+* Ada: https://github.com/reznikmm/protobuf
* C: https://github.com/protobuf-c/protobuf-c
* C: http://koti.kapsi.fi/jpa/nanopb/
* C: https://github.com/cloudwu/pbc/
@@ -101,7 +102,6 @@ These are projects we know about implementing Protocol Buffers for other program
* Solidity: https://github.com/celer-network/pb3-gen-sol
* Swift: https://github.com/alexeyxo/protobuf-swift
* Swift: https://github.com/apple/swift-protobuf/
-* Typescript: https://github.com/y3llowcake/protoc-gen-ts
* Vala: https://launchpad.net/protobuf-vala
* Visual Basic: http://code.google.com/p/protobuf-net/
diff --git a/java/README.md b/java/README.md
index c8050893e0..c3434144b1 100644
--- a/java/README.md
+++ b/java/README.md
@@ -23,7 +23,7 @@ If you are using Maven, use the following:
com.google.protobuf
protobuf-java
- 3.11.0
+ 3.15.3
```
@@ -37,7 +37,7 @@ protobuf-java-util package:
com.google.protobuf
protobuf-java-util
- 3.11.0
+ 3.15.3
```
diff --git a/java/bom/pom.xml b/java/bom/pom.xml
index cec091173e..af2d7025ab 100644
--- a/java/bom/pom.xml
+++ b/java/bom/pom.xml
@@ -4,7 +4,7 @@
com.google.protobuf
protobuf-bom
- 3.15.3
+ 3.15.6
pom
Protocol Buffers [BOM]
diff --git a/java/core/pom.xml b/java/core/pom.xml
index 4fc530b9db..4df7d434df 100644
--- a/java/core/pom.xml
+++ b/java/core/pom.xml
@@ -4,7 +4,7 @@
com.google.protobuf
protobuf-parent
- 3.15.3
+ 3.15.6
protobuf-java
diff --git a/java/core/src/main/java/com/google/protobuf/ByteString.java b/java/core/src/main/java/com/google/protobuf/ByteString.java
index 17b7c98c99..74c9a71b6c 100644
--- a/java/core/src/main/java/com/google/protobuf/ByteString.java
+++ b/java/core/src/main/java/com/google/protobuf/ByteString.java
@@ -1043,8 +1043,10 @@ public abstract class ByteString implements Iterable, Serializable {
}
/**
- * Creates a byte string. Its size is the current size of this output stream and its output has
- * been copied to it.
+ * Creates a byte string with the size and contents of this output stream. This does not create
+ * a new copy of the underlying bytes. If the stream size grows dynamically, the runtime is
+ * O(log n) in respect to the number of bytes written to the {@link Output}. If the stream size
+ * stays within the initial capacity, the runtime is O(1).
*
* @return the current contents of this output stream, as a byte string.
*/
diff --git a/java/core/src/main/java/com/google/protobuf/RopeByteString.java b/java/core/src/main/java/com/google/protobuf/RopeByteString.java
index cc6e0445b0..f584164410 100644
--- a/java/core/src/main/java/com/google/protobuf/RopeByteString.java
+++ b/java/core/src/main/java/com/google/protobuf/RopeByteString.java
@@ -603,7 +603,12 @@ final class RopeByteString extends ByteString {
@Override
public CodedInputStream newCodedInput() {
- return CodedInputStream.newInstance(new RopeInputStream());
+ // Passing along direct references to internal ByteBuffers can support more efficient parsing
+ // via aliasing in CodedInputStream for users who wish to use it.
+ //
+ // Otherwise we force data copies, both in copying as an input stream and in buffering in the
+ // CodedInputSteam.
+ return CodedInputStream.newInstance(asReadOnlyByteBufferList(), /* bufferIsImmutable= */ true);
}
@Override
diff --git a/java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java b/java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java
index cc979ac513..4bc8d10130 100644
--- a/java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java
+++ b/java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java
@@ -283,7 +283,7 @@ public class AbstractMessageTest extends TestCase {
Message.Builder abstractMessageBuilder =
new AbstractMessageWrapper.Builder(TestRequiredForeign.newBuilder());
// mergeFrom() should not throw initialization error.
- abstractMessageBuilder.mergeFrom(bytes).buildPartial();
+ Message unused1 = abstractMessageBuilder.mergeFrom(bytes).buildPartial();
try {
abstractMessageBuilder.mergeFrom(bytes).build();
fail();
@@ -295,7 +295,7 @@ public class AbstractMessageTest extends TestCase {
Message.Builder dynamicMessageBuilder =
DynamicMessage.newBuilder(TestRequiredForeign.getDescriptor());
// mergeFrom() should not throw initialization error.
- dynamicMessageBuilder.mergeFrom(bytes).buildPartial();
+ Message unused2 = dynamicMessageBuilder.mergeFrom(bytes).buildPartial();
try {
dynamicMessageBuilder.mergeFrom(bytes).build();
fail();
diff --git a/java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java b/java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java
index fe37ea8087..cd40ffaeeb 100644
--- a/java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java
+++ b/java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java
@@ -69,7 +69,7 @@ public class DynamicMessageTest extends TestCase {
Message.Builder builder = DynamicMessage.newBuilder(TestAllTypes.getDescriptor());
Message firstMessage = builder.build();
// double build()
- builder.build();
+ Message unused = builder.build();
// clear() after build()
builder.clear();
// setters after build()
diff --git a/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java b/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java
index 9261a36122..840e13e877 100644
--- a/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java
+++ b/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java
@@ -76,6 +76,7 @@ import junit.framework.TestCase;
*
* @author kenton@google.com Kenton Varda
*/
+@SuppressWarnings({"ProtoBuilderReturnValueIgnored", "ReturnValueIgnored"})
public class GeneratedMessageTest extends TestCase {
TestUtil.ReflectionTester reflectionTester =
new TestUtil.ReflectionTester(TestAllTypes.getDescriptor(), null);
diff --git a/java/core/src/test/java/com/google/protobuf/MapForProto2Test.java b/java/core/src/test/java/com/google/protobuf/MapForProto2Test.java
index d2565ca157..25c5625f40 100644
--- a/java/core/src/test/java/com/google/protobuf/MapForProto2Test.java
+++ b/java/core/src/test/java/com/google/protobuf/MapForProto2Test.java
@@ -1163,8 +1163,8 @@ public class MapForProto2Test extends TestCase {
}
public void testReservedWordsFieldNames() {
- ReservedAsMapField.newBuilder().build();
- ReservedAsMapFieldWithEnumValue.newBuilder().build();
+ ReservedAsMapField unused1 = ReservedAsMapField.newBuilder().build();
+ ReservedAsMapFieldWithEnumValue unused2 = ReservedAsMapFieldWithEnumValue.newBuilder().build();
}
public void testGetMap() {
diff --git a/java/core/src/test/java/com/google/protobuf/MapTest.java b/java/core/src/test/java/com/google/protobuf/MapTest.java
index 2f55328b51..c3b1fa3804 100644
--- a/java/core/src/test/java/com/google/protobuf/MapTest.java
+++ b/java/core/src/test/java/com/google/protobuf/MapTest.java
@@ -1294,8 +1294,8 @@ public class MapTest extends TestCase {
}
public void testReservedWordsFieldNames() {
- ReservedAsMapField.newBuilder().build();
- ReservedAsMapFieldWithEnumValue.newBuilder().build();
+ ReservedAsMapField unused1 = ReservedAsMapField.newBuilder().build();
+ ReservedAsMapFieldWithEnumValue unused2 = ReservedAsMapFieldWithEnumValue.newBuilder().build();
}
public void testDeterministicSerialziation() throws Exception {
diff --git a/java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java b/java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java
index 3d82c5f9af..08a23bab94 100644
--- a/java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java
+++ b/java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java
@@ -43,8 +43,10 @@ public class TestBadIdentifiers extends TestCase {
public void testCompilation() {
// If this compiles, it means the generation was correct.
- TestBadIdentifiersProto.Deprecated.newBuilder();
- TestBadIdentifiersProto.Override.newBuilder();
+ TestBadIdentifiersProto.Deprecated unused1 =
+ TestBadIdentifiersProto.Deprecated.newBuilder().build();
+ TestBadIdentifiersProto.Override unused2 =
+ TestBadIdentifiersProto.Override.getDefaultInstance();
}
public void testGetDescriptor() {
diff --git a/java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java b/java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java
index 798d7ca612..523e23aa76 100644
--- a/java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java
+++ b/java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java
@@ -45,8 +45,10 @@ public final class TestBadIdentifiersLite extends TestCase {
public void testCompilation() {
// If this compiles, it means the generation was correct.
- TestBadIdentifiersProto.Deprecated.newBuilder();
- TestBadIdentifiersProto.Override.newBuilder();
+ TestBadIdentifiersProto.Deprecated.Builder builder1 =
+ TestBadIdentifiersProto.Deprecated.newBuilder();
+ TestBadIdentifiersProto.Override.Builder builder2 =
+ TestBadIdentifiersProto.Override.newBuilder();
}
public void testConflictingFieldNames() throws Exception {
diff --git a/java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto b/java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto
deleted file mode 100644
index d41b7a11cc..0000000000
--- a/java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto
+++ /dev/null
@@ -1,56 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Darick Tong (darick@google.com)
-syntax = "proto2";
-
-package protobuf_unittest;
-
-message Proto1 {
- option experimental_java_message_interface =
- "com.google.protobuf.ExtraInterfaces.HasBoolValue";
- option experimental_java_message_interface =
- "com.google.protobuf.ExtraInterfaces.HasStringValue";
- option experimental_java_builder_interface =
- "com.google.protobuf.ExtraInterfaces.HasStringValueBuilder"
- "";
-
- optional string string_value = 1;
- optional bool bool_value = 2;
- optional bytes byte_value = 3;
- optional int32 int_value = 4;
-}
-
-message Proto2 {
- option experimental_java_message_interface =
- "com.google.protobuf.ExtraInterfaces.HasBoolValue";
-
- optional bool bool_value = 1;
-}
diff --git a/java/lite/generate-test-sources-build.xml b/java/lite/generate-test-sources-build.xml
index 62bca93c86..65e62ce4fb 100644
--- a/java/lite/generate-test-sources-build.xml
+++ b/java/lite/generate-test-sources-build.xml
@@ -4,6 +4,7 @@
+
diff --git a/java/lite/pom.xml b/java/lite/pom.xml
index 478ba0e15c..021eac0ac4 100644
--- a/java/lite/pom.xml
+++ b/java/lite/pom.xml
@@ -4,7 +4,7 @@
com.google.protobuf
protobuf-parent
- 3.15.3
+ 3.15.6
protobuf-javalite
diff --git a/java/lite/src/test/java/com/google/protobuf/LiteTest.java b/java/lite/src/test/java/com/google/protobuf/LiteTest.java
index 06d244a643..f2ce4614c7 100644
--- a/java/lite/src/test/java/com/google/protobuf/LiteTest.java
+++ b/java/lite/src/test/java/com/google/protobuf/LiteTest.java
@@ -2406,24 +2406,26 @@ public class LiteTest extends TestCase {
}
public void testAddAllIteratesOnce() {
- TestAllTypesLite.newBuilder()
- .addAllRepeatedBool(new OneTimeIterableList<>(false))
- .addAllRepeatedInt32(new OneTimeIterableList<>(0))
- .addAllRepeatedInt64(new OneTimeIterableList<>(0L))
- .addAllRepeatedFloat(new OneTimeIterableList<>(0f))
- .addAllRepeatedDouble(new OneTimeIterableList<>(0d))
- .addAllRepeatedBytes(new OneTimeIterableList<>(ByteString.EMPTY))
- .addAllRepeatedString(new OneTimeIterableList<>(""))
- .addAllRepeatedNestedMessage(new OneTimeIterableList<>(NestedMessage.getDefaultInstance()))
- .addAllRepeatedBool(new OneTimeIterable<>(false))
- .addAllRepeatedInt32(new OneTimeIterable<>(0))
- .addAllRepeatedInt64(new OneTimeIterable<>(0L))
- .addAllRepeatedFloat(new OneTimeIterable<>(0f))
- .addAllRepeatedDouble(new OneTimeIterable<>(0d))
- .addAllRepeatedBytes(new OneTimeIterable<>(ByteString.EMPTY))
- .addAllRepeatedString(new OneTimeIterable<>(""))
- .addAllRepeatedNestedMessage(new OneTimeIterable<>(NestedMessage.getDefaultInstance()))
- .build();
+ TestAllTypesLite unused =
+ TestAllTypesLite.newBuilder()
+ .addAllRepeatedBool(new OneTimeIterableList<>(false))
+ .addAllRepeatedInt32(new OneTimeIterableList<>(0))
+ .addAllRepeatedInt64(new OneTimeIterableList<>(0L))
+ .addAllRepeatedFloat(new OneTimeIterableList<>(0f))
+ .addAllRepeatedDouble(new OneTimeIterableList<>(0d))
+ .addAllRepeatedBytes(new OneTimeIterableList<>(ByteString.EMPTY))
+ .addAllRepeatedString(new OneTimeIterableList<>(""))
+ .addAllRepeatedNestedMessage(
+ new OneTimeIterableList<>(NestedMessage.getDefaultInstance()))
+ .addAllRepeatedBool(new OneTimeIterable<>(false))
+ .addAllRepeatedInt32(new OneTimeIterable<>(0))
+ .addAllRepeatedInt64(new OneTimeIterable<>(0L))
+ .addAllRepeatedFloat(new OneTimeIterable<>(0f))
+ .addAllRepeatedDouble(new OneTimeIterable<>(0d))
+ .addAllRepeatedBytes(new OneTimeIterable<>(ByteString.EMPTY))
+ .addAllRepeatedString(new OneTimeIterable<>(""))
+ .addAllRepeatedNestedMessage(new OneTimeIterable<>(NestedMessage.getDefaultInstance()))
+ .build();
}
public void testAddAllIteratesOnce_throwsOnNull() {
diff --git a/java/pom.xml b/java/pom.xml
index dc3e89f884..649ec0ce11 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -4,7 +4,7 @@
com.google.protobuf
protobuf-parent
- 3.15.3
+ 3.15.6
pom
Protocol Buffers [Parent]
@@ -75,7 +75,7 @@
junit
junit
- 4.13.1
+ 4.13.2
test
@@ -104,7 +104,7 @@
com.google.truth
truth
- 1.0.1
+ 1.1.2
test
diff --git a/java/util/pom.xml b/java/util/pom.xml
index 9028b1b2f0..37d7c0fb85 100644
--- a/java/util/pom.xml
+++ b/java/util/pom.xml
@@ -4,7 +4,7 @@
com.google.protobuf
protobuf-parent
- 3.15.3
+ 3.15.6
protobuf-java-util
diff --git a/kokoro/release/protoc/linux/build.sh b/kokoro/release/protoc/linux/build.sh
index efc3ee62ca..44a95aab35 100755
--- a/kokoro/release/protoc/linux/build.sh
+++ b/kokoro/release/protoc/linux/build.sh
@@ -23,7 +23,7 @@ sudo apt install -y g++-powerpc64le-linux-gnu
protoc-artifacts/build-protoc.sh linux ppcle_64 protoc
sudo apt install -y g++-s390x-linux-gnu
-protoc-artifacts/build-protoc.sh linux s390x protoc
+protoc-artifacts/build-protoc.sh linux s390_64 protoc
# Use docker image to build linux artifacts.
DOCKER_IMAGE_NAME=protobuf/protoc_$(sha1sum protoc-artifacts/Dockerfile | cut -f1 -d " ")
diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c
index 7f27670320..0f1f4c964e 100644
--- a/php/ext/google/protobuf/message.c
+++ b/php/ext/google/protobuf/message.c
@@ -334,7 +334,7 @@ static zval *Message_read_property(PROTO_VAL *obj, PROTO_STR *member,
Message* intern = PROTO_VAL_P(obj);
const upb_fielddef *f = get_field(intern, member);
- if (!f) return NULL;
+ if (!f) return &EG(uninitialized_zval);
Message_get(intern, f, rv);
return rv;
}
diff --git a/php/ext/google/protobuf/package.xml b/php/ext/google/protobuf/package.xml
index 75a440cd55..48e403bf72 100644
--- a/php/ext/google/protobuf/package.xml
+++ b/php/ext/google/protobuf/package.xml
@@ -10,11 +10,11 @@
protobuf-opensource@google.com
yes
- 2021-02-24
-
+ 2021-03-10
+
- 3.15.3
- 3.15.3
+ 3.15.6
+ 3.15.6
stable
@@ -22,15 +22,7 @@
3-Clause BSD License
- New changes in 3.15.0:
- * unregister INI entries and fix invalid read on shutdown (#8042)
- * Fix PhpDoc comments for message accessors to include "|null". (#8136)
- * fix: convert native PHP floats to single precision (#8187)
- * Fixed PHP to support field numbers >=2**28. (#8235)
- * feat: add support for deprecated fields to PHP compiler (#8223)
- * Protect against stack overflow if the user derives from Message. (#8248)
- * Fixed clone for Message, RepeatedField, and MapField. (#8245)
- * Updated upb to allow nonzero offset minutes in JSON timestamps. (#8258)
+ No new changes in 3.15.6
@@ -850,5 +842,50 @@ G A release.
+
+
+ 3.15.4
+ 3.15.4
+
+
+ stable
+ stable
+
+ 2021-03-02
+
+ 3-Clause BSD License
+
+
+
+
+
+ 3.15.5
+ 3.15.5
+
+
+ stable
+ stable
+
+ 2021-03-04
+
+ 3-Clause BSD License
+
+
+
+
+
+ 3.15.6
+ 3.15.6
+
+
+ stable
+ stable
+
+ 2021-03-10
+
+ 3-Clause BSD License
+
+
+
diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c
index c56a567ca3..913dfad7e9 100644
--- a/php/ext/google/protobuf/php-upb.c
+++ b/php/ext/google/protobuf/php-upb.c
@@ -7047,10 +7047,9 @@ void upb_array_set(upb_array *arr, size_t i, upb_msgval val) {
}
bool upb_array_append(upb_array *arr, upb_msgval val, upb_arena *arena) {
- if (!_upb_array_realloc(arr, arr->len + 1, arena)) {
+ if (!upb_array_resize(arr, arr->len + 1, arena)) {
return false;
}
- arr->len++;
upb_array_set(arr, arr->len - 1, val);
return true;
}
diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h
index a03261c295..1a2069bfbb 100644
--- a/php/ext/google/protobuf/protobuf.h
+++ b/php/ext/google/protobuf/protobuf.h
@@ -76,7 +76,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_setter, 0, 0, 1)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
-#define PHP_PROTOBUF_VERSION "3.15.3"
+#define PHP_PROTOBUF_VERSION "3.15.6"
// ptr -> PHP object cache. This is a weak map that caches lazily-created
// wrapper objects around upb types:
diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md
index 2c45fefe78..1706ddc0d8 100644
--- a/protoc-artifacts/README.md
+++ b/protoc-artifacts/README.md
@@ -123,7 +123,7 @@ target directory layout:
protoc.exe
+ ppcle_64
protoc.exe
- + s390x
+ + s390_64
protoc.exe
+ osx
+ x86_64
diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh
index 7f65d37643..4602842622 100755
--- a/protoc-artifacts/build-protoc.sh
+++ b/protoc-artifacts/build-protoc.sh
@@ -93,7 +93,7 @@ checkArch ()
assertEq $format "elf64-x86-64" $LINENO
elif [[ "$ARCH" == aarch_64 ]]; then
assertEq $format "elf64-little" $LINENO
- elif [[ "$ARCH" == s390x ]]; then
+ elif [[ "$ARCH" == s390_64 ]]; then
if [[ $host_machine == s390x ]];then
assertEq $format "elf64-s390" $LINENO
else
@@ -149,7 +149,7 @@ checkDependencies ()
white_list="linux-gate\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux\.so\.2"
elif [[ "$ARCH" == x86_64 ]]; then
white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-x86-64\.so\.2"
- elif [[ "$ARCH" == s390x ]]; then
+ elif [[ "$ARCH" == s390_64 ]]; then
if [[ $host_machine != s390x ]];then
dump_cmd='objdump -p '"$1"' | grep NEEDED'
fi
@@ -226,7 +226,7 @@ elif [[ "$(uname)" == Linux* ]]; then
elif [[ "$ARCH" == ppcle_64 ]]; then
CXXFLAGS="$CXXFLAGS -m64"
CONFIGURE_ARGS="$CONFIGURE_ARGS --host=powerpc64le-linux-gnu"
- elif [[ "$ARCH" == s390x ]]; then
+ elif [[ "$ARCH" == s390_64 ]]; then
CXXFLAGS="$CXXFLAGS -m64"
CONFIGURE_ARGS="$CONFIGURE_ARGS --host=s390x-linux-gnu"
else
diff --git a/protoc-artifacts/build-zip.sh b/protoc-artifacts/build-zip.sh
index 2a25d3cd7e..7d1923e6e6 100755
--- a/protoc-artifacts/build-zip.sh
+++ b/protoc-artifacts/build-zip.sh
@@ -21,7 +21,7 @@ included. Each invocation will create 8 zip packages:
dist/--linux-x86_64.zip
dist/--linux-aarch_64.zip
dist/--linux-ppcle_64.zip
- dist/--linux-s390x.zip
+ dist/--linux-s390_64.zip
EOF
exit 1
fi
@@ -38,7 +38,7 @@ declare -a FILE_NAMES=( \
linux-x86_64.zip linux-x86_64.exe \
linux-aarch_64.zip linux-aarch_64.exe \
linux-ppcle_64.zip linux-ppcle_64.exe \
- linux-s390x.zip linux-s390x.exe \
+ linux-s390_64.zip linux-s390_64.exe \
)
# List of all well-known types to be included.
diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml
index 591ab09284..9cb0b63e5a 100644
--- a/protoc-artifacts/pom.xml
+++ b/protoc-artifacts/pom.xml
@@ -8,7 +8,7 @@
com.google.protobuf
protoc
- 3.15.3
+ 3.15.6
pom
Protobuf Compiler
@@ -81,8 +81,8 @@
exe
- ${basedir}/target/linux/s390x/protoc.exe
- linux-s390x
+ ${basedir}/target/linux/s390_64/protoc.exe
+ linux-s390_64
exe
diff --git a/python/google/protobuf/internal/text_format_test.py b/python/google/protobuf/internal/text_format_test.py
index 987116a106..6f75251dbe 100755
--- a/python/google/protobuf/internal/text_format_test.py
+++ b/python/google/protobuf/internal/text_format_test.py
@@ -1176,6 +1176,54 @@ class OnlyWorksWithProto2RightNowTests(TextFormatBase):
' }\n'
'}\n')
+ def testDuplicateMapKey(self):
+ message = map_unittest_pb2.TestMap()
+ text = (
+ 'map_uint64_uint64 {\n'
+ ' key: 123\n'
+ ' value: 17179869184\n'
+ '}\n'
+ 'map_string_string {\n'
+ ' key: "abc"\n'
+ ' value: "first"\n'
+ '}\n'
+ 'map_int32_foreign_message {\n'
+ ' key: 111\n'
+ ' value {\n'
+ ' c: 5\n'
+ ' }\n'
+ '}\n'
+ 'map_uint64_uint64 {\n'
+ ' key: 123\n'
+ ' value: 321\n'
+ '}\n'
+ 'map_string_string {\n'
+ ' key: "abc"\n'
+ ' value: "second"\n'
+ '}\n'
+ 'map_int32_foreign_message {\n'
+ ' key: 111\n'
+ ' value {\n'
+ ' d: 5\n'
+ ' }\n'
+ '}\n')
+ text_format.Parse(text, message)
+ self.CompareToGoldenText(
+ text_format.MessageToString(message), 'map_uint64_uint64 {\n'
+ ' key: 123\n'
+ ' value: 321\n'
+ '}\n'
+ 'map_string_string {\n'
+ ' key: "abc"\n'
+ ' value: "second"\n'
+ '}\n'
+ 'map_int32_foreign_message {\n'
+ ' key: 111\n'
+ ' value {\n'
+ ' d: 5\n'
+ ' }\n'
+ '}\n')
+
# In cpp implementation, __str__ calls the cpp implementation of text format.
def testPrintMapUsingCppImplementation(self):
message = map_unittest_pb2.TestMap()
@@ -2348,6 +2396,13 @@ class OptionalColonMessageToStringTest(unittest.TestCase):
'}\n')
self.assertEqual(expected, output)
+ def testPrintShortFormatRepeatedFields(self):
+ message = unittest_pb2.TestAllTypes()
+ message.repeated_int32.append(1)
+ output = text_format.MessageToString(
+ message, use_short_repeated_primitives=True, force_colon=True)
+ self.assertEqual('repeated_int32: [1]\n', output)
+
if __name__ == '__main__':
unittest.main()
diff --git a/python/google/protobuf/pyext/descriptor.cc b/python/google/protobuf/pyext/descriptor.cc
index 75f1760ccf..42d99e8fc8 100644
--- a/python/google/protobuf/pyext/descriptor.cc
+++ b/python/google/protobuf/pyext/descriptor.cc
@@ -30,15 +30,18 @@
// Author: petar@google.com (Petar Petrov)
+#include
+
#include
#include
+
+#include
#include
#include
#include
#include
#include
-#include
#include
#include
#include
@@ -195,7 +198,7 @@ bool Reparse(
std::string serialized;
from.SerializeToString(&serialized);
io::CodedInputStream input(
- reinterpret_cast(serialized.c_str()), serialized.size());
+ reinterpret_cast(serialized.c_str()), serialized.size());
input.SetExtensionRegistry(message_factory->pool->pool,
message_factory->message_factory);
bool success = to->ParseFromCodedStream(&input);
@@ -804,22 +807,22 @@ static PyObject* GetDefaultValue(PyBaseDescriptor *self, void *closure) {
switch (_GetDescriptor(self)->cpp_type()) {
case FieldDescriptor::CPPTYPE_INT32: {
- int32 value = _GetDescriptor(self)->default_value_int32();
+ int32_t value = _GetDescriptor(self)->default_value_int32();
result = PyInt_FromLong(value);
break;
}
case FieldDescriptor::CPPTYPE_INT64: {
- int64 value = _GetDescriptor(self)->default_value_int64();
+ int64_t value = _GetDescriptor(self)->default_value_int64();
result = PyLong_FromLongLong(value);
break;
}
case FieldDescriptor::CPPTYPE_UINT32: {
- uint32 value = _GetDescriptor(self)->default_value_uint32();
+ uint32_t value = _GetDescriptor(self)->default_value_uint32();
result = PyInt_FromSize_t(value);
break;
}
case FieldDescriptor::CPPTYPE_UINT64: {
- uint64 value = _GetDescriptor(self)->default_value_uint64();
+ uint64_t value = _GetDescriptor(self)->default_value_uint64();
result = PyLong_FromUnsignedLongLong(value);
break;
}
diff --git a/python/google/protobuf/pyext/descriptor_database.cc b/python/google/protobuf/pyext/descriptor_database.cc
index 26f1b5fb42..da1c84a465 100644
--- a/python/google/protobuf/pyext/descriptor_database.cc
+++ b/python/google/protobuf/pyext/descriptor_database.cc
@@ -33,6 +33,8 @@
#include
+#include
+
#include
#include
#include
@@ -164,7 +166,7 @@ bool PyDescriptorDatabase::FindAllExtensionNumbers(
return false;
}
Py_ssize_t size = PyList_Size(py_list.get());
- int64 item_value;
+ int64_t item_value;
for (Py_ssize_t i = 0 ; i < size; ++i) {
ScopedPyObjectPtr item(PySequence_GetItem(py_list.get(), i));
item_value = PyLong_AsLong(item.get());
diff --git a/python/google/protobuf/pyext/extension_dict.cc b/python/google/protobuf/pyext/extension_dict.cc
index e9ac71409e..37b414c375 100644
--- a/python/google/protobuf/pyext/extension_dict.cc
+++ b/python/google/protobuf/pyext/extension_dict.cc
@@ -32,14 +32,16 @@
// Author: tibell@google.com (Johan Tibell)
#include
+
+#include
#include
#include
#include
+#include
#include
#include
#include
-#include
#include
#include
#include
@@ -263,7 +265,7 @@ PyObject* _FindExtensionByName(ExtensionDict* self, PyObject* arg) {
}
PyObject* _FindExtensionByNumber(ExtensionDict* self, PyObject* arg) {
- int64 number = PyLong_AsLong(arg);
+ int64_t number = PyLong_AsLong(arg);
if (number == -1 && PyErr_Occurred()) {
return NULL;
}
diff --git a/python/google/protobuf/pyext/map_container.cc b/python/google/protobuf/pyext/map_container.cc
index a0ee16fe86..2573327e3b 100644
--- a/python/google/protobuf/pyext/map_container.cc
+++ b/python/google/protobuf/pyext/map_container.cc
@@ -32,15 +32,16 @@
#include
+#include
#include
#include
#include
-#include
#include
+#include
#include
-#include
#include
+#include
#include
#include
#include
@@ -99,7 +100,7 @@ struct MapIterator {
//
// We store this so that if the map is modified during iteration we can throw
// an error.
- uint64 version;
+ uint64_t version;
};
Message* MapContainer::GetMutableMessage() {
diff --git a/python/google/protobuf/pyext/map_container.h b/python/google/protobuf/pyext/map_container.h
index a28945da07..842602e79f 100644
--- a/python/google/protobuf/pyext/map_container.h
+++ b/python/google/protobuf/pyext/map_container.h
@@ -33,6 +33,7 @@
#include
+#include
#include
#include
@@ -56,7 +57,7 @@ struct MapContainer : public ContainerBase {
// We bump this whenever we perform a mutation, to invalidate existing
// iterators.
- uint64 version;
+ uint64_t version;
};
struct MessageMapContainer : public MapContainer {
diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc
index 4e74386e2d..33034bf3f4 100644
--- a/python/google/protobuf/pyext/message.cc
+++ b/python/google/protobuf/pyext/message.cc
@@ -35,6 +35,7 @@
#include // A Python header file.
+#include
#include