Releases: protocolbuffers/protobuf
Protocol Buffers v33.5
Announcements
- Protobuf News may include additional announcements or pre-announcements for upcoming changes.
Python
Other
Protocol Buffers v34.0-rc1
Announcements
- This version includes breaking changes to: C++, Objective-C, PHP, Python.
- [Bazel] Remove deprecated ProtoInfo.transitive_imports. Use equivalent transitive_sources instead (0a5c2f6)
- [C++] Make generator headers private (3a2af35)
- [C++] Add a debug check that the target of CopyFrom is not a descendant of the source. (7a75898)
- [C++] Add [[nodiscard]] to many APIs. (a70115f)
- [C++] Make the arena-enabled constructors of
RepeatedField,RepeatedPtrField, andMapprivate. (ef890c3) - [C++] Remove deprecated FieldDescriptor::label() in OSS. Use is_repeated() or is_required() instead (b76faa9)
- [C++] Removes proto2::util::MessageDifferencer::AddIgnoreCriteria that takes a raw pointer as an argument in favor of the overload that takes a unique_ptr. Remove macro PROTOBUF_FUTURE_REMOVE_ADD_IGNORE_CRITERIA (b115358)
- [C++] Remove deprecated FieldDescriptor::has_optional_keyword() in OSS. Use is_repeated() or has_presence() instead (68346ec)
- [C++] Remove AddUnusedImportTrackFile() and ClearUnusedImportTrackFiles(). Remove PROTOBUF_FUTURE_RENAME_ADD_UNUSED_IMPORT (837a2cd)
- [C++] Remove deprecated FieldDescriptor::is_optional() in OSS. Use (!is_required() && !is_repeated()) instead (9dbc5d4)
- [C++] Remove deprecated UseDeprecatedLegacyJsonFieldConflicts() (c301c2c)
- [C++] All entity names have length limit (2afb0dc)
- [ObjC] Remove
generate_minimal_importsgeneration option warning (45b1297) - [ObjC] Fix nullability annotations on some
GPB*Dictionarytypes. (ea67d6d) - [ObjC] Remove
-[GPBFieldDescriptor optional](3414dc1) - [Other] Remove deprecated flag for enabling MSVC support (97c979b)
- [PHP] Remove deprecated PHP APIs (9c45014)
- [PHP] Remove deprecated PHP APIs FieldDescriptor getLabel, use IsRepeated or isRequired instead. (4208121, cd76e67, 4208121)
- [PHP] Add PHP typehints for setters and remove redundant GPBUtil checks (#25296) (aee03b7)
- [PHP] support default values for editions/proto2 (#25161) (b01099d)
- [Python] Raise errors in OSS when assign bool to int/enum field in Python Proto. (5b116fe)
- [Python] Remove float_format/double_format from python proto text_format (e4854a1)
- [Python] Raise TypeError when convert non-timedelta to Duration, or convert non-datetime to Timestamp in python proto. (Original code may raise ArributeError) (00aaca1)
- [Python] Remove float_precision from python proto json_format (f027f1f)
- [Python] Remove deprecated FieldDescriptor::label() in OSS. Use is_repeated() or is_required() instead (b76faa9)
- [Python] Remove deprecated FieldDescriptor.label (0a8ff55)
- [Python] Remove deprecated UseDeprecatedLegacyJsonFieldConflicts() (c301c2c)
- Protobuf News may include additional announcements or pre-announcements for upcoming changes.
- Migration Guide may include additional guidance for breaking changes.
Bazel
- Fix: cc_toolchain should prefer protoc when prebuilt flag is flipped. (#25168) (8c857c3)
- Breaking change: Remove deprecated ProtoInfo.transitive_imports. Use equivalent transitive_sources instead (0a5c2f6)
- Feat(bazel): wire up prebuilt protoc toolchain (#24115) (cc23698)
- Migrate
proto_descriptor_set(#23369) (8d4dfdd)
Compiler
- Ruby codegen: support generation of rbs files (#15633) (6ebdf85)
- Avoid collision name problems between a message named
Xyzand a direct sibling enum namedXyzView(eba53e8) - Generalizing and implementing ValidateFeatureSupport for both Options and Features during proto parsing (ed3c571)
- Fix a bug with custom features outside of the
pbpackage. (872d3ce) - Fix import option handling when include_imports isn't set. (9ef9e80)
- Fix a bug in STRICT check of namespaced enums to properly check for 'reserved 1 to max' (1229d4a)
- Prevent accidental stripping of
debug_redactoptions via import option. (f58b098)
C++
- Add EnumerateEnumValues function. (397d5d9)
- Add conformance tests for utf8 validation. (e8923a8)
- Disable constinit on MSVC for static library builds (783da0a)
- Breaking change: Make generator headers private (3a2af35)
- Add bounds checking to ExtractSubrange. (5687acc)
- This CL starts failing on
[unverified_lazy = true]on extensions, which have been (d2a42e7) - Refine the conditions for the MSVC constinit workaround (38927bf)
- Add conformance test cases about handling of google.protobuf.Empty inside any Any in JSON. (0f3dd06)
- Remove PROTOBUF_CONSTEXPR to unconditionally use constexpr (7f431bb)
- Add bounds checking to
DeleteSubrange, create new helper,RuntimeAssertInBoundsGE, and modifyLogIndexOutOfBoundsAndAbortto customize the message being logged. (71cc97c) - Breaking change: Remove deprecated UseDeprecatedLegacyJsonFieldConflicts() (c301c2c)
- Fix issue where BinaryToJson a Skip()'s failure on unknown fields was ignored instead of resulting in a parse failure. (2ec322e)
- Breaking change: Add [[nodiscard]] to many APIs. (a70115f)
- Abort on out of bounds accesses. (3acf23c)
- Fix JSON printing of Any of an empty message in C++Proto. (014f676)
- FieldMaskUtil::TrimMessage: Handle repeated messages. (0f109cb)
- Breaking change...
Protocol Buffers v33.4
Announcements
- Protobuf News may include additional announcements or pre-announcements for upcoming changes.
Other
Protocol Buffers v33.3
Announcements
- Protobuf News may include additional announcements or pre-announcements for upcoming changes.
Bazel
- Fix: cc_toolchain should prefer protoc when prebuilt flag is flipped. (#25168) (7b30360)
- Locked down visibility of the new flags and config settings. (04ca1b7)
- Feat(bazel): wire up prebuilt protoc toolchain (#24115) (aeaede0)
Compiler
- Create editions test_utils to fix existing brittle tests in
command_line_interface_unittestandcode_generator_unittest. (cb0a8c5) - Add edition unstable for development work. (44e090c)
- Add conformance test for edition unstable (d167dd0)
C++
- Add edition unstable for development work. (44e090c)
- Add conformance test for edition unstable (d167dd0)
Java
- Add conformance test for edition unstable (d167dd0)
- Correctly apply JSON recursion limit when parsing an Any-of-Any. (94c7f73)
Csharp
- Add conformance test for edition unstable (d167dd0)
Python
UPB (Python/PHP/Ruby C-Extension)
Other
Protocol Buffers v33.2
Announcements
- Protobuf News may include additional announcements or pre-announcements for upcoming changes.
Compiler
- Add EDITION_UNSTABLE for new edition development (9247790)
- Fix a bug with custom features outside of the
pbpackage. (483173d) - Reserving a declaration for the Impress proto plugin. (8a0b438)
C++
- Remove unnecessary uses of future changes to descriptor.proto (50c9e62)
- Fix a bug with custom features outside of the
pbpackage. (483173d)
Java
- Fix a bug with custom features outside of the
pbpackage. (483173d)
Csharp
- Add EDITION_UNSTABLE for new edition development (9247790)
- Use generic Marshal.SizeOf when possible (#21964) (#24673) (9f263cd)
- Regenerate stale files (058bffa)
PHP
- Add EDITION_UNSTABLE for new edition development (9247790)
PHP C-Extension
- Regenerate staleness tests (e9f62c6)
- Add EDITION_UNSTABLE for new edition development (9247790)
- Regenerate stale files (058bffa)
- See also UPB changes below, which may affect PHP C-Extension.
Ruby
Ruby C-Extension
- Regenerate staleness tests (e9f62c6)
- Regenerate stale files (058bffa)
- See also UPB changes below, which may affect Ruby C-Extension.
UPB (Python/PHP/Ruby C-Extension)
Protocol Buffers v33.1
Announcements
- Protobuf News may include additional announcements or pre-announcements for upcoming changes.
C++
Java
Protocol Buffers v33.0
Announcements
- Protobuf News may include additional announcements or pre-announcements for upcoming changes.
Bazel
- Feat: update bazel central registry publish workflow (#23465) (#23913) (d5217fd)
- Add target_compatible_with parameter to proto_toolchain in Bazel rules (#22429) (30d2332)
- Bazel: add missing rules_cc loads (#23584) (d98e2ef)
Compiler
- Disable symbol visibility enforcement by default in C++ runtime (ae308fc)
- Ship all option dependencies to plugins along with regular ones. (abeb130)
C++
- Avoid calling deprecated arena-enabled constructors in arena.h. (813a7ef)
- Add a macro to make
RepeatedField(Arena*)constructor private in a future release. (768db14) - Add a macro to make
Map(Arena*)constructor private in a future release. (543a17f) - Optimize ReadPackedVarint (3d94d83)
- Add a macro to make
RepeatedPtrField(Arena*)constructor private in a future release (6422b9d) - Add IsEmpty() function to reflection. (b64e490)
- Refactor
RuntimeAssertInBoundsto remove repeated logic and makeGet/Mutableeasier to read. (2f270c4) - Disable symbol visibility enforcement by default in C++ runtime (ae308fc)
- Fix a bug in the main C++ JSON parser/serializer camelcasing of certain non-style-compliant names incorrectly, in a way that would prevent it from interoperating with any other implementation on those fields. (e25e267)
- Fail early for messages with more than 65k fields. (90824aa)
- Add option to C++ JSON Parser/Serializer to allow customers to affirmatively disable legacy bug-compatibilty behaviors. (6ea1640)
- Fix mishandling on JSON serialization of Timestamp with invalid negative and too-large nanos value. (a959f27)
- Preserve features in type resolver (c7030f4)
- Add a DCHECK that ArenaStringPtr::Set(char*, Arena*) is not called with (95b1763)
Java
Restored compatibility of runtime with gencode created with protoc <3.21
With this release, compatibility of the runtime with older gencode down to 3.0.0 is restored, compared to the previous support minimum of gencode created with 3.22+. Note that it is still strongly recommended to regenerate your gencode with a newer protoc and to avoid using gencode which was created with an old protoc.
Generated code from this range is covered by CVE-2022-3171 and is potentially vulnerable to a Denial of Service risk.
JavaProto 4.x previously dropped compatibility with the potentially vulnerable generated code, having the behavior of:
- The vulnerable generated code was source-incompatible with new runtime (would not compile when built from source)
- The vulnerable generated code was ABI-incompatible with new runtime (when using a .class file compiled against old runtime, a NoSuchMethodException would be thrown at parse time).
Starting with this release:
- The vulnerable generated code is now source-compatible (will compile).
- The first time each potentially vulnerable type is parsed, an error message will be logged noting that potentially vulnerable generated code is in use and the name of the corresponding type.
- Environment variables may be set to either throw an exception instead (
-Dcom.google.protobuf.error_on_unsafe_pre22_gencode) or to entirely silence the logged messages (-Dcom.google.protobuf.use_unsafe_pre22_gencode)
This change was made based on community feedback regarding the difficulty in identifying and quickly remediating stale gencode in their transitive dependencies weighed against a careful evaluation of the realistic risk exposure of DoS (with no risk of other concerns including information leak or RCE).
We strongly recommend that any users who observe the log messages to regenerate the corresponding code with a newer protoc. We recommend that any security-conscious services opt into the error_on_unsafe_pre22_gencode behavior to preclude any risk of a Denial of Service surface area being exposed.
A future 4.x release may flip the default behavior to error by default as a measure to further help the ecosystem avoid the Denial of Service risks, while still maintaining the ability to opt into continuing to use insecure gencode for users who are parsing trusted inputs and where the difficulty of regenerating is high.
Changes
- Switch the pre22 warning to use CopyOnWriteArraySet. (#23969) (e55224c)
- Expose helpers for checking if messages and enums are nested. (8de4002)
- Fix a bug calculating the file name in the absense of directories. (c4ff7a6)
- Clarify the public APIs of GeneratorNames helpers. (537ac35)
- Expose helpers to predict generated class names in java. (eba6df2)
- Deprecate ClassName methods in favor of new QualifiedClassName ones. (ca4fb2f)
- Restore the 3-argument internalBuildGeneratedFileFrom. (4376591)
- Fix large java enums not being honored on lite runtime. (a995803)
- Slightly relax Java Poison Pill on prerelease versions (-rc1, -dev, etc). (7b0bee3)
- Avoid boxing/unboxing
varint,fixed32, andfixed64fields inUnknownFieldSet.Field(810272f) - Readd new*List() methods on GeneratedMessageV3. (badaf41)
- Add Values.of(Map<String, Value> values). (c518f25)
- Fix handling of optional dependencies in java generator. (8d51e34)
- Restore ABI compatibility for extension methods which was previously (knowingly) broken with 4.x: 94a2a44 (ea33ae8)
- Restore Protobuf Java extension modifiers in gencode that were previously removed in 7bff169 (f2257f5)
- Ship all option dependencies to plugins along with regular ones. (abeb130)
- Optimize redaction state calculation (e05db5c)
- Add
isPlaceholder()accessors to file, message, and enum descriptors (f978ec2) - Improve Java gencode static initialization to avoid unnecessary temporaries again (745e15b)
- Improve Java gencode static initialization to avoid unnecessary temporaries (b68b673)
- Remove protobuf-util usages of guava except annotations. (5768acd)
- Restore compatibility of runtime with pre-3.22.x gencode impacted by CVE-2022-3171 (7c51e5b)
- Expose an iterator for
GeneratedMessage.ExtendableMessage.extensions(b25d39e)
Rust
- Change Rust prelude to bring in traits as
_(c3f7e8d) - Make message ...
Protocol Buffers v33.0-rc2
Announcements
- Protobuf News may include additional announcements or pre-announcements for upcoming changes.
C++
- Avoid calling deprecated arena-enabled constructors in arena.h. (813a7ef)
- Add a macro to make
RepeatedField(Arena*)constructor private in a future release. (768db14) - Add a macro to make
Map(Arena*)constructor private in a future release. (543a17f)
Java
Protocol Buffers v33.0-rc1
Announcements
- Protobuf News may include additional announcements or pre-announcements for upcoming changes.
Bazel
Compiler
- Disable symbol visibility enforcement by default in C++ runtime (ae308fc)
- Ship all option dependencies to plugins along with regular ones. (abeb130)
C++
- Optimize ReadPackedVarint (3d94d83)
- Add a macro to make
RepeatedPtrField(Arena*)constructor private in a future release (6422b9d) - Add IsEmpty() function to reflection. (b64e490)
- Refactor
RuntimeAssertInBoundsto remove repeated logic and makeGet/Mutableeasier to read. (2f270c4) - Disable symbol visibility enforcement by default in C++ runtime (ae308fc)
- Fix a bug in the main C++ JSON parser/serializer camelcasing of certain non-style-compliant names incorrectly, in a way that would prevent it from interoperating with any other implementation on those fields. (e25e267)
- Fail early for messages with more than 65k fields. (90824aa)
- Add option to C++ JSON Parser/Serializer to allow customers to affirmatively disable legacy bug-compatibilty behaviors. (6ea1640)
- Fix mishandling on JSON serialization of Timestamp with invalid negative and too-large nanos value. (a959f27)
- Preserve features in type resolver (c7030f4)
- Add a DCHECK that ArenaStringPtr::Set(char*, Arena*) is not called with (95b1763)
Java
- Slightly relax Java Poison Pill on prerelease versions (-rc1, -dev, etc). (7b0bee3)
- Avoid boxing/unboxing
varint,fixed32, andfixed64fields inUnknownFieldSet.Field(810272f) - Readd new*List() methods on GeneratedMessageV3. (badaf41)
- Add Values.of(Map<String, Value> values). (c518f25)
- Fix handling of optional dependencies in java generator. (8d51e34)
- Restore ABI compatibility for extension methods which was previously (knowingly) broken with 4.x: 94a2a44 (ea33ae8)
- Restore Protobuf Java extension modifiers in gencode that were previously removed in 7bff169 (f2257f5)
- Ship all option dependencies to plugins along with regular ones. (abeb130)
- Optimize redaction state calculation (e05db5c)
- Add
isPlaceholder()accessors to file, message, and enum descriptors (f978ec2) - Improve Java gencode static initialization to avoid unnecessary temporaries again (745e15b)
- Improve Java gencode static initialization to avoid unnecessary temporaries (b68b673)
- Remove protobuf-util usages of guava except annotations. (5768acd)
- Restore compatibility of runtime with pre-3.22.x gencode impacted by CVE-2022-3171 (7c51e5b)
- Expose an iterator for
GeneratedMessage.ExtendableMessage.extensions(b25d39e)
Rust
- Change Rust prelude to bring in traits as
_(c3f7e8d) - Make message Muts
Send(8bff944) - See also UPB changes below, which may affect Rust.
Python
- Publish s390x wheels for Python/upb. (56b2b89)
- Fix a crash that happens during shutdown due to looking up modules in the cache (d57d270)
- Add construction support for repeated Timestamp/Duration/Struct/ListValue. (5f6c013)
- Fix handling of repeated extension fields in PyProto JSON (07ef676)
- Fixed a parser bug where closed enums are parsed incorrectly for non-repeated extensions. (c36f728)
- Fixed mypy errors by setting
__slots__to empty in.pyifiles. (38ca2d3) - Raise warnings for float_precision from python json_format. (4659cd7)
- Raise warnings when assign bool to int/enum field in Python Proto. This will turn into error in 34.0 release. (4ee55d7)
PHP
UPB (Python/PHP/Ruby C-Extension)
- Fixed a parser bug where closed enums are parsed incorrectly for non-repeated extensions. (c36f728)
Other
Protocol Buffers v32.1
Announcements
- Protobuf News may include additional announcements or pre-announcements for upcoming changes.
Compiler
- Ship all option dependencies to plugins along with regular ones. (34d6c85)
- Unify plugin and built-in generators to use request/response interface (b98f6ee)
- Disable symbol visibility enforcement by default in C++ runtime (aad0daa)
C++
- Disable symbol visibility enforcement by default in C++ runtime (aad0daa)
Java
- Fix handling of optional dependencies in java generator. (892e0d5)
- Restore Protobuf Java extension modifiers in gencode that were previously removed in 7bff169 (4a18be6)
- Restore ABI compatibility for extension methods which was previously (knowingly) broken with 4.x: 94a2a44 (501f4a5)
- Cherrypick test improvements (d365736)
- Fix handling of optional dependencies in java generator. (9325480)
- Ship all option dependencies to plugins along with regular ones. (34d6c85)
- Unify plugin and built-in generators to use request/response interface (b98f6ee)
Csharp
- Regenerate stale files (299774c)
PHP
- Fix: remove provide from composer.json (bc5f303)