Protocol Buffers v22.0-rc1 (Incomplete)
Pre-release
Pre-release
Announcements
- This RC was only published for Java, Protoc, and Cocoapods.
- This version includes breaking changes to: Cpp, Ruby.
- [Cpp] Migrate to Abseil's logging library. (a9f1ea6)
- [Cpp]
proto2::Map::value_type
changes tostd::pair<const K, V>
. (46656ed) - [Cpp] Mark final ZeroCopyInputStream, ZeroCopyOutputStream, and DefaultFieldComparator classes. (bf9c22e)
- [Cpp] Add a dependency on Abseil (#10416)
- [Cpp] Remove all autotools usage (#10132)
- [Cpp] Add C++20 reserved keywords
- [Cpp] Delete Arena::Init
- [Cpp] Replace JSON parser with new implementation
- [Cpp] Make RepeatedField::GetArena non-const in order to support split RepeatedFields.
- [Ruby] Switch to releasing ruby source gems only.
- Protobuf News may include additional announcements or pre-announcements for upcoming changes.
Compiler
- Breaking change: Migrate to Abseil's logging library. (a9f1ea6)
- Add debug_redact field option to protobuf. (9238c48)
- Protoc: accept capital X to indicate hex escape in string literals (#10757)
- Gracefully handle weird placement of linebreaks around comments (#10660)
- Open up visibility for some compiler internals (#10608)
- Protoc: validate reserved names are identifiers (#10586)
- Protoc: validate custom json_name configuration (#10581)
- Protoc: fix consistency with parsing very large decimal numbers (#10555)
- Use protoc version for --version (#10386)
- Fix for grpc.tools #17995 & protobuf #7474 (handle UTF-8 paths in argumentfile) (#10200)
- Print full path name of source .proto file on error
- Include proto message type in the annotation comments.
- Maven artifact suffix format has changed to -RCN instead of -rc-N
C++
- Breaking change: Migrate to Abseil's logging library. (a9f1ea6)
- No longer define no_threadlocal on OpenBSD (#10610)
- CMake: Enable projects to set the C++ version (#10464)
- Breaking Change: Add a dependency on Abseil (#10416)
- Upgrade third_party/googletest submodule to current main branch (#10393)
- Breaking Change: Remove all autotools usage (#10132)
- CMake: use add_compile_options instead of add_definitions for compile options (#10293)
- Fix #9947: make the ABI identical between debug and non-debug builds (#10271)
- Allow for CMAKE_INSTALL_LIBDIR to be absolute (#10090)
- Add header search paths to protobuf-c++ spec (#10024)
- Cpp_generated_lib_linked support is removed in protoc
- Reduced .pb.o object file size slightly by explicitly instantiating
- Breaking Change: Add C++20 reserved keywords.
- Fixed crash in ThreadLocalStorage for pre-C++17 compilers on 32-bit ARM.
- Clarified that JSON API non-OK statuses are not a stable API.
- Added a default implementation of MessageDifferencer::Reporter methods.
- Proto2::MapPair is now an alias to std::pair.
- Hide C++ RepeatedField::UnsafeArenaSwap
- Use table-driven parser for reflection based objects.
- Add ARM-optimized Varint decoding functions.
- Minor optimization for parsing groups
- Declare ReflectiveProtoHook class
- Reduce size of VarintParse code in protocol buffers, by calling the shared
- Avoid inlining some large heavily duplicated routines in repeated_ptr_field.h
- Add ReflectiveProtoHook to Reflection.
- Turns on table-driven parser for reflection based objects.
- Save code space by avoiding inlining of large-in-aggregate code-space MessageLite::~MessageLite destructor.
- Undefine the macro
linux
when compiling protobuf - Reduce memory consumption of MessageSet parsing.
- Save code space by avoiding inlining of large-in-aggregate code-space MessageLite::~MessageLite destructor.
- Breaking Change: Delete Arena::Init
- Make a PROTOBUF_POISON/UNPOISON to reduce noise in the source
- Put alignment functions in "arena_align.h"
- Split off
cleanup
arena functions into "arena_cleanup.h" - Fix signed / unsigned match in CHECK_EQ
- Kill Atomic<>. it's not pulling it's weight
- Move AllocationPolicy out of arena_impl, and unify arena_config for bazel
- Fix failure case in table-driven parser.
- Breaking Change: Replace JSON parser with new implementation
- Introduce the Printer::{SetRedactDebugString,SetRandomizeDebugString} private flags.
- Introduce global flags to control Printer::{SetRedactDebugString, SetRandomizeDebugString}.
- Proto3 string fields no longer trigger clang-tidy warning bugprone-branch-clone.
- Fix the API of DescriptorUpgrader::set_allow_unknown_dependencies to set to True always, and to populate into the DescriptorPool as well.
- Report line numbers consistently in text-format deprecated-field warnings.
- Fixed C++ code generation for protos that use int32_t, uint32_t, int64_t, uint64_t, size_t as field names.
- Annotate generated C++ public aliases for enum types.
- Change default arena max block size from 8K to 32K.
- Begin emitting semantic metadata for some C++ proto features. (2880fef)
Java
- Expect fail when serialize inf and nan for Value.number_value in json format. fixes #11259 (ca1cb1b)
- Create a helper function that can make a mutable copy of any ProtobufList (5669606)
- Add debug_redact field option to protobuf. (9238c48)
- Remove unused package private class ProtobufLists. (b51c551)
- Mark UnmodifiableLazyStringList deprecated. UnmodifiableLazyStringList is unnecessary and will be removed in a future release. (9595cbb)
- Make emptyList public and mark the public EMPTY field as deprecated. (c658e27)
- Enable Text format parser to skip unknown short-formed repeated fields. (6dbd413)
- Expose internal setExtension method for Kotlin (33d1070)
- Mark default instance as immutable first to avoid race during static initialization of default instances. (#10770)
- Add serialVersionUID to ByteString and subclasses (#10718)
- Fix serialization warnings in generated code when compiling with Java 18 and above (#10561)
- Fix Timestamps fromDate for negative 'exact second' java.sql.Timestamps (#10321)
- Fix Timestamps.fromDate to correctly handle java.sql.Timestamps before unix epoch (#10126)
- Performance improvement for repeated use of FieldMaskUtil#merge by caching
- Optimized Java proto serialization gencode for protos having many extension ranges with few fields in between.
- More thoroughly annotate public generated code in Java lite protocol buffers.
- Fixed Bug in proto3 java lite repeated enum fields. Failed to call copyOnWrite before modifying previously built message. Causes modification to already "built" messages that should be immutable.
- Fix Java reflection serialization of empty packed fields.
- Refactoring java full runtime to reuse sub-message builders and prepare to migrate parsing logic from parse constructor to builder.
- Move proto wireformat parsing functionality from the private "parsing constructor" to the Builder class.
- Change the Lite runtime to prefer merging from the wireformat into mutable messages rather than building up a new immutable object before merging. This way results in fewer allocations and copy operations.
- Make message-type extensions merge from wire-format instead of building up instances and merging afterwards. This has much better performance.
- Fix TextFormat parser to build up recurring (but supposedly not repeated) sub-messages directly from text rather than building a new sub-message and merging the fully formed message into the existing field.
- Fix bug in nested builder caching logic where cleared sub-field builders would remain dirty after a clear and build in a parent layer. #10624
- Add exemplar variants of the Java Any.is() and Any.unpack() methods. (60b7149)
- Use bit-field int values in buildPartial to skip work on unset groups of fields. (2326aef)
- Maven artifact suffix format has changed to -RCN instead of -rc-N
Kotlin
- Add debug_redact field option to protobuf. (9238c48)
- Expose internal setExtension method for Kotlin (33d1070)
- Add missing
public
modifier to Kotlin generated code (#10616) - Add "public" modifier to Kotlin generated code (#10599)
- Update rules_kotlin version (#10212)
- Suppress deprecation warnings in Kotlin generated code.
- Kotlin generated code comments now use kdoc format instead of javadoc.
- Escape keywords in package names in proto generated code
- Add Kotlin enum int value getters and setters
Csharp
- Make the MergeFrom method of type ReadOnlySequence public (#11124) (c4bac67)
- Fix a bug in which a possibly invalidated swisstable reference is used. (5c5dcdd)
- Fix .NET Native AOT warnings in Protobuf reflection (#11128) (c019a79)
- Use forward slash instead of backslash in nuspec file (#11449) (724250d)
- Add debug_redact field option to protobuf. (9238c48)
- Expose internal setExtension method for Kotlin (33d1070)
- Apply Obsolete attribute to deprecated enums and enum values in C# generated code (#10520)
- Fix 32-bit floating point JSON parsing of maximal values for C# (#10514)
- Retain existing array in RepeatedField.Clear (#10508)
- Implement IComparable for the Duration type (C#) (#10441)
- Implement correct map merging behavior for C# (#10339)
- Support indented JSON formatting in C# (#9391)
- Disambiguate generated properties in C# (#10269)
- Bugfix/issue 8101 (#10268)
- Expose plugin protos for C# (#10244)
- Update to C# 10 and upgrade code style (#10105)
- Fix failing FieldMask.Merge for well-known wrapper field types (#9602)
- Helper method on Any to allow an any to be unpacked more easily (#9695)
Objective-C
- [ObjC] Boolean generation options support no value as "true". (7935932)
- [ObjC] Put out of range closed enum extension values in unknown fields. (903639c)
- [ObjC] Raise the min OS versions (and required Xcode) (#10652)
- [ObjC] Provide a protocol for GPBExtensionRegistry's lookup support. (#10597)
- Mark the
syntax
onGPBFileDescriptor
as deprecated. (c79832b) - Add the concept of a "closed enum" and expose it from the
GPBEnumDescriptor
. (7bb699b)
Python
- Soft deprecate python MessageFactory (c80e7ef)
- Add debug_redact field option to protobuf. (9238c48)
- Raise errors when serialize inf and nan for Value.number_value in json format. fixes #11259 (883ec1c)
- Resolve #10949: use raise from in json_format.py (#10966) (1e6f876)
- Allow reserved enums to be negative (1f58f1d)
- Make generated python files compatible with Cython (#11011) (9aa5272)
- Raise KeyError in Python ServiceDescriptor.FindMethodByName (#9592) (#9998)
- Changes ordering of printed fields in .pyi files from lexicographic to the same ordering found in the proto descriptor.
- Adds GeneratedCodeInfo annotations to python proto .pyi outputs as a base64 encoded docstring in the last line of the .pyi file for code analysis tools.
- Fix message factory's behavior in python cpp extension to return same message classes for same descriptor, even if the factories are different.
- Add type annotation for enum value fields in enum classes.
- Update sphinx 2.3.1 to 3.0.4 (c1a42b3)
- Added is_closed to EnumDescriptor in protobuf python (da9de8d)
Python C-Extension (Default)
- Add license file to pypi wheels. (protocolbuffers/upb@92dbe4b)
- Append "ByDef" to names of message accessors that use reflection (protocolbuffers/upb@b747edb)
- Implement upb_Map_Next() as the new upb_Map iterator (protocolbuffers/upb@03b1dee)
- Move the wire type definitions into upb/wire/ where they belong (protocolbuffers/upb@ff6439f)
- Replace and repair the integer hash table iterator: (protocolbuffers/upb@7056646)
- Add Parse/Serialize templates to support shared_ptr/unique_ptr. (protocolbuffers/upb@d3ec4b6)
- Fixes https://github.com/protocolbuffers/upb/issues/869 (protocolbuffers/upb@41017ef)
- Silently succeed when adding the same serialized file in Python (protocolbuffers/upb@e779b9d)
- Different message factories will return same message class for same descriptor in python. (protocolbuffers/upb@470f06c)
- Make upb numpy type checks consistent with pure python and cpp. (protocolbuffers/upb@79b735a)
- Upb: fix NULL pointer bug in Python FFI (protocolbuffers/upb@c2c6427)
- See also UPB changes below, which may affect Python C-Extension (Default).
PHP
- Fix: php 8.2 dynamic property warning in MapFieldIter (#11485) (8e636d5)
- Chore: fix php lint (#11417) (ade256e)
- Add debug_redact field option to protobuf. (9238c48)
- [PHP]Added missing files and fix phpext_protobuf_ptr export in pecl version (#10689)
- [PHP] Fix empty message serialization for Any (#10595)
- [PHP] allow dynamic properties in Message (#10594)
- [PHP] Added getContainingOneof and getRealContainingOneof to descriptor. (#10356)
- Fix: PHP readonly legacy files for nested messages (#10320)
- Migrating macos php builds from 7.0/7.3 to 7.4/8.0 (#10274)
- Exposed more functions in FieldDescriptor and OneofDescriptor. (#10102)
- Fixed PHP SEGV by not writing to shared memory for zend_class_entry. (#9995)
- Feat: [PHP] remove legacy generate class file (#9621)
PHP C-Extension
- Add debug_redact field option to protobuf. (9238c48)
- Update PHP and Ruby to use the new accessors, delete the old ones (3f36a91)
- Update Ruby to use the newer upb_Map_Next() iterator (8809a11)
- Fix the ruby and php builds which were broken by a recent upb change (9cdf347)
- See also UPB changes below, which may affect PHP C-Extension.
Ruby
- Breaking Change: Switch to releasing ruby source gems only. (0daf8b8)
- Migrate ruby release targets to genrule to work around Bazel 5 bug (#11619) (e207bcd)
- Add ruby release targets (#11468) (5b27b4f)
- Remove support for ruby 2.5. (4958971)
- Add debug_redact field option to protobuf. (9238c48)
- Update PHP and Ruby to use the new accessors, delete the old ones (3f36a91)
- Replace libc strdup usage with internal impl to restore musl compat. (#10811)
- Auto capitalize enums name in Ruby (#10454)
- Ruby: Use class inheritance to save memory (#10281)
- Ruby: use a valid instance variable name for
descriptor
(#10282)
Ruby C-Extension
- Add retention and target field options in descriptor.proto (5a56837)
- Add ruby release targets (#11468) (5b27b4f)
- Add debug_redact field option to protobuf. (9238c48)
- Update PHP and Ruby to use the new accessors, delete the old ones (3f36a91)
- Hide ruby native extension symbols on FreeBSD (#10832) (2a73e3b)
- Update Ruby to use the newer upb_Map_Next() iterator (8809a11)
- See also UPB changes below, which may affect Ruby C-Extension.
UPB (Python/PHP/Ruby C-Extension)
- Expect fail when serialize inf and nan for Value.number_value in json format. fixes #11259 (protocolbuffers/upb@651550c)
- Add ::protos::Parse template for Ptr. (protocolbuffers/upb@b5384af)
- Upb_Array_Resize() now correctly clears new values (protocolbuffers/upb@02cf7aa)
- Fix unset mini table field presence bug (protocolbuffers/upb@9ab09b4)
- Allow reserved enums to be negative (protocolbuffers/upb@1b0b06f)
- Fix UPB_LIKELY() for 32-bit Windows builds (protocolbuffers/upb@9582dc2)
- Fix C compiler failure when there are fields names prefixed with accessor prefixes such as set_ and clear_. (protocolbuffers/upb@d76e286631eb89b621be)
- Make upb backwards and forwards compatible with Bazel 4.x, 3.5.x and LTS (protocolbuffers/upb@04957b1)
Other
- Upgrade to Abseil LTS 20230117 (#11622) (7930cd1)
- Fixed Visual Studio 2022: protobuf\src\google\protobuf\arena.cc(457,51): error C2127: 'thread_cache_': illegal initialization of 'constinit' entity with a non-constant expression #11672 (#11674) (c2e99a1)
- Clean up a few issues with ARM-optimized varint decoding. (bbe2e68)
- Fix bool parser for map entries to look at the whole 64-bit varint and not just (43e5937)
- Breaking Change:
proto2::Map::value_type
changes tostd::pair<const K, V>
. (46656ed) - Breaking Change: Mark final ZeroCopyInputStream, ZeroCopyOutputStream, and DefaultFieldComparator classes. (bf9c22e)
- Deprecate repeated field cleared elements API. (84d8b00)
- Breaking change: Make RepeatedField::GetArena non-const in order to support split RepeatedFields. (514c9a8)
- Add EpsCopyInputStream::ReadCord() providing an efficient direct Cord API (bc4c156)
- Add static asserts to container classes. (5a8abe1)
- Fix proto deserialization issue when parsing a packed repeated enum field whose (afdf6da)
- Use the "shldq" decoder for the specialized 64-bit Varint parsers, rather than (0ca97a1)
- Use @utf8_range to reference //third_party/utf8_range (#11352) (2dcd7d8)
- Place alignas() before lifetime specifiers (#11248) (5712e1a)
- Add UnknownFieldSet::SerializeToCord() (8661e45)
- Add support for repeated Cord fields. (b97005b)
- Add Cord based Parse and Serialize logic to MessageLite (ddde013)
- Add 'ReadCord
and 'WriteCord
functions to CodedStream (e5e2ad8) - Add CordInputStream and CordOutputStream providing stream support directly from/to Cord data (8afd1b6)
- Add a
WriteCord()
method toZeroCopyInputStream
(192cd09) - Unify string and cord cleanup nodes in TaggedNode (0783c82)
- Open source google/protobuf/bridge/message_set.proto (c04f842)
- FileOutputStream: Properly pass block_size to CopyingOutputStreamAdaptor (1b1e399)
- Implement ZeroCopyInputStream::ReadCord() in terms of absl::CordBuffer (75d31be)
- Changing bazel skylib version from 1.2.1 to 1.3.0 (#10979) (1489e8d)
- Update zlib to 1.2.13. (#10786)
- Make jsoncpp a formal dependency (#10739)
- Upgrade to MSVC 2017, since 2015 is no longer supported (#10437)
- Update CMake configuration to add a dependency on Abseil (#10401)
- Use release version instead of libtool version in Makefile (#10355)
- Fix missing
google::protobuf::RepeatedPtrField<std::string>
issue in GCC (225b936)