github protocolbuffers/protobuf v26.0
Protocol Buffers v26.0

latest releases: v29.0-rc2, v5.29.0-rc2, v3.29.0-rc2...
8 months ago

Announcements

  • This version includes breaking changes to: Java, PHP, C++, Ruby, Python.
    • [Java] Remove the deprecated always_print_primitive_fields option from Java, Python and C++ JSON parsers. (06e7cab)
    • [Java] Remove unused helper methods for creating new mutable arraylists. (7874474)
    • [Java] Use Editions features in Java full runtimes. (65c65c2)
    • [Java] Stop generating the "newInstance" method. This is not used anymore. (c0d08bd)
    • [Java] Remove unused overload of AbstractMessageLite.addAll that worked on a Collection instead of a List. (3b9bd6d)
    • [Java] Remove obsolete runtime internalBuildGeneratedFileFrom which was for backwards compatibility with old gencode. (9310d2e)
    • [Java] Remove unnecessary overloads of methods: (94a2a44)
    • [Java] Remove unnecessary generated overrides for GeneratedMessage.Builder methods: (7bff169)
    • [Java] The base class for generated messages will be GeneratedMessage, not GeneratedMessageV3.
    • [Java] Remove deprecated runtime methods for compatibility with old v2.x.x gencode. (e555bd2)
    • [Java] Remove deprecated TextFormat print methods. These should be replaced by corresponding TextFormat.printer() methods. (dfb8a4c)
    • [Java] Lock down visibility for descriptor syntax APIs. (1aeacd4)
    • [Java] Make deprecated Java gencode PARSER variable private. (b4858b2)
    • [Java] Use Editions features in Java full runtimes. (65c65c2)
    • [Java] The base class for generated messages will be GeneratedMessage, not GeneratedMessageV3.
    • [PHP] Validate UTF-8 in string setters, as previously announced. (d14dbbc)
    • [PHP] Remove deprecated legacy class aliases. (#15709) (096e127)
    • [PHP] Validate UTF-8 in string setters, as previously announced. (d14dbbc)
    • [PHP] Remove support for PHP generic services (40ad3fa)
    • [C++] Remove the deprecated always_print_primitive_fields option from Java, Python and C++ JSON parsers. (06e7cab)
    • [C++] Remove const GetArena method on RepeatedPtrField (748ab16)
    • [C++] Disallow incorrect ctype usage (755b690)
    • [C++] Remove deprecated std::string error collector overrides (543fbcd)
    • [C++] Promote ExtensionRange to a proper class (5b12bc8)
    • [C++] Remove deprecated clear APIs on repeated fields (229906f)
    • [C++] Remove C++ legacy syntax descriptor APIs (cf2d696)
    • [C++] Remove deprecated syntax APIs (715b543)
    • [C++] Remove deprecated SupportsUnknownEnumValues method (0a6a516)
    • [Ruby] Removed syntax and added has_presence?/is_packed?. (dbd4dce)
    • [Ruby] Fixed json_encode/json_decode to use the message's pool. (a8b8ea0)
    • [Ruby] Freeze is now recursive, affecting all sub-messages, maps, and repeated fields. (31313b1)
    • [Ruby] Fixed inconsistencies in Message#to_h, as previously announced. (fd69938)
    • [Ruby] Dropped support for Ruby DSL, as previously announced. (5cfc9e7)
    • [Ruby] Lock down visibility for descriptor syntax APIs. (1aeacd4)
    • [Ruby] Removed syntax and added has_presence?/is_packed?. (dbd4dce)
    • [Ruby] Fixed json_encode/json_decode to use the message's pool. (a8b8ea0)
    • [Ruby] Freeze is now recursive, affecting all sub-messages, maps, and repeated fields. (31313b1)
    • [Ruby] Fixed inconsistencies in Message#to_h, as previously announced. (fd69938)
    • [Python] Remove the deprecated always_print_primitive_fields option from Java, Python and C++ JSON parsers. (06e7cab)
    • [Python] Removed obsolete/duplicate setup.py from Python. (#15708) (5722aef)
    • [Python] Made text_format output default to UTF-8. (bf00034)
    • [Python] Remove RegisterExtension in message class (4ebba68)
    • [Python] Reject extend repeated field with none iterable (Raise TypeError) (1658213)
    • [Python] Remove Deprecated APIs that add non top descriptor. (c51f111)
    • [Python] Check if Timestamp is valid. (4f77929)
    • [Python] Remove msg.UnknownFields() support in pure python and cpp extension. (0eac77c)
    • [Python] Remove deprecated syntax accessor. (fd40c87)
  • Protobuf News may include additional announcements or pre-announcements for upcoming changes.

Compiler

C++

  • Remove rust proto libraries from the editions/BUILD file. (1f9d9fb)
  • Fix CMake regex escaping. (3ad69cf)
  • Escape _from_dir in install.cmake for regex special characters (e.g. c++) before REGEX REPLACE. (f740f52)
  • Tweak BUILD setup to make the layering check change less disruptive (#15838) (52aa150)
  • Add missing alias targets for C++ util libraries (#15783) (62e7a56)
  • Breaking change: Remove the deprecated always_print_primitive_fields option from Java, Python and C++ JSON parsers. (06e7cab)
  • Rename the 'includingDefaultValueWithoutPresenceFields' and 'always_print_without_presence_fields' to 'alwaysPrintFieldsWithNoPresence' in the Cpp, Py and Java JSON serializers for consistency. (fc41e78)
  • Add new 'always_print_without_presence_fields' option to the C++ JSON serializer. (1f3bf1d)
  • Remove use of mach_absolute_time (#15554) (#15662) (8b0f6fd)
  • Check ctype() in DescriptorBuilder for edition 2023 and beyond. (0090f19)
  • Fail building descriptors if ctype is used for fields other than string or bytes. (624d65d)
  • [CPP] Add the privacy manifest to the C++ CocoaPod. (#15664) (e7888a1)
  • Correct type_resolver_util to set syntax=proto3 instead of syntax=proto2 on proto3 files. (040dde7)
  • Remove edition getter from C++ descriptor APIs (93b219f)
  • Breaking change: Remove const GetArena method on RepeatedPtrField (748ab16)
  • Breaking change: Disallow incorrect ctype usage (755b690)
  • Breaking change: Remove deprecated std::string error collector overrides (543fbcd)
  • Breaking change: Promote ExtensionRange to a proper class (5b12bc8)
  • Breaking change: Remove deprecated clear APIs on repeated fields (229906f)
  • Breaking change: Remove C++ legacy syntax descriptor APIs (cf2d696)
  • Fixed UTF-8 TextFormat output to protect against invalid UTF-8 in string fields. (1ac8c04)
  • Breaking change: Remove deprecated syntax APIs (715b543)
  • Fix DurationToMilliseconds mult overflow (17b8dd6)
  • Breaking change: Remove deprecated SupportsUnknownEnumValues method (0a6a516)
  • Have Arena::Create support arena constructible types (578e07e)
  • Enforce stricter version checks for Protobuf C++ by removing the notion of "minimal version of protoc/headers"; exact version match is required. (6eed7a2)
  • Compare explicit zeroes from prototext in partially. (8c24163)
  • Move the declarations in SerialArena to more closely match the style guide. (349122f)

Java

  • Resolve features directly in setProto instead of temporarily setting to null. (aea0e52)
  • Breaking change: Remove the deprecated always_print_primitive_fields option from Java, Python and C++ JSON parsers. (06e7cab)
  • Rename the 'includingDefaultValueWithoutPresenceFields' and 'always_print_without_presence_fields' to 'alwaysPrintFieldsWithNoPresence' in the Cpp, Py and Java JSON serializers for consistency. (fc41e78)
  • Add a new 'includingDefaultValueWithoutPresenceFields' option to the Java parser which is intended to replace the current 'includingDefaultValueFields'. (043191b)
  • Force descriptor initialization of dependencies before internalUpdateFileDescriptor(). (#15718) (4dec1a7)
  • Correctly set maven-compiler-plugin to >= Java 1.8 per our minimum Java version (#15707) (6028cdb)
  • Update internalUpdateFileDescriptor() to synchronize setProto() and resolveAllFeatures() to avoid data races. (#15659) (225b080)
  • Drop Protobuf support for Android KitKat per EOL and add existing minimum Java 1.8 in Maven pom.xmls (303239d)
  • Breaking change: Remove unused helper methods for creating new mutable arraylists. (7874474)
  • Breaking change: Use Editions features in Java full runtimes. (65c65c2)
  • Breaking change: Stop generating the "newInstance" method. This is not used anymore. (c0d08bd)
  • Breaking change: Remove unused overload of AbstractMessageLite.addAll that worked on a Collection instead of a List. (3b9bd6d)
  • Breaking change: Remove obsolete runtime internalBuildGeneratedFileFrom which was for backwards compatibility with old gencode. (9310d2e)
  • Breaking change: Remove unnecessary overloads of methods: (94a2a44)
  • Breaking change: Remove unnecessary generated overrides for GeneratedMessage.Builder methods: (7bff169)
  • Breaking change: The base class for generated messages will be GeneratedMessage, not GeneratedMessageV3.
  • Breaking change: Remove deprecated runtime methods for compatibility with old v2.x.x gencode. (e555bd2)
  • Breaking change: Remove deprecated TextFormat print methods. These should be replaced by corresponding TextFormat.printer() methods. (dfb8a4c)
  • Support pretty printing proto2 Extensions inside of proto3 Anys in TextFormat.Printer. (c8e0160)
  • Breaking change: Lock down visibility for descriptor syntax APIs. (1aeacd4)
  • Enable Protobuf version validations in Protobuf Java Full. (a2f9268)
  • Breaking change: Make deprecated Java gencode PARSER variable private. (b4858b2)
  • Add Automatic-Module-Name (#14562) (d580fde)
  • Use Editions features in Java, Kotlin, and Java Lite code generators. (90e1b49)

Kotlin

  • Breaking change: Use Editions features in Java full runtimes. (65c65c2)
  • Breaking change: The base class for generated messages will be GeneratedMessage, not GeneratedMessageV3.
  • Use Editions features in Java, Kotlin, and Java Lite code generators. (90e1b49)

Objective-C

  • [ObjC] Use a local to avoid warnings in 32bit builds. (#15665) (394aec8)
  • [ObjC] Add the privacy manifest to the ObjC CocoaPod. (#15663) (935fcb7)
  • Improve handing of the WKT ObjC Category additions. (b146d14)
  • Add a unpack helper for GPBAny with extension support. (29fca8a)

Rust

  • Tweak BUILD setup to make the layering check change less disruptive (#15838) (52aa150)

Python

  • Adhere to PEP 8 (#15127) (#15729) (3b92f4f)
  • Breaking change: Remove the deprecated always_print_primitive_fields option from Java, Python and C++ JSON parsers. (06e7cab)
  • Rename the 'includingDefaultValueWithoutPresenceFields' and 'always_print_without_presence_fields' to 'alwaysPrintFieldsWithNoPresence' in the Cpp, Py and Java JSON serializers for consistency. (fc41e78)
  • Add new including_default_value_without_presence_fields to Python JSON serializer. (c530216)
  • Breaking change: Removed obsolete/duplicate setup.py from Python. (#15708) (5722aef)
  • Fixed a bug when deep copying a map field with a closed enum value. (ca5ca62)
  • Breaking change: Made text_format output default to UTF-8. (bf00034)
  • Fixed a SEGV when deep copying a non-reified sub-message. (b9e4894)
  • Make str(msg) in Python print raw UTF-8 strings. Only invalid UTF-8 is escaped. (f2a91b3)
  • Breaking change: Remove RegisterExtension in message class (4ebba68)
  • Breaking change: Reject extend repeated field with none iterable (Raise TypeError) (1658213)
  • Breaking change: Remove Deprecated APIs that add non top descriptor. (c51f111)
  • Breaking change: Check if Timestamp is valid. (4f77929)
  • [Python/upb] Fixed SEGV when attempting to delete a message attribute (de52944)
  • Breaking change: Remove msg.UnknownFields() support in pure python and cpp extension. (0eac77c)
  • Breaking change: Remove deprecated syntax accessor. (fd40c87)
  • Fixed a bug where FileDescriptor maps like message_types_by_name could return descriptors from other files. (c05b320)
  • Mark the python generator for editions support. (b01bd1b)
  • Add support and partial CI coverage for Python 3.12 (24fef03)
  • Implement Editions in Pure Python. (15eccf3)
  • Properly untrack Python GC objects during deallocation. (e32d094)
  • Raise warnings for python syntax usages (c508a40)
  • Fixed Python memory leak in map lookup. (b0eeb35)
  • Fix handling of Unicode escapes in string data in textproto files. (62a435c)

PHP

PHP C-Extension

  • Updated amalgamations for PHP and Ruby. (c773dc9)
  • Breaking change: Validate UTF-8 in string setters, as previously announced. (d14dbbc)
  • Optimized binary/JSON parsing to no longer copy input data into a temp buffer. (588d5aa)
  • See also UPB changes below, which may affect PHP C-Extension.

Ruby

  • Ruby implement memsize functions for native types (#10291) (4902fc0)
  • Moved ObjectCache into an internal module. (9087337)
  • Increased the size of the error message buffer by 4x, to 511 bytes. (#15728) (ab6bcba)
  • Move the RubyMessage.java JSON "include defaults" to use alwaysPrintFieldsWithNoPresence. (b5beba3)
  • Breaking change: Removed syntax and added has_presence?/is_packed?. (dbd4dce)
  • Breaking change: Fixed json_encode/json_decode to use the message's pool. (a8b8ea0)
  • Breaking change: Freeze is now recursive, affecting all sub-messages, maps, and repeated fields. (31313b1)
  • Breaking change: Fixed inconsistencies in Message#to_h, as previously announced. (fd69938)
  • Breaking change: Dropped support for Ruby DSL, as previously announced. (5cfc9e7)
  • In Ruby repeated fields, each_index actually iterates over the index (#11767) (f869cfa)
  • Breaking change: Lock down visibility for descriptor syntax APIs. (1aeacd4)
  • Make rules_ruby a dev-only dependency. (571b727)
  • Add support for extensions in CRuby, JRuby, and FFI Ruby (#14703) (42f8b77)
  • Add support for options in CRuby, JRuby and FFI (#14594) (ae1f2b7)

Ruby C-Extension

  • Updated amalgamations for PHP and Ruby. (c773dc9)
  • Ruby implement memsize functions for native types (#10291) (4902fc0)
  • Moved ObjectCache into an internal module. (9087337)
  • Breaking change: Removed syntax and added has_presence?/is_packed?. (dbd4dce)
  • Breaking change: Fixed json_encode/json_decode to use the message's pool. (a8b8ea0)
  • Breaking change: Freeze is now recursive, affecting all sub-messages, maps, and repeated fields. (31313b1)
  • Breaking change: Fixed inconsistencies in Message#to_h, as previously announced. (fd69938)
  • Upb: fix Ruby bug which allowed map.delete(key) on a frozen map (df57e54)
  • Add support for extensions in CRuby, JRuby, and FFI Ruby (#14703) (42f8b77)
  • Add support for options in CRuby, JRuby and FFI (#14594) (ae1f2b7)
  • See also UPB changes below, which may affect Ruby C-Extension.

UPB (Python/PHP/Ruby C-Extension)

  • Ruby implement memsize functions for native types (#10291) (4902fc0)
  • Increased the size of the error message buffer by 4x, to 511 bytes. (#15728) (ab6bcba)
  • Wrap C++ headers in #ifdef __cplusplus. (fc2d9da)
  • Add kUpb_DecodeOption_AlwaysValidateUtf8 decode option, to force UTF-8 validation of proto2 strings. (d4dfb9c)
  • Fixed non-conformance in upb JSON enum decoding when ignoring unknown enum values. (c16ac66)
  • Fix upb's json decoder ignoring trailing characters after a successfully parsed object. (fa15c21)
  • Fix upb_MiniTable_GetOneof(miniTable, field) to work correctly if field is the very first field in the proto. (e6ea44c)
  • Enabled editions support for upb generated code. (cf3a6f5)
  • Upb: stop generating hazzers for repeated fields (fa62c92)

Other

  • Add back error message unconditionally (64ad139)
  • Actually fail if staleness fail (108bec3)
  • Disabled macOS 8.2, to match main. (9dfa2b6)
  • Add PrivacyInfo.xcprivacy (#15557) (#15661) (5a5ec6c)
  • Extend Proto2 JSON test cases to cover more of the preexisting Proto3 JSON cases. (42ecd61)
  • Include JSON output tests with Proto2 messages in the conformance test suite. (255f95e)
  • Make the utf8_range implementation just in C (9c7d2b9)
  • Open-source editions Bazel rules for embedding defaults. (898d8fa)
  • Enable conformance tests over editions protos (a2ba8bc)
  • Move utf8_range into the protobuf repo (5ca8400)

Don't miss a new protobuf release

NewReleases is sending notifications on new releases.