diff --git a/.gitignore b/.gitignore index 4e909aecea..5e38bbf7c2 100644 --- a/.gitignore +++ b/.gitignore @@ -141,6 +141,8 @@ php/tests/old_protoc php/tests/protobuf/ php/tests/core php/tests/vgcore* +php/tests/multirequest.result +php/tests/nohup.out php/ext/google/protobuf/.libs/ php/ext/google/protobuf/Makefile.fragments php/ext/google/protobuf/Makefile.global diff --git a/CHANGES.txt b/CHANGES.txt index 3b6da26d08..fd65e60deb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,15 @@ +2019-12-10 version 3.11.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + PHP + * Make c extension portable for php 7.4 (#6968) + + +2019-12-02 version 3.11.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + PHP + * Extern declare protobuf_globals (#6946) + + 2019-11-19 version 3.11.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) C++ @@ -13,6 +25,7 @@ * Skip extension tag validation for MessageSet if unknown dependencies are allowed * Updated deprecation macros to annotate deprecated code (#6612) * Remove conversion warning in MapEntryFuncs::ByteSizeLong (#6766) + * Revert "Make shared libraries be able to link to MSVC static runtime libraries, so that VC runtime is not required." (#6914) Java * Remove the usage of MethodHandle, so that Android users prior to API version 26 can use protobuf-java @@ -33,6 +46,7 @@ PHP * Avoid too much overhead in layout_init (#6716) * Lazily Create Singular Wrapper Message (#6833) + * Implement lazy loading of php class for proto messages (#6911) Ruby * Ruby lazy wrappers optimization (#6797) diff --git a/Makefile.am b/Makefile.am index 7ee57da299..cca346e9ca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -883,6 +883,8 @@ php_EXTRA_DIST= \ php/tests/generated_service_test.php \ php/tests/map_field_test.php \ php/tests/memory_leak_test.php \ + php/tests/multirequest.php \ + php/tests/multirequest.sh \ php/tests/php_implementation_test.php \ php/tests/proto/empty/echo.proto \ php/tests/proto/test.proto \ diff --git a/Protobuf-C++.podspec b/Protobuf-C++.podspec index 63909d3c69..1359d0294d 100644 --- a/Protobuf-C++.podspec +++ b/Protobuf-C++.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Protobuf-C++' - s.version = '3.11.0-rc1' + s.version = '3.11.2' s.summary = 'Protocol Buffers v3 runtime library for C++.' s.homepage = 'https://github.com/google/protobuf' s.license = '3-Clause BSD License' diff --git a/Protobuf.podspec b/Protobuf.podspec index a4b3f4b5a6..6de36e05ac 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.11.0-rc1' + s.version = '3.11.2' 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/configure.ac b/configure.ac index af2d980bcf..df39c05ea5 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ AC_PREREQ(2.59) # In the SVN trunk, the version should always be the next anticipated release # version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed # the size of one file name in the dist tarfile over the 99-char limit.) -AC_INIT([Protocol Buffers],[3.11.0-rc-1],[protobuf@googlegroups.com],[protobuf]) +AC_INIT([Protocol Buffers],[3.11.2],[protobuf@googlegroups.com],[protobuf]) AM_MAINTAINER_MODE([enable]) diff --git a/conformance/Makefile.am b/conformance/Makefile.am index 4eff3e1aec..698b110ad1 100644 --- a/conformance/Makefile.am +++ b/conformance/Makefile.am @@ -353,8 +353,8 @@ test_php: protoc_middleman conformance-test-runner conformance-php $(other_langu test_php_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs) ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c -test_php_zts_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs) - ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_zts_c.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c +test_php_c_32: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs) + ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c_32.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c # These depend on library paths being properly set up. The easiest way to # run them is to just use "tox" from the python dir. diff --git a/conformance/failure_list_php.txt b/conformance/failure_list_php.txt index d30fb3d8bb..7ee5b9aae1 100644 --- a/conformance/failure_list_php.txt +++ b/conformance/failure_list_php.txt @@ -64,7 +64,6 @@ Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOu Required.Proto3.JsonInput.DoubleFieldTooSmall Required.Proto3.JsonInput.FloatFieldTooLarge Required.Proto3.JsonInput.FloatFieldTooSmall -Required.Proto3.JsonInput.Int32FieldLeadingSpace Required.Proto3.JsonInput.Int32FieldNotInteger Required.Proto3.JsonInput.Int64FieldNotInteger Required.Proto3.JsonInput.OneofFieldDuplicate diff --git a/conformance/failure_list_php_c.txt b/conformance/failure_list_php_c.txt index 5950c5742e..6a6949fe40 100644 --- a/conformance/failure_list_php_c.txt +++ b/conformance/failure_list_php_c.txt @@ -18,33 +18,63 @@ Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[3].ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput Required.DurationProtoInputTooLarge.JsonOutput @@ -67,6 +97,7 @@ Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.DefaultValue.JsonOutput Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.JsonOutput Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.ProtobufOutput Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput @@ -76,34 +107,3 @@ Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.ProtobufOutput Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput Required.TimestampProtoInputTooLarge.JsonOutput Required.TimestampProtoInputTooSmall.JsonOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.DefaultValue.JsonOutput diff --git a/conformance/failure_list_php_c_32.txt b/conformance/failure_list_php_c_32.txt new file mode 100644 index 0000000000..f516f13ac3 --- /dev/null +++ b/conformance/failure_list_php_c_32.txt @@ -0,0 +1,142 @@ +Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput +Recommended.FieldMaskPathsDontRoundTrip.JsonOutput +Recommended.FieldMaskTooManyUnderscore.JsonOutput +Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput +Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput +Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHas9FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHasZeroFractionalDigit.Validator +Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter +Recommended.Proto3.JsonInput.MapFieldValueIsNull +Recommended.Proto3.JsonInput.OneofZeroBytes.JsonOutput +Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull +Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull +Recommended.Proto3.JsonInput.StringEndsWithEscapeChar +Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder +Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate +Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate +Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHas9FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHasZeroFractionalDigit.Validator +Recommended.Proto3.JsonInput.TimestampZeroNormalized.Validator +Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput +Required.DurationProtoInputTooLarge.JsonOutput +Required.DurationProtoInputTooSmall.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput +Required.Proto3.JsonInput.DurationMaxValue.JsonOutput +Required.Proto3.JsonInput.DurationMaxValue.ProtobufOutput +Required.Proto3.JsonInput.DurationMinValue.JsonOutput +Required.Proto3.JsonInput.DurationMinValue.ProtobufOutput +Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput +Required.Proto3.JsonInput.DurationRepeatedValue.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput +Required.Proto3.JsonInput.FloatFieldNan.JsonOutput +Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput +Required.Proto3.JsonInput.Int64FieldMaxValue.JsonOutput +Required.Proto3.JsonInput.Int64FieldMaxValue.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMaxValueNotQuoted.JsonOutput +Required.Proto3.JsonInput.Int64FieldMaxValueNotQuoted.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMinValue.JsonOutput +Required.Proto3.JsonInput.Int64FieldMinValue.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMinValueNotQuoted.JsonOutput +Required.Proto3.JsonInput.Int64FieldMinValueNotQuoted.ProtobufOutput +Required.Proto3.JsonInput.OneofFieldDuplicate +Required.Proto3.JsonInput.RejectTopLevelNull +Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput +Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput +Required.Proto3.JsonInput.TimestampLeap.JsonOutput +Required.Proto3.JsonInput.TimestampLeap.ProtobufOutput +Required.Proto3.JsonInput.TimestampMaxValue.JsonOutput +Required.Proto3.JsonInput.TimestampMaxValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampMinValue.JsonOutput +Required.Proto3.JsonInput.TimestampMinValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampRepeatedValue.JsonOutput +Required.Proto3.JsonInput.TimestampRepeatedValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampWithNegativeOffset.JsonOutput +Required.Proto3.JsonInput.TimestampWithNegativeOffset.ProtobufOutput +Required.Proto3.JsonInput.TimestampWithPositiveOffset.JsonOutput +Required.Proto3.JsonInput.TimestampWithPositiveOffset.ProtobufOutput +Required.Proto3.JsonInput.Uint64FieldMaxValue.JsonOutput +Required.Proto3.JsonInput.Uint64FieldMaxValue.ProtobufOutput +Required.Proto3.JsonInput.Uint64FieldMaxValueNotQuoted.JsonOutput +Required.Proto3.JsonInput.Uint64FieldMaxValueNotQuoted.ProtobufOutput +Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput +Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput +Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput +Required.TimestampProtoInputTooLarge.JsonOutput +Required.TimestampProtoInputTooSmall.JsonOutput diff --git a/conformance/failure_list_php_zts_c.txt b/conformance/failure_list_php_zts_c.txt deleted file mode 100644 index d9a8fe36d9..0000000000 --- a/conformance/failure_list_php_zts_c.txt +++ /dev/null @@ -1,225 +0,0 @@ -Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput -Recommended.FieldMaskPathsDontRoundTrip.JsonOutput -Recommended.FieldMaskTooManyUnderscore.JsonOutput -Recommended.JsonInput.BoolFieldIntegerOne -Recommended.JsonInput.BoolFieldIntegerZero -Recommended.JsonInput.DurationHas3FractionalDigits.Validator -Recommended.JsonInput.DurationHas6FractionalDigits.Validator -Recommended.JsonInput.DurationHas9FractionalDigits.Validator -Recommended.JsonInput.DurationHasZeroFractionalDigit.Validator -Recommended.JsonInput.Int64FieldBeString.Validator -Recommended.JsonInput.OneofZeroBytes.JsonOutput -Recommended.JsonInput.OneofZeroBytes.ProtobufOutput -Recommended.JsonInput.OneofZeroDouble.JsonOutput -Recommended.JsonInput.OneofZeroDouble.ProtobufOutput -Recommended.JsonInput.OneofZeroFloat.JsonOutput -Recommended.JsonInput.OneofZeroFloat.ProtobufOutput -Recommended.JsonInput.OneofZeroString.JsonOutput -Recommended.JsonInput.OneofZeroString.ProtobufOutput -Recommended.JsonInput.OneofZeroUint32.JsonOutput -Recommended.JsonInput.OneofZeroUint32.ProtobufOutput -Recommended.JsonInput.OneofZeroUint64.JsonOutput -Recommended.JsonInput.OneofZeroUint64.ProtobufOutput -Recommended.JsonInput.StringEndsWithEscapeChar -Recommended.JsonInput.StringFieldSurrogateInWrongOrder -Recommended.JsonInput.StringFieldUnpairedHighSurrogate -Recommended.JsonInput.StringFieldUnpairedLowSurrogate -Recommended.JsonInput.TimestampHas3FractionalDigits.Validator -Recommended.JsonInput.TimestampHas6FractionalDigits.Validator -Recommended.JsonInput.TimestampHas9FractionalDigits.Validator -Recommended.JsonInput.TimestampHasZeroFractionalDigit.Validator -Recommended.JsonInput.TimestampZeroNormalized.Validator -Recommended.JsonInput.Uint64FieldBeString.Validator -Recommended.ProtobufInput.OneofZeroBytes.JsonOutput -Recommended.ProtobufInput.OneofZeroBytes.ProtobufOutput -Recommended.ProtobufInput.OneofZeroString.JsonOutput -Recommended.ProtobufInput.OneofZeroString.ProtobufOutput -Required.DurationProtoInputTooLarge.JsonOutput -Required.DurationProtoInputTooSmall.JsonOutput -Required.JsonInput.AllFieldAcceptNull.ProtobufOutput -Required.JsonInput.Any.JsonOutput -Required.JsonInput.Any.ProtobufOutput -Required.JsonInput.AnyNested.JsonOutput -Required.JsonInput.AnyNested.ProtobufOutput -Required.JsonInput.AnyUnorderedTypeTag.JsonOutput -Required.JsonInput.AnyUnorderedTypeTag.ProtobufOutput -Required.JsonInput.AnyWithDuration.JsonOutput -Required.JsonInput.AnyWithDuration.ProtobufOutput -Required.JsonInput.AnyWithFieldMask.JsonOutput -Required.JsonInput.AnyWithFieldMask.ProtobufOutput -Required.JsonInput.AnyWithInt32ValueWrapper.JsonOutput -Required.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput -Required.JsonInput.AnyWithStruct.JsonOutput -Required.JsonInput.AnyWithStruct.ProtobufOutput -Required.JsonInput.AnyWithTimestamp.JsonOutput -Required.JsonInput.AnyWithTimestamp.ProtobufOutput -Required.JsonInput.AnyWithValueForInteger.JsonOutput -Required.JsonInput.AnyWithValueForInteger.ProtobufOutput -Required.JsonInput.AnyWithValueForJsonObject.JsonOutput -Required.JsonInput.AnyWithValueForJsonObject.ProtobufOutput -Required.JsonInput.BoolFieldFalse.ProtobufOutput -Required.JsonInput.BoolMapField.JsonOutput -Required.JsonInput.DoubleFieldInfinity.JsonOutput -Required.JsonInput.DoubleFieldInfinity.ProtobufOutput -Required.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput -Required.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput -Required.JsonInput.DoubleFieldMaxPositiveValue.JsonOutput -Required.JsonInput.DoubleFieldMaxPositiveValue.ProtobufOutput -Required.JsonInput.DoubleFieldMinNegativeValue.JsonOutput -Required.JsonInput.DoubleFieldMinNegativeValue.ProtobufOutput -Required.JsonInput.DoubleFieldMinPositiveValue.JsonOutput -Required.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput -Required.JsonInput.DoubleFieldNan.JsonOutput -Required.JsonInput.DoubleFieldNan.ProtobufOutput -Required.JsonInput.DoubleFieldNegativeInfinity.JsonOutput -Required.JsonInput.DoubleFieldNegativeInfinity.ProtobufOutput -Required.JsonInput.DoubleFieldQuotedValue.JsonOutput -Required.JsonInput.DoubleFieldQuotedValue.ProtobufOutput -Required.JsonInput.DurationMaxValue.JsonOutput -Required.JsonInput.DurationMaxValue.ProtobufOutput -Required.JsonInput.DurationMinValue.JsonOutput -Required.JsonInput.DurationMinValue.ProtobufOutput -Required.JsonInput.DurationRepeatedValue.JsonOutput -Required.JsonInput.DurationRepeatedValue.ProtobufOutput -Required.JsonInput.EnumField.ProtobufOutput -Required.JsonInput.EnumFieldNumericValueNonZero.JsonOutput -Required.JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput -Required.JsonInput.EnumFieldNumericValueZero.JsonOutput -Required.JsonInput.EnumFieldNumericValueZero.ProtobufOutput -Required.JsonInput.EnumFieldUnknownValue.Validator -Required.JsonInput.FieldMask.JsonOutput -Required.JsonInput.FieldMask.ProtobufOutput -Required.JsonInput.FloatFieldInfinity.JsonOutput -Required.JsonInput.FloatFieldInfinity.ProtobufOutput -Required.JsonInput.FloatFieldNan.JsonOutput -Required.JsonInput.FloatFieldNan.ProtobufOutput -Required.JsonInput.FloatFieldNegativeInfinity.JsonOutput -Required.JsonInput.FloatFieldNegativeInfinity.ProtobufOutput -Required.JsonInput.FloatFieldQuotedValue.JsonOutput -Required.JsonInput.FloatFieldQuotedValue.ProtobufOutput -Required.JsonInput.FloatFieldTooLarge -Required.JsonInput.FloatFieldTooSmall -Required.JsonInput.Int32FieldExponentialFormat.JsonOutput -Required.JsonInput.Int32FieldExponentialFormat.ProtobufOutput -Required.JsonInput.Int32FieldFloatTrailingZero.JsonOutput -Required.JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput -Required.JsonInput.Int32FieldMaxFloatValue.JsonOutput -Required.JsonInput.Int32FieldMaxFloatValue.ProtobufOutput -Required.JsonInput.Int32FieldMinFloatValue.JsonOutput -Required.JsonInput.Int32FieldMinFloatValue.ProtobufOutput -Required.JsonInput.Int32FieldStringValue.JsonOutput -Required.JsonInput.Int32FieldStringValue.ProtobufOutput -Required.JsonInput.Int32FieldStringValueEscaped.JsonOutput -Required.JsonInput.Int32FieldStringValueEscaped.ProtobufOutput -Required.JsonInput.Int32MapEscapedKey.JsonOutput -Required.JsonInput.Int32MapEscapedKey.ProtobufOutput -Required.JsonInput.Int32MapField.JsonOutput -Required.JsonInput.Int32MapField.ProtobufOutput -Required.JsonInput.Int64FieldMaxValue.JsonOutput -Required.JsonInput.Int64FieldMaxValue.ProtobufOutput -Required.JsonInput.Int64FieldMinValue.JsonOutput -Required.JsonInput.Int64FieldMinValue.ProtobufOutput -Required.JsonInput.Int64MapEscapedKey.JsonOutput -Required.JsonInput.Int64MapEscapedKey.ProtobufOutput -Required.JsonInput.Int64MapField.JsonOutput -Required.JsonInput.Int64MapField.ProtobufOutput -Required.JsonInput.MessageField.JsonOutput -Required.JsonInput.MessageField.ProtobufOutput -Required.JsonInput.MessageMapField.JsonOutput -Required.JsonInput.MessageMapField.ProtobufOutput -Required.JsonInput.MessageRepeatedField.JsonOutput -Required.JsonInput.MessageRepeatedField.ProtobufOutput -Required.JsonInput.OptionalBoolWrapper.JsonOutput -Required.JsonInput.OptionalBoolWrapper.ProtobufOutput -Required.JsonInput.OptionalBytesWrapper.JsonOutput -Required.JsonInput.OptionalBytesWrapper.ProtobufOutput -Required.JsonInput.OptionalDoubleWrapper.JsonOutput -Required.JsonInput.OptionalDoubleWrapper.ProtobufOutput -Required.JsonInput.OptionalFloatWrapper.JsonOutput -Required.JsonInput.OptionalFloatWrapper.ProtobufOutput -Required.JsonInput.OptionalInt32Wrapper.JsonOutput -Required.JsonInput.OptionalInt32Wrapper.ProtobufOutput -Required.JsonInput.OptionalInt64Wrapper.JsonOutput -Required.JsonInput.OptionalInt64Wrapper.ProtobufOutput -Required.JsonInput.OptionalStringWrapper.JsonOutput -Required.JsonInput.OptionalStringWrapper.ProtobufOutput -Required.JsonInput.OptionalUint32Wrapper.JsonOutput -Required.JsonInput.OptionalUint32Wrapper.ProtobufOutput -Required.JsonInput.OptionalUint64Wrapper.JsonOutput -Required.JsonInput.OptionalUint64Wrapper.ProtobufOutput -Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput -Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput -Required.JsonInput.PrimitiveRepeatedField.JsonOutput -Required.JsonInput.PrimitiveRepeatedField.ProtobufOutput -Required.JsonInput.RepeatedBoolWrapper.JsonOutput -Required.JsonInput.RepeatedBoolWrapper.ProtobufOutput -Required.JsonInput.RepeatedBytesWrapper.JsonOutput -Required.JsonInput.RepeatedBytesWrapper.ProtobufOutput -Required.JsonInput.RepeatedDoubleWrapper.JsonOutput -Required.JsonInput.RepeatedDoubleWrapper.ProtobufOutput -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt -Required.JsonInput.RepeatedFloatWrapper.JsonOutput -Required.JsonInput.RepeatedFloatWrapper.ProtobufOutput -Required.JsonInput.RepeatedInt32Wrapper.JsonOutput -Required.JsonInput.RepeatedInt32Wrapper.ProtobufOutput -Required.JsonInput.RepeatedInt64Wrapper.JsonOutput -Required.JsonInput.RepeatedInt64Wrapper.ProtobufOutput -Required.JsonInput.RepeatedStringWrapper.JsonOutput -Required.JsonInput.RepeatedStringWrapper.ProtobufOutput -Required.JsonInput.RepeatedUint32Wrapper.JsonOutput -Required.JsonInput.RepeatedUint32Wrapper.ProtobufOutput -Required.JsonInput.RepeatedUint64Wrapper.JsonOutput -Required.JsonInput.RepeatedUint64Wrapper.ProtobufOutput -Required.JsonInput.StringFieldEscape.JsonOutput -Required.JsonInput.StringFieldEscape.ProtobufOutput -Required.JsonInput.StringFieldNotAString -Required.JsonInput.StringFieldSurrogatePair.JsonOutput -Required.JsonInput.StringFieldSurrogatePair.ProtobufOutput -Required.JsonInput.StringFieldUnicodeEscape.JsonOutput -Required.JsonInput.StringFieldUnicodeEscape.ProtobufOutput -Required.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.JsonOutput -Required.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.ProtobufOutput -Required.JsonInput.Struct.JsonOutput -Required.JsonInput.Struct.ProtobufOutput -Required.JsonInput.TimestampMaxValue.JsonOutput -Required.JsonInput.TimestampMaxValue.ProtobufOutput -Required.JsonInput.TimestampMinValue.JsonOutput -Required.JsonInput.TimestampMinValue.ProtobufOutput -Required.JsonInput.TimestampRepeatedValue.JsonOutput -Required.JsonInput.TimestampRepeatedValue.ProtobufOutput -Required.JsonInput.TimestampWithNegativeOffset.JsonOutput -Required.JsonInput.TimestampWithNegativeOffset.ProtobufOutput -Required.JsonInput.TimestampWithPositiveOffset.JsonOutput -Required.JsonInput.TimestampWithPositiveOffset.ProtobufOutput -Required.JsonInput.Uint32FieldMaxFloatValue.JsonOutput -Required.JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput -Required.JsonInput.Uint32MapField.JsonOutput -Required.JsonInput.Uint32MapField.ProtobufOutput -Required.JsonInput.Uint64FieldMaxValue.JsonOutput -Required.JsonInput.Uint64FieldMaxValue.ProtobufOutput -Required.JsonInput.Uint64MapField.JsonOutput -Required.JsonInput.Uint64MapField.ProtobufOutput -Required.JsonInput.ValueAcceptBool.JsonOutput -Required.JsonInput.ValueAcceptBool.ProtobufOutput -Required.JsonInput.ValueAcceptFloat.JsonOutput -Required.JsonInput.ValueAcceptFloat.ProtobufOutput -Required.JsonInput.ValueAcceptInteger.JsonOutput -Required.JsonInput.ValueAcceptInteger.ProtobufOutput -Required.JsonInput.ValueAcceptList.JsonOutput -Required.JsonInput.ValueAcceptList.ProtobufOutput -Required.JsonInput.ValueAcceptNull.JsonOutput -Required.JsonInput.ValueAcceptNull.ProtobufOutput -Required.JsonInput.ValueAcceptObject.JsonOutput -Required.JsonInput.ValueAcceptObject.ProtobufOutput -Required.JsonInput.ValueAcceptString.JsonOutput -Required.JsonInput.ValueAcceptString.ProtobufOutput -Required.JsonInput.WrapperTypesWithNullValue.ProtobufOutput -Required.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput -Required.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput -Required.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput -Required.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput -Required.TimestampProtoInputTooLarge.JsonOutput -Required.TimestampProtoInputTooSmall.JsonOutput diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec index d1a533842a..3823e20583 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.11.0-rc1 + 3.11.2 Google Inc. protobuf-packages https://github.com/protocolbuffers/protobuf/blob/master/LICENSE diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj index 837b5658ff..e8e33e27e6 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.11.0-rc1 + 3.11.2 6 Google Inc. netstandard1.0;netstandard2.0;net45 diff --git a/java/bom/pom.xml b/java/bom/pom.xml index 59f0846b68..ea15d48190 100644 --- a/java/bom/pom.xml +++ b/java/bom/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-bom - 3.11.0-rc-1 + 3.11.2 pom Protocol Buffers [BOM] diff --git a/java/core/pom.xml b/java/core/pom.xml index 737a9c167a..a57f2aa43c 100644 --- a/java/core/pom.xml +++ b/java/core/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.11.0-rc-1 + 3.11.2 protobuf-java diff --git a/java/lite/pom.xml b/java/lite/pom.xml index fc91b2c333..81e052104f 100644 --- a/java/lite/pom.xml +++ b/java/lite/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.11.0-rc-1 + 3.11.2 protobuf-javalite diff --git a/java/pom.xml b/java/pom.xml index 04443859f8..89aeb632c5 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.11.0-rc-1 + 3.11.2 pom Protocol Buffers [Parent] diff --git a/java/util/pom.xml b/java/util/pom.xml index 082c7ddafa..c4f0e5499d 100644 --- a/java/util/pom.xml +++ b/java/util/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.11.0-rc-1 + 3.11.2 protobuf-java-util diff --git a/js/package.json b/js/package.json index 2cfba39ba8..a2fb371742 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "google-protobuf", - "version": "3.11.0-rc.1", + "version": "3.11.2", "description": "Protocol Buffers for JavaScript", "main": "google-protobuf.js", "files": [ diff --git a/kokoro/linux/dockerfile/test/python_stretch/Dockerfile b/kokoro/linux/dockerfile/test/python_stretch/Dockerfile index 1dba53087f..10790b9c3e 100644 --- a/kokoro/linux/dockerfile/test/python_stretch/Dockerfile +++ b/kokoro/linux/dockerfile/test/python_stretch/Dockerfile @@ -40,8 +40,10 @@ RUN apt-get update && apt-get -t testing install -y \ python3.5 \ python3.6 \ python3.7 \ + python3.8 \ python3-all-dev RUN curl https://bootstrap.pypa.io/get-pip.py | python3.5 RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6 RUN curl https://bootstrap.pypa.io/get-pip.py | python3.7 +RUN curl https://bootstrap.pypa.io/get-pip.py | python3.8 diff --git a/kokoro/linux/python38/build.sh b/kokoro/linux/python38/build.sh new file mode 100755 index 0000000000..9609939a48 --- /dev/null +++ b/kokoro/linux/python38/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# This is the top-level script we give to Kokoro as the entry point for +# running the "pull request" project: +# +# This script selects a specific Dockerfile (for building a Docker image) and +# a script to run inside that image. Then we delegate to the general +# build_and_run_docker.sh script. + +# Change to repo root +cd $(dirname $0)/../../.. + +export DOCKERHUB_ORGANIZATION=protobuftesting +export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python_stretch +export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh +export OUTPUT_DIR=testoutput +export TEST_SET="python38" +./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python38/continuous.cfg b/kokoro/linux/python38/continuous.cfg new file mode 100644 index 0000000000..e2fc4136f0 --- /dev/null +++ b/kokoro/linux/python38/continuous.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/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/python38/presubmit.cfg b/kokoro/linux/python38/presubmit.cfg new file mode 100644 index 0000000000..e2fc4136f0 --- /dev/null +++ b/kokoro/linux/python38/presubmit.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/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/python38_cpp/build.sh b/kokoro/linux/python38_cpp/build.sh new file mode 100755 index 0000000000..c5cd6eeb42 --- /dev/null +++ b/kokoro/linux/python38_cpp/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# This is the top-level script we give to Kokoro as the entry point for +# running the "pull request" project: +# +# This script selects a specific Dockerfile (for building a Docker image) and +# a script to run inside that image. Then we delegate to the general +# build_and_run_docker.sh script. + +# Change to repo root +cd $(dirname $0)/../../.. + +export DOCKERHUB_ORGANIZATION=protobuftesting +export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python_stretch +export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh +export OUTPUT_DIR=testoutput +export TEST_SET="python38_cpp" +./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python38_cpp/continuous.cfg b/kokoro/linux/python38_cpp/continuous.cfg new file mode 100644 index 0000000000..b1b0e550ff --- /dev/null +++ b/kokoro/linux/python38_cpp/continuous.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_cpp/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/python38_cpp/presubmit.cfg b/kokoro/linux/python38_cpp/presubmit.cfg new file mode 100644 index 0000000000..b1b0e550ff --- /dev/null +++ b/kokoro/linux/python38_cpp/presubmit.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_cpp/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/release/python/linux/build_artifacts.sh b/kokoro/release/python/linux/build_artifacts.sh index 5f9eaa19c8..fd9d5a9395 100755 --- a/kokoro/release/python/linux/build_artifacts.sh +++ b/kokoro/release/python/linux/build_artifacts.sh @@ -53,3 +53,4 @@ build_artifact_version 2.7 build_artifact_version 3.5 build_artifact_version 3.6 build_artifact_version 3.7 +build_artifact_version 3.8 diff --git a/kokoro/release/python/macos/build_artifacts.sh b/kokoro/release/python/macos/build_artifacts.sh index 148d1f9bab..15aae39777 100755 --- a/kokoro/release/python/macos/build_artifacts.sh +++ b/kokoro/release/python/macos/build_artifacts.sh @@ -50,7 +50,13 @@ build_artifact_version() { mv wheelhouse/* $ARTIFACT_DIR } +export MB_PYTHON_OSX_VER=10.9 build_artifact_version 2.7 -build_artifact_version 3.5 build_artifact_version 3.6 build_artifact_version 3.7 +build_artifact_version 3.8 + +# python OSX10.9 does not have python 3.5 +export MB_PYTHON_OSX_VER=10.6 +build_artifact_version 3.5 + diff --git a/kokoro/release/python/windows/build_artifacts.bat b/kokoro/release/python/windows/build_artifacts.bat index 9a6842ac91..70a86a199c 100644 --- a/kokoro/release/python/windows/build_artifacts.bat +++ b/kokoro/release/python/windows/build_artifacts.bat @@ -62,6 +62,16 @@ SET PYTHON_VERSION=3.7 SET PYTHON_ARCH=64 CALL build_single_artifact.bat || goto :error +SET PYTHON=C:\python38_32bit +SET PYTHON_VERSION=3.8 +SET PYTHON_ARCH=32 +CALL build_single_artifact.bat || goto :error + +SET PYTHON=C:\python38 +SET PYTHON_VERSION=3.8 +SET PYTHON_ARCH=64 +CALL build_single_artifact.bat || goto :error + goto :EOF :error diff --git a/kokoro/release/python/windows/build_single_artifact.bat b/kokoro/release/python/windows/build_single_artifact.bat index d7cd062c10..45843e1a09 100644 --- a/kokoro/release/python/windows/build_single_artifact.bat +++ b/kokoro/release/python/windows/build_single_artifact.bat @@ -18,6 +18,12 @@ if %PYTHON%==C:\python37_32bit set vcplatform=Win32 if %PYTHON%==C:\python37 set generator=Visual Studio 14 Win64 if %PYTHON%==C:\python37 set vcplatform=x64 +if %PYTHON%==C:\python38_32bit set generator=Visual Studio 14 +if %PYTHON%==C:\python38_32bit set vcplatform=Win32 + +if %PYTHON%==C:\python38 set generator=Visual Studio 14 Win64 +if %PYTHON%==C:\python38 set vcplatform=x64 + REM Prepend newly installed Python to the PATH of this build (this cannot be REM done from inside the powershell script as it would require to restart REM the parent CMD process). diff --git a/php/ext/google/protobuf/array.c b/php/ext/google/protobuf/array.c index b52bdf62ca..aa862d9963 100644 --- a/php/ext/google/protobuf/array.c +++ b/php/ext/google/protobuf/array.c @@ -73,7 +73,6 @@ static int repeated_field_array_init(zval *array, upb_fieldtype_t type, uint size ZEND_FILE_LINE_DC); static void repeated_field_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC); -static int repeated_field_has_dimension(zval *object, zval *offset TSRMLS_DC); static HashTable *repeated_field_get_gc(zval *object, CACHED_VALUE **table, int *n TSRMLS_DC); #if PHP_MAJOR_VERSION < 7 @@ -102,7 +101,7 @@ php_proto_zval_ptr_dtor(&intern->array); #endif PHP_PROTO_OBJECT_FREE_END -PHP_PROTO_OBJECT_DTOR_START(RepeatedField, repeated_field) +PHP_PROTO_OBJECT_EMPTY_DTOR_START(RepeatedField, repeated_field) PHP_PROTO_OBJECT_DTOR_END // Define object create method. @@ -488,10 +487,10 @@ PHP_METHOD(RepeatedField, getIterator) { // ----------------------------------------------------------------------------- // Define object free method. -PHP_PROTO_OBJECT_FREE_START(RepeatedFieldIter, repeated_field_iter) +PHP_PROTO_OBJECT_EMPTY_FREE_START(RepeatedFieldIter, repeated_field_iter) PHP_PROTO_OBJECT_FREE_END -PHP_PROTO_OBJECT_DTOR_START(RepeatedFieldIter, repeated_field_iter) +PHP_PROTO_OBJECT_EMPTY_DTOR_START(RepeatedFieldIter, repeated_field_iter) PHP_PROTO_OBJECT_DTOR_END // Define object create method. @@ -519,7 +518,7 @@ PHP_METHOD(RepeatedFieldIter, current) { RepeatedFieldIter *intern = UNBOX(RepeatedFieldIter, getThis()); RepeatedField *repeated_field = intern->repeated_field; - long index; + long index = 0; void *memory; HashTable *table = PHP_PROTO_HASH_OF(repeated_field->array); @@ -527,13 +526,13 @@ PHP_METHOD(RepeatedFieldIter, current) { if (repeated_field->type == UPB_TYPE_MESSAGE) { if (php_proto_zend_hash_index_find_zval(table, intern->position, (void **)&memory) == FAILURE) { - zend_error(E_USER_ERROR, "Element at %d doesn't exist.\n", index); + zend_error(E_USER_ERROR, "Element at %ld doesn't exist.\n", index); return; } } else { if (php_proto_zend_hash_index_find_mem(table, intern->position, (void **)&memory) == FAILURE) { - zend_error(E_USER_ERROR, "Element at %d doesn't exist.\n", index); + zend_error(E_USER_ERROR, "Element at %ld doesn't exist.\n", index); return; } } diff --git a/php/ext/google/protobuf/def.c b/php/ext/google/protobuf/def.c index 7a23105e9a..f10c37cd9b 100644 --- a/php/ext/google/protobuf/def.c +++ b/php/ext/google/protobuf/def.c @@ -69,31 +69,6 @@ static void check_upb_status(const upb_status* status, const char* msg) { } } -// Camel-case the field name and append "Entry" for generated map entry name. -// e.g. map foo_map => FooMapEntry -static void append_map_entry_name(char *result, const char *field_name, - int pos) { - bool cap_next = true; - int i; - - for (i = 0; i < strlen(field_name); ++i) { - if (field_name[i] == '_') { - cap_next = true; - } else if (cap_next) { - // Note: Do not use ctype.h due to locales. - if ('a' <= field_name[i] && field_name[i] <= 'z') { - result[pos++] = field_name[i] - 'a' + 'A'; - } else { - result[pos++] = field_name[i]; - } - cap_next = false; - } else { - result[pos++] = field_name[i]; - } - } - strcat(result, "Entry"); -} - // ----------------------------------------------------------------------------- // GPBType // ----------------------------------------------------------------------------- @@ -682,29 +657,6 @@ static void descriptor_pool_init_c_instance(DescriptorPool *pool TSRMLS_DC) { static void descriptor_pool_free_c(DescriptorPool *pool TSRMLS_DC) { } -static void validate_enumdef(const upb_enumdef *enumdef) { - // Verify that an entry exists with integer value 0. (This is the default - // value.) - const char *lookup = upb_enumdef_iton(enumdef, 0); - if (lookup == NULL) { - zend_error(E_USER_ERROR, - "Enum definition does not contain a value for '0'."); - } -} - -static void validate_msgdef(const upb_msgdef* msgdef) { - // Verify that no required fields exist. proto3 does not support these. - upb_msg_field_iter it; - for (upb_msg_field_begin(&it, msgdef); - !upb_msg_field_done(&it); - upb_msg_field_next(&it)) { - const upb_fielddef* field = upb_msg_iter_field(&it); - if (upb_fielddef_label(field) == UPB_LABEL_REQUIRED) { - zend_error(E_ERROR, "Required fields are unsupported in proto3."); - } - } -} - PHP_METHOD(DescriptorPool, getGeneratedPool) { init_generated_pool_once(TSRMLS_C); #if PHP_MAJOR_VERSION < 7 @@ -725,58 +677,6 @@ PHP_METHOD(InternalDescriptorPool, getGeneratedPool) { #endif } -static size_t classname_len_max(const char *fullname, - const char *package, - const char *php_namespace, - const char *prefix) { - size_t fullname_len = strlen(fullname); - size_t package_len = 0; - size_t prefix_len = 0; - size_t namespace_len = 0; - size_t length = fullname_len; - int i, segment, classname_start = 0; - - if (package != NULL) { - package_len = strlen(package); - } - if (prefix != NULL) { - prefix_len = strlen(prefix); - } - if (php_namespace != NULL) { - namespace_len = strlen(php_namespace); - } - - // Process package - if (package_len > 0) { - segment = 1; - for (i = 0; i < package_len; i++) { - if (package[i] == '.') { - segment++; - } - } - // In case of reserved name in package. - length += 3 * segment; - - classname_start = package_len + 1; - } - - // Process class name - segment = 1; - for (i = classname_start; i < fullname_len; i++) { - if (fullname[i] == '.') { - segment++; - } - } - if (prefix_len == 0) { - length += 3 * segment; - } else { - length += prefix_len * segment; - } - - // The additional 2, one is for preceding '.' and the other is for trailing 0. - return length + namespace_len + 2; -} - static bool is_reserved(const char *segment, int length) { bool result; char* lower = ALLOC_N(char, length + 1); @@ -797,8 +697,6 @@ static void fill_prefix(const char *segment, int length, const char *prefix_given, const char *package_name, stringsink *classname) { - size_t i; - if (prefix_given != NULL && strcmp(prefix_given, "") != 0) { stringsink_string(classname, NULL, prefix_given, strlen(prefix_given), NULL); @@ -834,7 +732,7 @@ static void fill_namespace(const char *package, const char *php_namespace, stringsink_string(classname, NULL, "\\", 1, NULL); } } else if (package != NULL) { - int i = 0, j, offset = 0; + int i = 0, j = 0; size_t package_len = strlen(package); while (i < package_len) { j = i; @@ -868,7 +766,7 @@ static void fill_classname(const char *fullname, while (j < fullname_len && fullname[j] != '.') { j++; } - if (use_nested_submsg || is_first_segment && j == fullname_len) { + if (use_nested_submsg || (is_first_segment && j == fullname_len)) { fill_prefix(fullname + i, j - i, prefix, package, classname); } is_first_segment = false; @@ -907,9 +805,6 @@ static void fill_classname_for_desc(void *desc, bool is_enum) { const char *package = upb_filedef_package(file); const char *php_namespace = upb_filedef_phpnamespace(file); const char *prefix = upb_filedef_phpprefix(file); - size_t classname_len = - classname_len_max(fullname, package, php_namespace, prefix); - char* after_package; stringsink namesink; stringsink_init(&namesink); @@ -958,7 +853,7 @@ void register_class(void *desc, bool is_enum TSRMLS_DC) { zend_error( E_ERROR, "Generated message class %s hasn't been defined (%s)", - classname); + classname, fullname); return; } ret = PHP_PROTO_CE_UNREF(pce); @@ -1107,9 +1002,7 @@ void internal_add_generated_file(const char *data, PHP_PROTO_SIZE data_len, PHP_METHOD(InternalDescriptorPool, internalAddGeneratedFile) { char *data = NULL; PHP_PROTO_SIZE data_len; - upb_filedef **files; zend_bool use_nested_submsg = false; - size_t i; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &data, &data_len, &use_nested_submsg) == diff --git a/php/ext/google/protobuf/encode_decode.c b/php/ext/google/protobuf/encode_decode.c index e4b3566b52..8eaa5d22ee 100644 --- a/php/ext/google/protobuf/encode_decode.c +++ b/php/ext/google/protobuf/encode_decode.c @@ -333,25 +333,6 @@ DEFINE_SINGULAR_HANDLER(double, double) #undef DEFINE_SINGULAR_HANDLER -#if PHP_MAJOR_VERSION < 7 -static void *empty_php_string(zval** value_ptr) { - SEPARATE_ZVAL_IF_NOT_REF(value_ptr); - if (Z_TYPE_PP(value_ptr) == IS_STRING && - !IS_INTERNED(Z_STRVAL_PP(value_ptr))) { - FREE(Z_STRVAL_PP(value_ptr)); - } - ZVAL_EMPTY_STRING(*value_ptr); - return (void*)(*value_ptr); -} -#else -static void *empty_php_string(zval* value_ptr) { - if (Z_TYPE_P(value_ptr) == IS_STRING) { - zend_string_release(Z_STR_P(value_ptr)); - } - ZVAL_EMPTY_STRING(value_ptr); - return value_ptr; -} -#endif #if PHP_MAJOR_VERSION < 7 static void new_php_string(zval** value_ptr, const char* str, size_t len) { SEPARATE_ZVAL_IF_NOT_REF(value_ptr); @@ -830,7 +811,6 @@ static map_handlerdata_t* new_map_handlerdata( static bool oneof##type##_handler(void* closure, const void* hd, \ ctype val) { \ const oneof_handlerdata_t* oneofdata = hd; \ - MessageHeader* msg = (MessageHeader*)closure; \ DEREF(message_data(closure), oneofdata->case_ofs, uint32_t) = \ oneofdata->oneof_case_num; \ DEREF(message_data(closure), oneofdata->ofs, ctype) = val; \ @@ -886,22 +866,6 @@ static void oneof_cleanup(MessageHeader* msg, } // Handlers for string/bytes in a oneof. -static void *oneofbytes_handler(void *closure, - const void *hd, - size_t size_hint) { - MessageHeader* msg = closure; - const oneof_handlerdata_t *oneofdata = hd; - - oneof_cleanup(msg, oneofdata); - - DEREF(message_data(msg), oneofdata->case_ofs, uint32_t) = - oneofdata->oneof_case_num; - DEREF(message_data(msg), oneofdata->ofs, CACHED_VALUE*) = - OBJ_PROP(&msg->std, oneofdata->property_ofs); - - return empty_php_string(DEREF( - message_data(msg), oneofdata->ofs, CACHED_VALUE*)); -} static bool oneofstr_end_handler(void *closure, const void *hd) { stringfields_parseframe_t* frame = closure; MessageHeader* msg = (MessageHeader*)frame->closure; @@ -984,7 +948,6 @@ static void* wrapper_submsg_handler(void* closure, const void* hd) { TSRMLS_FETCH(); DescriptorInternal* subdesc = get_msgdef_desc(submsgdata->md); register_class(subdesc, false TSRMLS_CC); - zend_class_entry* subklass = subdesc->klass; zval* submsg_php; MessageHeader* submsg; wrapperfields_parseframe_t* frame = @@ -999,6 +962,12 @@ static void* wrapper_submsg_handler(void* closure, const void* hd) { frame->submsg = submsg; frame->is_msg = true; } else { + if (Z_TYPE_P(CACHED_PTR_TO_ZVAL_PTR(cached)) == IS_NULL) { + // Needs to initiate the wrapper message + const upb_msgdef* msgdef = subdesc->msgdef; + const upb_fielddef* f = upb_msgdef_itof(msgdef, 1); + native_slot_get_default(upb_fielddef_type(f), cached TSRMLS_CC); + } // In this case, wrapper message hasn't been created and value will be // stored in cache directly. frame->submsg = cached; @@ -1016,7 +985,6 @@ static void* wrapper_oneofsubmsg_handler(void* closure, const void* hd) { TSRMLS_FETCH(); DescriptorInternal* subdesc = get_msgdef_desc(oneofdata->md); register_class(subdesc, false TSRMLS_CC); - zend_class_entry* subklass = subdesc->klass; wrapperfields_parseframe_t* frame = (wrapperfields_parseframe_t*)malloc(sizeof(wrapperfields_parseframe_t)); CACHED_VALUE* cached = OBJ_PROP(&msg->std, oneofdata->property_ofs); @@ -1024,6 +992,12 @@ static void* wrapper_oneofsubmsg_handler(void* closure, const void* hd) { if (oldcase != oneofdata->oneof_case_num) { oneof_cleanup(msg, oneofdata); + if (Z_TYPE_P(CACHED_PTR_TO_ZVAL_PTR(cached)) == IS_NULL) { + // Needs to initiate the wrapper message + const upb_msgdef* msgdef = subdesc->msgdef; + const upb_fielddef* f = upb_msgdef_itof(msgdef, 1); + native_slot_get_default(upb_fielddef_type(f), cached TSRMLS_CC); + } frame->submsg = cached; frame->is_msg = false; } else if (Z_TYPE_P(CACHED_PTR_TO_ZVAL_PTR(cached)) == IS_OBJECT) { @@ -1676,11 +1650,10 @@ static void putjsonlistvalue( upb_status status; upb_sink subsink; const upb_fielddef* f = upb_msgdef_itof(desc->msgdef, 1); - uint32_t offset = desc->layout->fields[upb_fielddef_index(f)].offset; zval* array; RepeatedField* intern; HashTable *ht; - int size, i; + int size; upb_sink_startmsg(sink); @@ -1710,7 +1683,6 @@ static void putjsonstruct( upb_status status; upb_sink subsink; const upb_fielddef* f = upb_msgdef_itof(desc->msgdef, 1); - uint32_t offset = desc->layout->fields[upb_fielddef_index(f)].offset; zval* map; Map* intern; int size; @@ -2235,8 +2207,6 @@ static void discard_unknown_fields(MessageHeader* msg) { !upb_msg_field_done(&it); upb_msg_field_next(&it)) { upb_fielddef* f = upb_msg_iter_field(&it); - uint32_t offset = desc->layout->fields[upb_fielddef_index(f)].offset; - bool containing_oneof = false; if (upb_fielddef_containingoneof(f)) { uint32_t oneof_case_offset = @@ -2249,12 +2219,11 @@ static void discard_unknown_fields(MessageHeader* msg) { } // Otherwise, fall through to the appropriate singular-field handler // below. - containing_oneof = true; } if (is_map_field(f)) { MapIter map_it; - int len, size; + int len; const upb_fielddef* value_field; value_field = map_field_value(f); @@ -2263,7 +2232,6 @@ static void discard_unknown_fields(MessageHeader* msg) { zval* map_php = CACHED_PTR_TO_ZVAL_PTR(find_zval_property(msg, f)); if (ZVAL_IS_NULL(map_php)) continue; - Map* intern = UNBOX(Map, map_php); for (map_begin(map_php, &map_it TSRMLS_CC); !map_done(&map_it); map_next(&map_it)) { upb_value value = map_iter_value(&map_it, &len); diff --git a/php/ext/google/protobuf/map.c b/php/ext/google/protobuf/map.c index 2764788b46..f49afcbba7 100644 --- a/php/ext/google/protobuf/map.c +++ b/php/ext/google/protobuf/map.c @@ -222,7 +222,7 @@ for (map_begin_internal(intern, &it); !map_done(&it); map_next(&it)) { upb_strtable_uninit(&intern->table); PHP_PROTO_OBJECT_FREE_END -PHP_PROTO_OBJECT_DTOR_START(Map, map_field) +PHP_PROTO_OBJECT_EMPTY_DTOR_START(Map, map_field) PHP_PROTO_OBJECT_DTOR_END // Define object create method. @@ -383,7 +383,6 @@ static bool map_field_unset_dimension(zval *object, zval *key TSRMLS_DC) { char keybuf[TABLE_KEY_BUF_LENGTH]; const char* keyval = NULL; size_t length = 0; - upb_value v; if (!table_key(intern, key, keybuf, &keyval, &length TSRMLS_CC)) { return false; } @@ -454,7 +453,7 @@ PHP_METHOD(MapField, offsetExists) { } PHP_METHOD(MapField, offsetGet) { - zval *index, *value; + zval *index; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) { return; @@ -495,7 +494,6 @@ PHP_METHOD(MapField, getIterator) { CREATE_OBJ_ON_ALLOCATED_ZVAL_PTR(return_value, map_field_iter_type); - Map *intern = UNBOX(Map, getThis()); MapIter *iter = UNBOX(MapIter, return_value); map_begin(getThis(), iter TSRMLS_CC); } @@ -544,10 +542,10 @@ static zend_function_entry map_field_iter_methods[] = { // ----------------------------------------------------------------------------- // Define object free method. -PHP_PROTO_OBJECT_FREE_START(MapIter, map_field_iter) +PHP_PROTO_OBJECT_EMPTY_FREE_START(MapIter, map_field_iter) PHP_PROTO_OBJECT_FREE_END -PHP_PROTO_OBJECT_DTOR_START(MapIter, map_field_iter) +PHP_PROTO_OBJECT_EMPTY_DTOR_START(MapIter, map_field_iter) PHP_PROTO_OBJECT_DTOR_END // Define object create method. diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c index 9adf3b0179..edd62d0074 100644 --- a/php/ext/google/protobuf/message.c +++ b/php/ext/google/protobuf/message.c @@ -75,8 +75,13 @@ static zval** message_get_property_ptr_ptr(zval* object, zval* member, int type, php_proto_zend_literal key TSRMLS_DC); static HashTable* message_get_gc(zval* object, zval*** table, int* n TSRMLS_DC); #else +#if PHP_VERSION_ID < 70400 static void message_set_property(zval* object, zval* member, zval* value, void** cache_slot); +#else +static zval* message_set_property(zval* object, zval* member, zval* value, + void** cache_slot); +#endif static zval* message_get_property(zval* object, zval* member, int type, void** cache_slot, zval* rv); static zval* message_get_property_ptr_ptr(zval* object, zval* member, int type, @@ -100,7 +105,7 @@ PHP_PROTO_OBJECT_FREE_START(MessageHeader, message) } PHP_PROTO_OBJECT_FREE_END -PHP_PROTO_OBJECT_DTOR_START(MessageHeader, message) +PHP_PROTO_OBJECT_EMPTY_DTOR_START(MessageHeader, message) PHP_PROTO_OBJECT_DTOR_END // Define object create method. @@ -140,13 +145,20 @@ static void message_set_property_internal(zval* object, zval* member, #if PHP_MAJOR_VERSION < 7 static void message_set_property(zval* object, zval* member, zval* value, php_proto_zend_literal key TSRMLS_DC) { -#else +#elif PHP_VERSION_ID < 70400 static void message_set_property(zval* object, zval* member, zval* value, void** cache_slot) { +#else +static zval* message_set_property(zval* object, zval* member, zval* value, + void** cache_slot) { #endif if (Z_TYPE_P(member) != IS_STRING) { zend_error(E_USER_ERROR, "Unexpected type for field name"); +#if PHP_VERSION_ID < 70400 return; +#else + return value; +#endif } #if PHP_MAJOR_VERSION < 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0) @@ -156,10 +168,17 @@ static void message_set_property(zval* object, zval* member, zval* value, #endif // User cannot set property directly (e.g., $m->a = 1) zend_error(E_USER_ERROR, "Cannot access private property."); +#if PHP_VERSION_ID < 70400 return; +#else + return value; +#endif } message_set_property_internal(object, member, value TSRMLS_CC); +#if PHP_VERSION_ID >= 70400 + return value; +#endif } static zval* message_get_property_internal(zval* object, @@ -380,7 +399,6 @@ void Message_construct(zval* msg, zval* array_wrapper) { if (upb_fielddef_issubmsg(value_field)) { const upb_msgdef* submsgdef = upb_fielddef_msgsubdef(value_field); - upb_wellknowntype_t type = upb_msgdef_wellknowntype(submsgdef); is_wrapper = is_wrapper_msg(submsgdef); if (is_wrapper) { @@ -420,7 +438,6 @@ void Message_construct(zval* msg, zval* array_wrapper) { if (upb_fielddef_issubmsg(field)) { const upb_msgdef* submsgdef = upb_fielddef_msgsubdef(field); - upb_wellknowntype_t type = upb_msgdef_wellknowntype(submsgdef); is_wrapper = is_wrapper_msg(submsgdef); if (is_wrapper) { @@ -646,6 +663,9 @@ PHP_METHOD(Message, writeWrapperValue) { CASE_TYPE(BOOL, bool, int8_t) #undef CASE_TYPE + case UPB_TYPE_MESSAGE: + zend_error(E_ERROR, "No wrapper for message."); + break; } } @@ -666,7 +686,6 @@ PHP_METHOD(Message, writeWrapperValue) { const upb_msgdef* submsgdef = upb_fielddef_msgsubdef(field); const upb_fielddef* value_field = upb_msgdef_itof(submsgdef, 1); MessageHeader* submsg = UNBOX(MessageHeader, cached_zval); - CACHED_VALUE* cached_value = find_zval_property(submsg, value_field); layout_set(submsg->descriptor->layout, submsg, value_field, value TSRMLS_CC); } else { @@ -1156,7 +1175,11 @@ PHP_METHOD(Field_Cardinality, name) { zend_throw_exception_ex( NULL, 0 TSRMLS_CC, "Enum Google\\Protobuf\\Field_Cardinality has no name " +#if PHP_MAJOR_VERSION < 7 "defined for value %d.", +#else + "defined for value " ZEND_LONG_FMT ".", +#endif value); } } @@ -1291,7 +1314,11 @@ PHP_METHOD(Field_Kind, name) { default: zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Enum Google\\Protobuf\\Field_Kind has no name " +#if PHP_MAJOR_VERSION < 7 "defined for value %d.", +#else + "defined for value " ZEND_LONG_FMT ".", +#endif value); } } @@ -1362,7 +1389,11 @@ PHP_METHOD(NullValue, name) { default: zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Enum Google\\Protobuf\\NullValue has no name " +#if PHP_MAJOR_VERSION < 7 "defined for value %d.", +#else + "defined for value " ZEND_LONG_FMT ".", +#endif value); } } @@ -1419,7 +1450,11 @@ PHP_METHOD(Syntax, name) { default: zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Enum Google\\Protobuf\\Syntax has no name " +#if PHP_MAJOR_VERSION < 7 "defined for value %d.", +#else + "defined for value " ZEND_LONG_FMT ".", +#endif value); } } @@ -1495,7 +1530,6 @@ static void hex_to_binary(const char* hex, char** binary, int* binary_len) { PHP_METHOD(Any, __construct) { init_file_any(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -1660,7 +1694,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Duration, __construct) { init_file_duration(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -1695,7 +1728,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Timestamp, __construct) { init_file_timestamp(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -1704,7 +1736,6 @@ PHP_PROTO_FIELD_ACCESSORS(Timestamp, timestamp, Nanos, "nanos") PHP_METHOD(Timestamp, fromDateTime) { zval* datetime; - zval member; PHP_PROTO_CE_DECLARE date_interface_ce; if (php_proto_zend_lookup_class("\\DatetimeInterface", 18, @@ -1897,7 +1928,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Api, __construct) { init_file_api(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -1931,7 +1961,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(BoolValue, __construct) { init_file_wrappers(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -1959,7 +1988,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(BytesValue, __construct) { init_file_wrappers(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -1987,7 +2015,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(DoubleValue, __construct) { init_file_wrappers(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2031,7 +2058,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Enum, __construct) { init_file_type(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2071,7 +2097,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(EnumValue, __construct) { init_file_type(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2101,7 +2126,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(FieldMask, __construct) { init_file_field_mask(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2166,7 +2190,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Field, __construct) { init_file_type(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2203,7 +2226,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(FloatValue, __construct) { init_file_wrappers(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2227,7 +2249,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(GPBEmpty, __construct) { init_file_empty(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2254,7 +2275,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Int32Value, __construct) { init_file_wrappers(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2282,7 +2302,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Int64Value, __construct) { init_file_wrappers(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2310,7 +2329,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(ListValue, __construct) { init_file_struct(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2366,7 +2384,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Method, __construct) { init_file_api(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2404,7 +2421,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Mixin, __construct) { init_file_api(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2437,7 +2453,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Option, __construct) { init_file_type(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2467,7 +2482,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(SourceContext, __construct) { init_file_source_context(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2495,7 +2509,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(StringValue, __construct) { init_file_wrappers(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2523,7 +2536,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Struct, __construct) { init_file_struct(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2571,7 +2583,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Type, __construct) { init_file_type(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2604,7 +2615,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(UInt32Value, __construct) { init_file_wrappers(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2632,7 +2642,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(UInt64Value, __construct) { init_file_wrappers(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } @@ -2671,7 +2680,6 @@ PHP_PROTO_INIT_SUBMSGCLASS_END PHP_METHOD(Value, __construct) { init_file_struct(TSRMLS_C); - MessageHeader* intern = UNBOX(MessageHeader, getThis()); INIT_MESSAGE_WITH_ARRAY; } diff --git a/php/ext/google/protobuf/package.xml b/php/ext/google/protobuf/package.xml index bee8b035a4..99080b750f 100644 --- a/php/ext/google/protobuf/package.xml +++ b/php/ext/google/protobuf/package.xml @@ -10,15 +10,15 @@ protobuf-opensource@google.com yes - 2019-11-15 - + 2019-12-10 + - 3.11.0RC1 - 3.11.0 + 3.11.2 + 3.11.2 - beta - beta + stable + stable 3-Clause BSD License GA release. @@ -445,5 +445,61 @@ G A release. 3-Clause BSD License GA release. + + + 3.11.0RC2 + 3.11.0 + + + beta + beta + + 2019-11-21 + + 3-Clause BSD License + GA release. + + + + 3.11.0 + 3.11.0 + + + stable + stable + + 2019-11-25 + + 3-Clause BSD License + GA release. + + + + 3.11.1 + 3.11.1 + + + stable + stable + + 2019-12-02 + + 3-Clause BSD License + GA release. + + + + 3.11.2 + 3.11.2 + + + stable + stable + + 2019-12-10 + + 3-Clause BSD License + GA release. + diff --git a/php/ext/google/protobuf/protobuf.c b/php/ext/google/protobuf/protobuf.c index c635189d4c..e9ac935949 100644 --- a/php/ext/google/protobuf/protobuf.c +++ b/php/ext/google/protobuf/protobuf.c @@ -39,6 +39,8 @@ static PHP_RSHUTDOWN_FUNCTION(protobuf); static PHP_MINIT_FUNCTION(protobuf); static PHP_MSHUTDOWN_FUNCTION(protobuf); +ZEND_DECLARE_MODULE_GLOBALS(protobuf) + // Global map from upb {msg,enum}defs to wrapper Descriptor/EnumDescriptor // instances. static HashTable* upb_def_to_php_obj_map; @@ -47,8 +49,8 @@ static upb_inttable upb_def_to_enumdesc_map_persistent; // Global map from message/enum's php class entry to corresponding wrapper // Descriptor/EnumDescriptor instances. static HashTable* ce_to_php_obj_map; -static upb_inttable ce_to_desc_map_persistent; -static upb_inttable ce_to_enumdesc_map_persistent; +static upb_strtable ce_to_desc_map_persistent; +static upb_strtable ce_to_enumdesc_map_persistent; // Global map from message/enum's proto fully-qualified name to corresponding // wrapper Descriptor/EnumDescriptor instances. static upb_strtable proto_to_desc_map_persistent; @@ -61,8 +63,6 @@ upb_strtable reserved_names; // ----------------------------------------------------------------------------- static void add_to_table(HashTable* t, const void* def, void* value) { - uint nIndex = (ulong)def & t->nTableMask; - zval* pDest = NULL; php_proto_zend_hash_index_update_mem(t, (zend_ulong)def, &value, sizeof(zval*), (void**)&pDest); @@ -77,28 +77,6 @@ static void* get_from_table(const HashTable* t, const void* def) { return *value; } -static bool exist_in_table(const HashTable* t, const void* def) { - void** value; - return (php_proto_zend_hash_index_find_mem(t, (zend_ulong)def, - (void**)&value) == SUCCESS); -} - -static void add_to_strtable(HashTable* t, const char* key, int key_size, - void* value) { - zval* pDest = NULL; - php_proto_zend_hash_update_mem(t, key, key_size, &value, sizeof(void*), - (void**)&pDest); -} - -static void* get_from_strtable(const HashTable* t, const char* key, int key_size) { - void** value; - if (php_proto_zend_hash_find_mem(t, key, key_size, (void**)&value) == - FAILURE) { - return NULL; - } - return *value; -} - void add_def_obj(const void* def, PHP_PROTO_HASHTABLE_VALUE value) { #if PHP_MAJOR_VERSION < 7 Z_ADDREF_P(value); @@ -160,16 +138,28 @@ PHP_PROTO_HASHTABLE_VALUE get_ce_obj(const void* ce) { } void add_ce_desc(const zend_class_entry* ce, DescriptorInternal* desc) { - upb_inttable_insertptr(&ce_to_desc_map_persistent, - ce, upb_value_ptr(desc)); +#if PHP_MAJOR_VERSION < 7 + const char* klass = ce->name; +#else + const char* klass = ZSTR_VAL(ce->name); +#endif + upb_strtable_insert(&ce_to_desc_map_persistent, klass, + upb_value_ptr(desc)); } DescriptorInternal* get_ce_desc(const zend_class_entry* ce) { +#if PHP_MAJOR_VERSION < 7 + const char* klass = ce->name; +#else + const char* klass = ZSTR_VAL(ce->name); +#endif + upb_value v; #ifndef NDEBUG v.ctype = UPB_CTYPE_PTR; #endif - if (!upb_inttable_lookupptr(&ce_to_desc_map_persistent, ce, &v)) { + + if (!upb_strtable_lookup(&ce_to_desc_map_persistent, klass, &v)) { return NULL; } else { return upb_value_getptr(v); @@ -177,16 +167,26 @@ DescriptorInternal* get_ce_desc(const zend_class_entry* ce) { } void add_ce_enumdesc(const zend_class_entry* ce, EnumDescriptorInternal* desc) { - upb_inttable_insertptr(&ce_to_enumdesc_map_persistent, - ce, upb_value_ptr(desc)); +#if PHP_MAJOR_VERSION < 7 + const char* klass = ce->name; +#else + const char* klass = ZSTR_VAL(ce->name); +#endif + upb_strtable_insert(&ce_to_enumdesc_map_persistent, klass, + upb_value_ptr(desc)); } EnumDescriptorInternal* get_ce_enumdesc(const zend_class_entry* ce) { +#if PHP_MAJOR_VERSION < 7 + const char* klass = ce->name; +#else + const char* klass = ZSTR_VAL(ce->name); +#endif upb_value v; #ifndef NDEBUG v.ctype = UPB_CTYPE_PTR; #endif - if (!upb_inttable_lookupptr(&ce_to_enumdesc_map_persistent, ce, &v)) { + if (!upb_strtable_lookup(&ce_to_enumdesc_map_persistent, klass, &v)) { return NULL; } else { return upb_value_getptr(v); @@ -347,17 +347,13 @@ static void php_proto_hashtable_descriptor_release(zval* value) { } efree(ptr); } - -static void test_release(void* value) { - void* ptr = value; -} #endif -static initialize_persistent_descriptor_pool(TSRMLS_D) { +static void initialize_persistent_descriptor_pool(TSRMLS_D) { upb_inttable_init(&upb_def_to_desc_map_persistent, UPB_CTYPE_PTR); upb_inttable_init(&upb_def_to_enumdesc_map_persistent, UPB_CTYPE_PTR); - upb_inttable_init(&ce_to_desc_map_persistent, UPB_CTYPE_PTR); - upb_inttable_init(&ce_to_enumdesc_map_persistent, UPB_CTYPE_PTR); + upb_strtable_init(&ce_to_desc_map_persistent, UPB_CTYPE_PTR); + upb_strtable_init(&ce_to_enumdesc_map_persistent, UPB_CTYPE_PTR); upb_strtable_init(&proto_to_desc_map_persistent, UPB_CTYPE_PTR); upb_strtable_init(&class_to_desc_map_persistent, UPB_CTYPE_PTR); @@ -386,7 +382,29 @@ static PHP_RINIT_FUNCTION(protobuf) { generated_pool_php = NULL; internal_generated_pool_php = NULL; - if (!PROTOBUF_G(keep_descriptor_pool_after_request)) { + if (PROTOBUF_G(keep_descriptor_pool_after_request)) { + // Needs to clean up obsolete class entry + upb_strtable_iter i; + upb_value v; + + DescriptorInternal* desc; + for(upb_strtable_begin(&i, &ce_to_desc_map_persistent); + !upb_strtable_done(&i); + upb_strtable_next(&i)) { + v = upb_strtable_iter_value(&i); + desc = upb_value_getptr(v); + desc->klass = NULL; + } + + EnumDescriptorInternal* enumdesc; + for(upb_strtable_begin(&i, &ce_to_enumdesc_map_persistent); + !upb_strtable_done(&i); + upb_strtable_next(&i)) { + v = upb_strtable_iter_value(&i); + enumdesc = upb_value_getptr(v); + enumdesc->klass = NULL; + } + } else { initialize_persistent_descriptor_pool(TSRMLS_C); } @@ -425,7 +443,7 @@ static void cleanup_enumdesc_table(upb_inttable* t) { } } -static cleanup_persistent_descriptor_pool(TSRMLS_D) { +static void cleanup_persistent_descriptor_pool(TSRMLS_D) { // Clean up // Only needs to clean one map out of three (def=>desc, ce=>desc, proto=>desc) @@ -436,8 +454,8 @@ static cleanup_persistent_descriptor_pool(TSRMLS_D) { upb_inttable_uninit(&upb_def_to_desc_map_persistent); upb_inttable_uninit(&upb_def_to_enumdesc_map_persistent); - upb_inttable_uninit(&ce_to_desc_map_persistent); - upb_inttable_uninit(&ce_to_enumdesc_map_persistent); + upb_strtable_uninit(&ce_to_desc_map_persistent); + upb_strtable_uninit(&ce_to_enumdesc_map_persistent); upb_strtable_uninit(&proto_to_desc_map_persistent); upb_strtable_uninit(&class_to_desc_map_persistent); } @@ -480,10 +498,7 @@ static PHP_RSHUTDOWN_FUNCTION(protobuf) { static void reserved_names_init() { size_t i; - upb_value v; -#ifndef NDEBUG - v.ctype = UPB_CTYPE_UINT64; -#endif + upb_value v = upb_value_bool(false); for (i = 0; i < kReservedNamesSize; i++) { upb_strtable_insert2(&reserved_names, kReservedNames[i], strlen(kReservedNames[i]), v); diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index 0fd095bef5..4e6d56a358 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -37,7 +37,7 @@ #include "upb.h" #define PHP_PROTOBUF_EXTNAME "protobuf" -#define PHP_PROTOBUF_VERSION "3.11.0RC1" +#define PHP_PROTOBUF_VERSION "3.11.2" #define MAX_LENGTH_OF_INT64 20 #define SIZEOF_INT64 8 @@ -143,7 +143,6 @@ #define PHP_PROTO_INIT_SUBMSGCLASS_START(CLASSNAME, CAMELNAME, LOWWERNAME) \ void LOWWERNAME##_init(TSRMLS_D) { \ zend_class_entry class_type; \ - const char* class_name = CLASSNAME; \ INIT_CLASS_ENTRY_EX(class_type, CLASSNAME, strlen(CLASSNAME), \ LOWWERNAME##_methods); \ LOWWERNAME##_type = zend_register_internal_class_ex( \ @@ -156,7 +155,6 @@ #define PHP_PROTO_INIT_ENUMCLASS_START(CLASSNAME, CAMELNAME, LOWWERNAME) \ void LOWWERNAME##_init(TSRMLS_D) { \ zend_class_entry class_type; \ - const char* class_name = CLASSNAME; \ INIT_CLASS_ENTRY_EX(class_type, CLASSNAME, strlen(CLASSNAME), \ LOWWERNAME##_methods); \ LOWWERNAME##_type = zend_register_internal_class(&class_type TSRMLS_CC); @@ -166,7 +164,6 @@ #define PHP_PROTO_INIT_CLASS_START(CLASSNAME, CAMELNAME, LOWWERNAME) \ void LOWWERNAME##_init(TSRMLS_D) { \ zend_class_entry class_type; \ - const char* class_name = CLASSNAME; \ INIT_CLASS_ENTRY_EX(class_type, CLASSNAME, strlen(CLASSNAME), \ LOWWERNAME##_methods); \ LOWWERNAME##_type = zend_register_internal_class(&class_type TSRMLS_CC); \ @@ -187,6 +184,9 @@ PHP_PROTO_FREE_CLASS_OBJECT(NAME, LOWWERNAME##_free, LOWWERNAME##_handlers); \ } +#define PHP_PROTO_OBJECT_EMPTY_FREE_START(classname, lowername) \ + void lowername##_free(void* object TSRMLS_DC) { \ + classname* intern = object; #define PHP_PROTO_OBJECT_FREE_START(classname, lowername) \ void lowername##_free(void* object TSRMLS_DC) { \ classname* intern = object; @@ -195,6 +195,7 @@ efree(intern); \ } +#define PHP_PROTO_OBJECT_EMPTY_DTOR_START(classname, lowername) #define PHP_PROTO_OBJECT_DTOR_START(classname, lowername) #define PHP_PROTO_OBJECT_DTOR_END @@ -410,32 +411,28 @@ static inline int php_proto_zend_hash_get_current_data_ex(HashTable* ht, zend_object std; \ }; -#define PHP_PROTO_INIT_SUBMSGCLASS_START(CLASSNAME, CAMELNAME, LOWWERNAME) \ - void LOWWERNAME##_init(TSRMLS_D) { \ - zend_class_entry class_type; \ - const char* class_name = CLASSNAME; \ - INIT_CLASS_ENTRY_EX(class_type, CLASSNAME, strlen(CLASSNAME), \ - LOWWERNAME##_methods); \ - LOWWERNAME##_type = zend_register_internal_class_ex( \ - &class_type, message_type TSRMLS_CC); \ - zend_do_inheritance(LOWWERNAME##_type, message_type TSRMLS_CC); +#define PHP_PROTO_INIT_SUBMSGCLASS_START(CLASSNAME, CAMELNAME, LOWWERNAME) \ + void LOWWERNAME##_init(TSRMLS_D) { \ + zend_class_entry class_type; \ + INIT_CLASS_ENTRY_EX(class_type, CLASSNAME, strlen(CLASSNAME), \ + LOWWERNAME##_methods); \ + LOWWERNAME##_type = zend_register_internal_class(&class_type); \ + zend_do_inheritance(LOWWERNAME##_type, message_type); #define PHP_PROTO_INIT_SUBMSGCLASS_END \ } #define PHP_PROTO_INIT_ENUMCLASS_START(CLASSNAME, CAMELNAME, LOWWERNAME) \ void LOWWERNAME##_init(TSRMLS_D) { \ zend_class_entry class_type; \ - const char* class_name = CLASSNAME; \ INIT_CLASS_ENTRY_EX(class_type, CLASSNAME, strlen(CLASSNAME), \ LOWWERNAME##_methods); \ - LOWWERNAME##_type = zend_register_internal_class(&class_type TSRMLS_CC); + LOWWERNAME##_type = zend_register_internal_class(&class_type); #define PHP_PROTO_INIT_ENUMCLASS_END \ } #define PHP_PROTO_INIT_CLASS_START(CLASSNAME, CAMELNAME, LOWWERNAME) \ void LOWWERNAME##_init(TSRMLS_D) { \ zend_class_entry class_type; \ - const char* class_name = CLASSNAME; \ INIT_CLASS_ENTRY_EX(class_type, CLASSNAME, strlen(CLASSNAME), \ LOWWERNAME##_methods); \ LOWWERNAME##_type = zend_register_internal_class(&class_type TSRMLS_CC); \ @@ -449,6 +446,8 @@ static inline int php_proto_zend_hash_get_current_data_ex(HashTable* ht, #define PHP_PROTO_INIT_CLASS_END \ } +#define PHP_PROTO_OBJECT_EMPTY_FREE_START(classname, lowername) \ + void lowername##_free(zend_object* object) { #define PHP_PROTO_OBJECT_FREE_START(classname, lowername) \ void lowername##_free(zend_object* object) { \ classname* intern = \ @@ -456,6 +455,8 @@ static inline int php_proto_zend_hash_get_current_data_ex(HashTable* ht, #define PHP_PROTO_OBJECT_FREE_END \ } +#define PHP_PROTO_OBJECT_EMPTY_DTOR_START(classname, lowername) \ + void lowername##_dtor(zend_object* object) { #define PHP_PROTO_OBJECT_DTOR_START(classname, lowername) \ void lowername##_dtor(zend_object* object) { \ classname* intern = \ @@ -569,8 +570,8 @@ static inline int php_proto_zend_lookup_class( LOWERNAME##_free_c(intern TSRMLS_CC); \ PHP_PROTO_OBJECT_FREE_END -#define DEFINE_PROTOBUF_DTOR(CAMELNAME, LOWERNAME) \ - PHP_PROTO_OBJECT_DTOR_START(CAMELNAME, LOWERNAME) \ +#define DEFINE_PROTOBUF_DTOR(CAMELNAME, LOWERNAME) \ + PHP_PROTO_OBJECT_EMPTY_DTOR_START(CAMELNAME, LOWERNAME) \ PHP_PROTO_OBJECT_DTOR_END #define DEFINE_CLASS(NAME, LOWERNAME, string_name) \ @@ -689,7 +690,7 @@ ZEND_BEGIN_MODULE_GLOBALS(protobuf) zend_bool keep_descriptor_pool_after_request; ZEND_END_MODULE_GLOBALS(protobuf) -ZEND_DECLARE_MODULE_GLOBALS(protobuf) +ZEND_EXTERN_MODULE_GLOBALS(protobuf) #ifdef ZTS #define PROTOBUF_G(v) TSRMG(protobuf_globals_id, zend_protobuf_globals *, v) diff --git a/php/ext/google/protobuf/storage.c b/php/ext/google/protobuf/storage.c index 235c5df8a8..fec7335847 100644 --- a/php/ext/google/protobuf/storage.c +++ b/php/ext/google/protobuf/storage.c @@ -100,8 +100,10 @@ bool native_slot_set(upb_fieldtype_t type, const zend_class_entry* klass, if (EXPECTED(cached_zval != NULL)) { #if PHP_MAJOR_VERSION < 7 REPLACE_ZVAL_VALUE((zval**)memory, value, 1); -#else +#elif PHP_VERSION_ID < 70400 zend_assign_to_variable(cached_zval, value, IS_CV); +#else + zend_assign_to_variable(cached_zval, value, IS_CV, 0); #endif } break; @@ -272,7 +274,6 @@ bool native_slot_set_by_map(upb_fieldtype_t type, const zend_class_entry* klass, } void native_slot_init(upb_fieldtype_t type, void* memory, CACHED_VALUE* cache) { - zval* tmp = NULL; switch (type) { case UPB_TYPE_FLOAT: DEREF(memory, float) = 0.0; @@ -577,11 +578,6 @@ uint32_t* slot_oneof_case(MessageLayout* layout, const void* storage, layout->fields[upb_fielddef_index(field)].case_offset); } -static int slot_property_cache(MessageLayout* layout, const void* storage, - const upb_fielddef* field) { - return layout->fields[upb_fielddef_index(field)].cache_index; -} - void* slot_memory(MessageLayout* layout, const void* storage, const upb_fielddef* field) { return ((uint8_t*)storage) + layout->fields[upb_fielddef_index(field)].offset; @@ -998,7 +994,6 @@ static void native_slot_merge_by_array(const upb_fielddef* field, const void* fr break; } case UPB_TYPE_MESSAGE: { - const upb_msgdef* msg = upb_fielddef_msgsubdef(field); DescriptorInternal* desc = get_msgdef_desc(upb_fielddef_msgsubdef(field)); register_class(desc, false TSRMLS_CC); zend_class_entry* ce = desc->klass; @@ -1168,7 +1163,7 @@ void layout_merge(MessageLayout* layout, MessageHeader* from, const char* layout_get_oneof_case(MessageLayout* layout, const void* storage, const upb_oneofdef* oneof TSRMLS_DC) { upb_oneof_iter i; - const upb_fielddef* first_field; + const upb_fielddef* first_field = NULL; // Oneof is guaranteed to have at least one field. Get the first field. for(upb_oneof_begin(&i, oneof); !upb_oneof_done(&i); upb_oneof_next(&i)) { diff --git a/php/ext/google/protobuf/type_check.c b/php/ext/google/protobuf/type_check.c index af35b90318..84d06be7ef 100644 --- a/php/ext/google/protobuf/type_check.c +++ b/php/ext/google/protobuf/type_check.c @@ -407,8 +407,6 @@ bool protobuf_convert_to_bool(zval* from, int8_t* to) { *to = (int8_t)(Z_LVAL_P(from) != 0); break; case IS_STRING: { - char* strval = Z_STRVAL_P(from); - if (Z_STRLEN_P(from) == 0 || (Z_STRLEN_P(from) == 1 && Z_STRVAL_P(from)[0] == '0')) { *to = 0; @@ -496,7 +494,11 @@ PHP_METHOD(Util, checkMessage) { if (!instanceof_function(Z_OBJCE_P(val), klass TSRMLS_CC)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Given value is not an instance of %s.", +#if PHP_MAJOR_VERSION < 7 klass->name); +#else + ZSTR_VAL(klass->name)); +#endif return; } RETURN_ZVAL(val, 1, 0); @@ -541,7 +543,11 @@ void check_repeated_field(const zend_class_entry* klass, PHP_PROTO_LONG type, if (!instanceof_function(Z_OBJCE_P(val), repeated_field_type TSRMLS_CC)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Given value is not an instance of %s.", +#if PHP_MAJOR_VERSION < 7 repeated_field_type->name); +#else + ZSTR_VAL(repeated_field_type->name)); +#endif return; } RepeatedField* intern = UNBOX(RepeatedField, val); @@ -553,7 +559,12 @@ void check_repeated_field(const zend_class_entry* klass, PHP_PROTO_LONG type, if (klass != NULL && intern->msg_ce != klass) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Expect a repeated field of %s, but %s is given.", +#if PHP_MAJOR_VERSION < 7 klass->name, intern->msg_ce->name); +#else + ZSTR_VAL(klass->name), + ZSTR_VAL(intern->msg_ce->name)); +#endif return; } RETURN_ZVAL(val, 1, 0); @@ -617,7 +628,11 @@ void check_map_field(const zend_class_entry* klass, PHP_PROTO_LONG key_type, if (!instanceof_function(Z_OBJCE_P(val), map_field_type TSRMLS_CC)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Given value is not an instance of %s.", +#if PHP_MAJOR_VERSION < 7 map_field_type->name); +#else + ZSTR_VAL(map_field_type->name)); +#endif return; } Map* intern = UNBOX(Map, val); @@ -636,7 +651,12 @@ void check_map_field(const zend_class_entry* klass, PHP_PROTO_LONG key_type, if (klass != NULL && intern->msg_ce != klass) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Expect a map field of %s, but %s is given.", +#if PHP_MAJOR_VERSION < 7 klass->name, intern->msg_ce->name); +#else + ZSTR_VAL(klass->name), + ZSTR_VAL(intern->msg_ce->name)); +#endif return; } RETURN_ZVAL(val, 1, 0); diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php index 1ffb24501c..91313336cf 100644 --- a/php/src/Google/Protobuf/Internal/Message.php +++ b/php/src/Google/Protobuf/Internal/Message.php @@ -933,6 +933,10 @@ class Message throw new GPBDecodeException( "Invalid data type for int32 field"); } + if (is_string($value) && trim($value) !== $value) { + throw new GPBDecodeException( + "Invalid data type for int32 field"); + } if (bccomp($value, "2147483647") > 0) { throw new GPBDecodeException( "Int32 too large"); @@ -951,6 +955,10 @@ class Message throw new GPBDecodeException( "Invalid data type for uint32 field"); } + if (is_string($value) && trim($value) !== $value) { + throw new GPBDecodeException( + "Invalid data type for int32 field"); + } if (bccomp($value, 4294967295) > 0) { throw new GPBDecodeException( "Uint32 too large"); @@ -966,6 +974,10 @@ class Message throw new GPBDecodeException( "Invalid data type for int64 field"); } + if (is_string($value) && trim($value) !== $value) { + throw new GPBDecodeException( + "Invalid data type for int64 field"); + } if (bccomp($value, "9223372036854775807") > 0) { throw new GPBDecodeException( "Int64 too large"); @@ -984,6 +996,10 @@ class Message throw new GPBDecodeException( "Invalid data type for int64 field"); } + if (is_string($value) && trim($value) !== $value) { + throw new GPBDecodeException( + "Invalid data type for int64 field"); + } if (bccomp($value, "18446744073709551615") > 0) { throw new GPBDecodeException( "Uint64 too large"); diff --git a/php/tests/compile_extension.sh b/php/tests/compile_extension.sh index bbd669684c..2ffc51f14b 100755 --- a/php/tests/compile_extension.sh +++ b/php/tests/compile_extension.sh @@ -1,10 +1,14 @@ #!/bin/bash -EXTENSION_PATH=$1 +VERSION=$2 -pushd $EXTENSION_PATH +export PATH=/usr/local/php-$VERSION/bin:$PATH +export C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$C_INCLUDE_PATH +export CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH + +pushd ../ext/google/protobuf make clean || true set -e # Add following in configure for debug: --enable-debug CFLAGS='-g -O0' -phpize && ./configure CFLAGS='-g -O0' && make +phpize && ./configure CFLAGS='-g -O0 -Wall' && make popd diff --git a/php/tests/encode_decode_test.php b/php/tests/encode_decode_test.php index 53cd526e4f..319e3321d2 100644 --- a/php/tests/encode_decode_test.php +++ b/php/tests/encode_decode_test.php @@ -1164,6 +1164,18 @@ class EncodeDecodeTest extends TestBase $m->serializeToJsonString()); } + public function testEncodeAnyWithDefaultWrapperMessagePacked() + { + $any = new Any(); + $any->pack(new TestInt32Value([ + 'field' => new Int32Value(['value' => 0]), + ])); + $this->assertSame( + "{\"@type\":\"type.googleapis.com/foo.TestInt32Value\"," . + "\"field\":0}", + $any->serializeToJsonString()); + } + public function testDecodeTopLevelFieldMask() { $m = new TestMessage(); diff --git a/php/tests/multirequest.php b/php/tests/multirequest.php new file mode 100644 index 0000000000..bbe8d7703d --- /dev/null +++ b/php/tests/multirequest.php @@ -0,0 +1,8 @@ +protobuf loaded

"; +} else { + echo "

protobuf not loaded

"; +} diff --git a/php/tests/multirequest.sh b/php/tests/multirequest.sh new file mode 100755 index 0000000000..97535ea0ed --- /dev/null +++ b/php/tests/multirequest.sh @@ -0,0 +1,34 @@ +#!/bin/bash +set -e + +# Compile c extension +VERSION=7.4 +PORT=12345 + +export PATH=/usr/local/php-$VERSION/bin:$PATH +export C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$C_INCLUDE_PATH +export CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH +/bin/bash ./compile_extension.sh $VERSION + +nohup php -d protobuf.keep_descriptor_pool_after_request=1 -dextension=../ext/google/protobuf/modules/protobuf.so -S localhost:$PORT multirequest.php 2>&1 & + +sleep 1 + +wget http://localhost:$PORT/multirequest.result -O multirequest.result +wget http://localhost:$PORT/multirequest.result -O multirequest.result + +pushd ../ext/google/protobuf +phpize --clean +popd + +PID=`ps | grep "php" | awk '{print $1}'` +echo $PID + +if [[ -z "$PID" ]] +then + echo "Failed" + exit 1 +else + kill $PID + echo "Succeeded" +fi diff --git a/php/tests/test.sh b/php/tests/test.sh index 9ef565c713..3c5e30d738 100755 --- a/php/tests/test.sh +++ b/php/tests/test.sh @@ -7,7 +7,7 @@ export C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$V export CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH # Compile c extension -/bin/bash ./compile_extension.sh ../ext/google/protobuf +/bin/bash ./compile_extension.sh $VERSION tests=( array_test.php encode_decode_test.php generated_class_test.php map_field_test.php well_known_test.php descriptors_test.php wrapper_type_setters_test.php) diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index ab5209708f..924fb5d42b 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -8,7 +8,7 @@ com.google.protobuf protoc - 3.11.0-rc-1 + 3.11.2 pom Protobuf Compiler diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py index f3e0a7152e..25d2445ff9 100755 --- a/python/google/protobuf/__init__.py +++ b/python/google/protobuf/__init__.py @@ -30,7 +30,7 @@ # Copyright 2007 Google Inc. All Rights Reserved. -__version__ = '3.11.0rc1' +__version__ = '3.11.2' if __name__ != '__main__': try: diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec index 1ba594d708..ba7acbc2ac 100644 --- a/ruby/google-protobuf.gemspec +++ b/ruby/google-protobuf.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "google-protobuf" - s.version = "3.11.0.rc.1" + s.version = "3.11.2" git_tag = "v#{s.version.to_s.sub('.rc.', '-rc')}" # Converts X.Y.Z.rc.N to vX.Y.Z-rcN, used for the git tag s.licenses = ["BSD-3-Clause"] s.summary = "Protocol Buffers" diff --git a/src/Makefile.am b/src/Makefile.am index 60bb445d9b..5ac489b6bc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,7 +18,7 @@ else PTHREAD_DEF = endif -PROTOBUF_VERSION = 22:0:0 +PROTOBUF_VERSION = 22:2:0 if GCC # Turn on all warnings except for sign comparison (we ignore sign comparison diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h index 7ea175d4df..f551818e61 100644 --- a/src/google/protobuf/any.pb.h +++ b/src/google/protobuf/any.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3011000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3011002 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h index 91bc34e2b4..b00b88dc24 100644 --- a/src/google/protobuf/api.pb.h +++ b/src/google/protobuf/api.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3011000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3011002 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index 2dee810eca..0fdf8c6ec9 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3011000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3011002 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index 20912ff70d..30e85cca72 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3011000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3011002 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h index 804361d37d..7b34a4bf02 100644 --- a/src/google/protobuf/duration.pb.h +++ b/src/google/protobuf/duration.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3011000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3011002 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h index 71d3d2029f..66312bc1cc 100644 --- a/src/google/protobuf/empty.pb.h +++ b/src/google/protobuf/empty.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3011000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3011002 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h index cce1e1b80c..f3f83194d8 100644 --- a/src/google/protobuf/field_mask.pb.h +++ b/src/google/protobuf/field_mask.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3011000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3011002 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc index a497f77ecd..887a372696 100644 --- a/src/google/protobuf/port_def.inc +++ b/src/google/protobuf/port_def.inc @@ -297,7 +297,7 @@ // Shared google3/opensource definitions. ////////////////////////////////////// -#define PROTOBUF_VERSION 3011000 +#define PROTOBUF_VERSION 3011002 #define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3011000 #define PROTOBUF_MIN_PROTOC_VERSION 3011000 #define PROTOBUF_VERSION_SUFFIX "" diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h index 8a49008c93..c9c70c8052 100644 --- a/src/google/protobuf/source_context.pb.h +++ b/src/google/protobuf/source_context.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3011000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3011002 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h index 05a5f74453..9d2ccb2016 100644 --- a/src/google/protobuf/struct.pb.h +++ b/src/google/protobuf/struct.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3011000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3011002 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index 2ee72f5ea8..3301a4f1b8 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -81,7 +81,7 @@ namespace internal { // The current version, represented as a single integer to make comparison // easier: major * 10^6 + minor * 10^3 + micro -#define GOOGLE_PROTOBUF_VERSION 3011000 +#define GOOGLE_PROTOBUF_VERSION 3011002 // A suffix string for alpha, beta or rc releases. Empty for stable releases. #define GOOGLE_PROTOBUF_VERSION_SUFFIX "" diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h index 497db63c7b..338a1e707b 100644 --- a/src/google/protobuf/timestamp.pb.h +++ b/src/google/protobuf/timestamp.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3011000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3011002 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/type.pb.h b/src/google/protobuf/type.pb.h index 679e132502..40d2cd4f0f 100644 --- a/src/google/protobuf/type.pb.h +++ b/src/google/protobuf/type.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3011000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3011002 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/wrappers.pb.h b/src/google/protobuf/wrappers.pb.h index 4ee66db9ae..ebde03a63f 100644 --- a/src/google/protobuf/wrappers.pb.h +++ b/src/google/protobuf/wrappers.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3011000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3011002 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/tests.sh b/tests.sh index f1e24891dd..a4fef8461a 100755 --- a/tests.sh +++ b/tests.sh @@ -350,6 +350,10 @@ build_python37() { build_python_version py37-python } +build_python38() { + build_python_version py38-python +} + build_python_cpp() { internal_build_cpp export LD_LIBRARY_PATH=../src/.libs # for Linux @@ -398,6 +402,10 @@ build_python37_cpp() { build_python_cpp_version py37-cpp } +build_python38_cpp() { + build_python_cpp_version py38-cpp +} + build_python_compatibility() { internal_build_cpp # Use the unit-tests extraced from 2.5.0 to test the compatibilty. @@ -504,14 +512,19 @@ build_php5.5() { } build_php5.5_c() { + IS_64BIT=$1 use_php 5.5 pushd php/tests /bin/bash ./test.sh 5.5 popd - # TODO(teboring): Add it back - # pushd conformance - # make test_php_c - # popd + pushd conformance + if [ "$IS_64BIT" = "true" ] + then + make test_php_c + else + make test_php_c_32 + fi + popd } build_php5.5_mixed() { @@ -519,18 +532,25 @@ build_php5.5_mixed() { pushd php rm -rf vendor composer update - /bin/bash ./tests/compile_extension.sh ./ext/google/protobuf + pushd tests + /bin/bash ./compile_extension.sh 5.5 + popd php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit popd } build_php5.5_zts_c() { + IS_64BIT=$1 use_php_zts 5.5 cd php/tests && /bin/bash ./test.sh 5.5-zts && cd ../.. - # TODO(teboring): Add it back - # pushd conformance - # make test_php_zts_c - # popd + pushd conformance + if [ "$IS_64BIT" = "true" ] + then + make test_php_c + else + make test_php_c_32 + fi + popd } build_php5.6() { @@ -546,12 +566,17 @@ build_php5.6() { } build_php5.6_c() { + IS_64BIT=$1 use_php 5.6 cd php/tests && /bin/bash ./test.sh 5.6 && cd ../.. - # TODO(teboring): Add it back - # pushd conformance - # make test_php_c - # popd + pushd conformance + if [ "$IS_64BIT" = "true" ] + then + make test_php_c + else + make test_php_c_32 + fi + popd } build_php5.6_mixed() { @@ -559,18 +584,25 @@ build_php5.6_mixed() { pushd php rm -rf vendor composer update - /bin/bash ./tests/compile_extension.sh ./ext/google/protobuf + pushd tests + /bin/bash ./compile_extension.sh 5.6 + popd php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit popd } build_php5.6_zts_c() { + IS_64BIT=$1 use_php_zts 5.6 cd php/tests && /bin/bash ./test.sh 5.6-zts && cd ../.. - # TODO(teboring): Add it back - # pushd conformance - # make test_php_zts_c - # popd + pushd conformance + if [ "$IS_64BIT" = "true" ] + then + make test_php_c + else + make test_php_c_32 + fi + popd } build_php5.6_mac() { @@ -592,10 +624,9 @@ build_php5.6_mac() { # Test cd php/tests && /bin/bash ./test.sh && cd ../.. - # TODO(teboring): Add it back - # pushd conformance - # make test_php_c - # popd + pushd conformance + make test_php_c + popd } build_php7.0() { @@ -611,12 +642,17 @@ build_php7.0() { } build_php7.0_c() { + IS_64BIT=$1 use_php 7.0 cd php/tests && /bin/bash ./test.sh 7.0 && cd ../.. - # TODO(teboring): Add it back - # pushd conformance - # make test_php_c - # popd + pushd conformance + if [ "$IS_64BIT" = "true" ] + then + make test_php_c + else + make test_php_c_32 + fi + popd } build_php7.0_mixed() { @@ -624,18 +660,25 @@ build_php7.0_mixed() { pushd php rm -rf vendor composer update - /bin/bash ./tests/compile_extension.sh ./ext/google/protobuf + pushd tests + /bin/bash ./compile_extension.sh 7.0 + popd php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit popd } build_php7.0_zts_c() { + IS_64BIT=$1 use_php_zts 7.0 cd php/tests && /bin/bash ./test.sh 7.0-zts && cd ../.. - # TODO(teboring): Add it back. - # pushd conformance - # make test_php_zts_c - # popd + pushd conformance + if [ "$IS_64BIT" = "true" ] + then + make test_php_c + else + make test_php_c_32 + fi + popd } build_php7.0_mac() { @@ -657,10 +700,9 @@ build_php7.0_mac() { # Test cd php/tests && /bin/bash ./test.sh && cd ../.. - # TODO(teboring): Add it back - # pushd conformance - # make test_php_c - # popd + pushd conformance + make test_php_c + popd } build_php_compatibility() { @@ -668,6 +710,13 @@ build_php_compatibility() { php/tests/compatibility_test.sh $LAST_RELEASED } +build_php_multirequest() { + use_php 7.4 + pushd php/tests + ./multirequest.sh + popd +} + build_php7.1() { use_php 7.1 pushd php @@ -681,15 +730,17 @@ build_php7.1() { } build_php7.1_c() { - ENABLE_CONFORMANCE_TEST=$1 + IS_64BIT=$1 use_php 7.1 cd php/tests && /bin/bash ./test.sh 7.1 && cd ../.. - if [ "$ENABLE_CONFORMANCE_TEST" = "true" ] + pushd conformance + if [ "$IS_64BIT" = "true" ] then - pushd conformance make test_php_c - popd + else + make test_php_c_32 fi + popd } build_php7.1_mixed() { @@ -697,16 +748,85 @@ build_php7.1_mixed() { pushd php rm -rf vendor composer update - /bin/bash ./tests/compile_extension.sh ./ext/google/protobuf + pushd tests + /bin/bash ./compile_extension.sh 7.1 + popd php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit popd } build_php7.1_zts_c() { + IS_64BIT=$1 use_php_zts 7.1 cd php/tests && /bin/bash ./test.sh 7.1-zts && cd ../.. pushd conformance - # make test_php_c + if [ "$IS_64BIT" = "true" ] + then + make test_php_c + else + make test_php_c_32 + fi + popd +} + +build_php7.4() { + use_php 7.4 + pushd php + rm -rf vendor + composer update + ./vendor/bin/phpunit + popd + pushd conformance + make test_php + popd +} + +build_php7.4_c() { + IS_64BIT=$1 + use_php 7.4 + cd php/tests && /bin/bash ./test.sh 7.4 && cd ../.. + pushd conformance + if [ "$IS_64BIT" = "true" ] + then + make test_php_c + else + make test_php_c_32 + fi + popd + pushd php/ext/google/protobuf + phpize --clean + popd +} + +build_php7.4_mixed() { + use_php 7.4 + pushd php + rm -rf vendor + composer update + pushd tests + /bin/bash ./compile_extension.sh 7.4 + popd + php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit + popd + pushd php/ext/google/protobuf + phpize --clean + popd +} + +build_php7.4_zts_c() { + IS_64BIT=$1 + use_php_zts 7.4 + cd php/tests && /bin/bash ./test.sh 7.4-zts && cd ../.. + pushd conformance + if [ "$IS_64BIT" = "true" ] + then + make test_php_c + else + make test_php_c_32 + fi + popd + pushd php/ext/google/protobuf + phpize --clean popd } @@ -715,22 +835,27 @@ build_php_all_32() { build_php5.6 build_php7.0 build_php7.1 - build_php5.5_c - build_php5.6_c - build_php7.0_c + build_php7.4 + build_php5.5_c $1 + build_php5.6_c $1 + build_php7.0_c $1 build_php7.1_c $1 + build_php7.4_c $1 build_php5.5_mixed build_php5.6_mixed build_php7.0_mixed build_php7.1_mixed - build_php5.5_zts_c - build_php5.6_zts_c - build_php7.0_zts_c - build_php7.1_zts_c + build_php7.4_mixed + build_php5.5_zts_c $1 + build_php5.6_zts_c $1 + build_php7.0_zts_c $1 + build_php7.1_zts_c $1 + build_php7.4_zts_c $1 } build_php_all() { build_php_all_32 true + build_php_multirequest build_php_compatibility }