Skip to content

Commit

Permalink
Merge branch '21.x' into merge-21-x
Browse files Browse the repository at this point in the history
  • Loading branch information
acozzette committed Jul 21, 2022
2 parents 316a97b + ddb21b2 commit 4176256
Show file tree
Hide file tree
Showing 62 changed files with 508 additions and 125 deletions.
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ alias(
alias(
name = "well_known_types_py_pb2",
actual = "//python:well_known_types_py_pb2",
visibility = ["@upb//:__subpackages__"],
visibility = ["//visibility:public"],
)

alias(
Expand Down
25 changes: 25 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,31 @@
* Performance improvement for repeated use of FieldMaskUtil#merge by caching
constructed FieldMaskTrees.

2022-07-19 version 21.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby)
C++
* Add header search paths to Protobuf-C++.podspec (#10024)
* Fixed Visual Studio constinit errors (#10232)
* Fix #9947: make the ABI compatible between debug and non-debug builds (#10271)

UPB
* Allow empty package names (fixes behavior regression in 4.21.0)
* Fix a SEGV bug when comparing a non-materialized sub-message (#10208)
* Fix several bugs in descriptor mapping containers (eg. descriptor.services_by_name)
* for x in mapping now yields keys rather than values, to match Python conventions and the behavior of the old library.
* Lookup operations now correctly reject unhashable types as map keys.
* We implement repr() to use the same format as dict.
* Fix maps to use the ScalarMapContainer class when appropriate
* Fix bug when parsing an unknown value in a proto2 enum extension (protocolbuffers/upb#717)

PHP
* Add "readonly" as a keyword for PHP and add previous classnames to descriptor pool (#10041)

Python
* Make //:protobuf_python and //:well_known_types_py_pb2 public (#10118)

Bazel
* Add back a filegroup for :well_known_protos (#10061)

2022-06-27 version 21.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby)
C++
* ArenaString improvements (fix alignment issue)
Expand Down
4 changes: 4 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,8 @@ php_EXTRA_DIST= \
php/tests/EncodeDecodeTest.php \
php/tests/force_c_ext.php \
php/tests/gdb_test.sh \
php/tests/generated_previous/GPBMetadata/ProtoPrevious/TestPreviouslyUnreservedMessage.php \
php/tests/generated_previous/Previous/readonly.php \
php/tests/GeneratedClassTest.php \
php/tests/GeneratedPhpdocTest.php \
php/tests/GeneratedServiceTest.php \
Expand All @@ -969,6 +971,7 @@ php_EXTRA_DIST= \
php/tests/multirequest.php \
php/tests/multirequest.sh \
php/tests/PhpImplementationTest.php \
php/tests/PreviouslyGeneratedClassTest.php \
php/tests/proto/empty/echo.proto \
php/tests/proto/test.proto \
php/tests/proto/test_descriptors.proto \
Expand All @@ -987,6 +990,7 @@ php_EXTRA_DIST= \
php/tests/proto/test_service.proto \
php/tests/proto/test_service_namespace.proto \
php/tests/proto/test_wrapper_type_setters.proto \
php/tests/proto_previous/test_previously_unreserved_message.proto \
php/tests/test_base.php \
php/tests/test_util.php \
php/tests/valgrind.supp \
Expand Down
2 changes: 1 addition & 1 deletion Protobuf-C++.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Protobuf-C++'
s.version = '3.21.2'
s.version = '3.21.3'
s.summary = 'Protocol Buffers v3 runtime library for C++.'
s.homepage = 'https://github.com/google/protobuf'
s.license = 'BSD-3-Clause'
Expand Down
2 changes: 1 addition & 1 deletion Protobuf.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.21.2'
s.version = '3.21.3'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/protocolbuffers/protobuf'
s.license = 'BSD-3-Clause'
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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.21.2],[[email protected]],[protobuf])
AC_INIT([Protocol Buffers],[3.21.3],[[email protected]],[protobuf])

AM_MAINTAINER_MODE([enable])

Expand Down
2 changes: 1 addition & 1 deletion csharp/Google.Protobuf.Tools.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Google Protocol Buffers tools</title>
<summary>Tools for Protocol Buffers - Google's data interchange format.</summary>
<description>See project site for more info.</description>
<version>3.21.2</version>
<version>3.21.3</version>
<authors>Google Inc.</authors>
<owners>protobuf-packages</owners>
<licenseUrl>https://github.com/protocolbuffers/protobuf/blob/main/LICENSE</licenseUrl>
Expand Down
2 changes: 1 addition & 1 deletion csharp/src/Google.Protobuf/Google.Protobuf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>C# runtime library for Protocol Buffers - Google's data interchange format.</Description>
<Copyright>Copyright 2015, Google Inc.</Copyright>
<AssemblyTitle>Google Protocol Buffers</AssemblyTitle>
<VersionPrefix>3.21.2</VersionPrefix>
<VersionPrefix>3.21.3</VersionPrefix>
<LangVersion>10.0</LangVersion>
<Authors>Google Inc.</Authors>
<TargetFrameworks>netstandard1.1;netstandard2.0;net45;net50</TargetFrameworks>
Expand Down
6 changes: 3 additions & 3 deletions java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If you are using Maven, use the following:
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.21.2</version>
<version>3.21.3</version>
</dependency>
```

Expand All @@ -37,15 +37,15 @@ protobuf-java-util package:
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
<version>3.21.2</version>
<version>3.21.3</version>
</dependency>
```

### Gradle

If you are using Gradle, add the following to your `build.gradle` file's dependencies:
```
implementation 'com.google.protobuf:protobuf-java:3.21.2'
implementation 'com.google.protobuf:protobuf-java:3.21.3'
```
Again, be sure to check that the version number matches (or is newer than) the version number of protoc that you are using.

Expand Down
2 changes: 1 addition & 1 deletion java/bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-bom</artifactId>
<version>3.21.2</version>
<version>3.21.3</version>
<packaging>pom</packaging>

<name>Protocol Buffers [BOM]</name>
Expand Down
2 changes: 1 addition & 1 deletion java/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.21.2</version>
<version>3.21.3</version>
</parent>

<artifactId>protobuf-java</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion java/kotlin-lite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.21.2</version>
<version>3.21.3</version>
</parent>

<artifactId>protobuf-kotlin-lite</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion java/kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.21.2</version>
<version>3.21.3</version>
</parent>

<artifactId>protobuf-kotlin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion java/lite.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protobuf Java Lite runtime. If you are using Maven, include the following:
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-javalite</artifactId>
<version>3.21.2</version>
<version>3.21.3</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion java/lite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.21.2</version>
<version>3.21.3</version>
</parent>

<artifactId>protobuf-javalite</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.21.2</version>
<version>3.21.3</version>
<packaging>pom</packaging>

<name>Protocol Buffers [Parent]</name>
Expand Down
2 changes: 1 addition & 1 deletion java/util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.21.2</version>
<version>3.21.3</version>
</parent>

<artifactId>protobuf-java-util</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions php/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ pkg_files(
"src/Google/Protobuf/**/*.php",
"tests/*.php",
"tests/*.sh",
"tests/generated_previous/**/*.php",
"tests/proto/**/*.proto",
"tests/proto_previous/*.proto",
]) + [
"BUILD.bazel",
"README.md",
Expand Down
5 changes: 4 additions & 1 deletion php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
"autoload-dev": {
"psr-4": {
"": "tmp"
}
},
"classmap": [
"tests/generated_previous"
]
},
"scripts": {
"test_c": "./generate_test_protos.sh && ./tests/compile_extension.sh && php -dextension=ext/google/protobuf/modules/protobuf.so vendor/bin/phpunit --bootstrap tests/force_c_ext.php tests",
Expand Down
24 changes: 14 additions & 10 deletions php/ext/google/protobuf/def.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static void EnumDescriptor_FromEnumDef(zval *val, const upb_EnumDef *m) {
ZVAL_NULL(val);
} else {
char *classname =
GetPhpClassname(upb_EnumDef_File(m), upb_EnumDef_FullName(m));
GetPhpClassname(upb_EnumDef_File(m), upb_EnumDef_FullName(m), false);
zend_string *str = zend_string_init(classname, strlen(classname), 0);
zend_class_entry *ce = zend_lookup_class(str); // May autoload the class.

Expand Down Expand Up @@ -499,19 +499,23 @@ static void Descriptor_destructor(zend_object* obj) {
}

static zend_class_entry *Descriptor_GetGeneratedClass(const upb_MessageDef *m) {
char *classname =
GetPhpClassname(upb_MessageDef_File(m), upb_MessageDef_FullName(m));
zend_string *str = zend_string_init(classname, strlen(classname), 0);
zend_class_entry *ce = zend_lookup_class(str); // May autoload the class.
for (int i = 0; i < 2; ++i) {
char *classname =
GetPhpClassname(upb_MessageDef_File(m), upb_MessageDef_FullName(m), (bool)i);
zend_string *str = zend_string_init(classname, strlen(classname), 0);
zend_class_entry *ce = zend_lookup_class(str); // May autoload the class.

zend_string_release (str);
zend_string_release (str);
free(classname);

if (!ce) {
zend_error(E_ERROR, "Couldn't load generated class %s", classname);
if (ce) {
return ce;
}
}

free(classname);
return ce;
char *classname =
GetPhpClassname(upb_MessageDef_File(m), upb_MessageDef_FullName(m), false);
zend_error(E_ERROR, "Couldn't load generated class %s", classname);
}

void Descriptor_FromMessageDef(zval *val, const upb_MessageDef *m) {
Expand Down
Loading

0 comments on commit 4176256

Please sign in to comment.