Changes Announced on September 19, 2025
The following sections cover planned breaking changes in the v34 release, expected in 2026 Q1. These describe changes as we anticipate them being implemented, but due to the flexible nature of software some of these changes may not land or may vary from how they are described in this topic.
Changes in C++
C++ will bump its major version to 7 with the 7.34.0 release. 6.33 will be the final minor version release on 6.x
Removal of Future Macros
The following macros, introduced for staged roll-out of breaking changes, will be removed and their behavior will become the default:
PROTOBUF_FUTURE_RENAME_ADD_UNUSED_IMPORT
PROTOBUF_FUTURE_REMOVE_ADD_IGNORE_CRITERIA
PROTOBUF_FUTURE_STRING_VIEW_DESCRIPTOR_DATABASE
PROTOBUF_FUTURE_NO_RECURSIVE_MESSAGE_COPY
New RepeatedPtrField Layout
RepeatedPtrField
will transition to a new internal element layout where
elements are stored in contiguous chunks of preallocated memory, similar to
std::deque
. This results in some changes to copy/move semantics of some APIs,
and some UnsafeArena
APIs may become functional equivalents of their
arena-safe counterparts and be deprecated.
MSB Hardening Check on RepeatedField::Get and RepeatedPtrField::Get
Protobufs will be hardened against OOB errors by adding comprehensive bounds checking to repeated field accesses.
Remove Arena Pointers from Repeated Fields
The RepeatedPtrField(Arena*)
constructor will be deleted.
Remove Deprecated APIs
This release will remove the following public runtime APIs, which have been marked deprecated for at least one minor or major release and that are obsolete or replaced.
AddUnusedImportTrackFile() and ClearUnusedImportTrackFiles()
API: AddUnusedImportTrackFile()
, ClearUnusedImportTrackFiles()
Replacement: AddDirectInputFile()
and ClearDirectInputFiles()
AddIgnoreCriteria from message differencer
PROTOBUF_FUTURE_REMOVE_ADD_IGNORE_CRITERIA
was added for the breaking change.
This release will remove the macro.
API: AddIgnoreCriteria()
Replacement: Wrap the raw pointer in a unique_ptr
.
FieldDescriptor::has_optional_keyword()
API: FieldDescriptor::has_optional_keyword()
Replacement: has_presence()
FieldDescriptor::label()
API: FieldDescriptor::label()
Replacement: is_repeated()
or is_required()
FieldDescriptor::is_optional()
API: FieldDescriptor::is_optional()
Replacement: !is_required() && !is_repeated()
UseDeprecatedLegacyJsonFieldConflicts()
API: UseDeprecatedLegacyJsonFieldConflicts()
Replacement: No replacement.
Stricter Name Length Limits
The protobuf compiler will enforce stricter limits on the length of symbol names, such as field names, to prevent potential issues. If the length of any field name is > 2^16, it will generate an error.
Hide Private Generator Headers in CMake
The protoc generator headers will no longer be installed by CMake. This should not affect most users.
[[nodiscard]] on Logically Constant Operations
[[nodiscard]]
will be added to several logically constant protobuf APIs where
failure to consume the returned value indicates a probable bug. This follows
patterns used commonly in the C++ standard library.
Changes in Python
Python will bump its major version to 7 with the 7.34.0 release. 6.33 will be the final minor version release on 6.x
There is no change in the gencode and we will relax the poison pills. No warnings or errors will be raised for old generated files for 7.34.x.
Raise TypeError on Incorrect Type Conversion to Timestamp/Duration
This release will raise a TypeError
instead of an AttributeError
when
converting an incorrect type to a Timestamp
or Duration
.
Reject bool to enum and int field
This release will reject setting enum or int fields with boolean values. The API will raise an error instead of implicitly converting them.
Remove float_precision from json_format
This release will remove the deprecated float_precision
option from the
json_format
serializer. This option does not exist in other ProtoJSON
serializers and has confusing semantics.
Remove float_format/double_format from text_format
This release will remove the deprecated float_format
and double_format
options from text_format
. These options are not available in other proto text
format serializers.
Remove Deprecated APIs
This release will remove the following public runtime APIs.
FieldDescriptor.label
API: FieldDescriptor.label
Replacement: Use is_repeated()
or is_required()
.
Changes in PHP
PHP will bump its major version to 5 with the 5.34.0 release. 4.33 will be the final minor version release on 4.x
Remove Deprecated APIs
This release will remove the following public runtime APIs.
FieldDescriptor getLabel
API: FieldDescriptor getLabel
Replacement: isRepeated()
or isRequired()
Google\Protobuf\Field_Kind
API: Google\Protobuf\Field_Kind
Replacement: Google\Protobuf\Field\Kind
Google\Protobuf\Field_Cardinality
API: Google\Protobuf\Field_Cardinality
Replacement: Google\Protobuf\Field\Cardinality
Google\Protobuf\Internal\RepeatedField
API: Google\Protobuf\Internal\RepeatedField
Replacement: Google\Protobuf\RepeatedField
JSON Parsing Strictness
The JSON parser will become stricter and reject several cases that were
previously accepted. This includes out-of-bound values, non-integer numeric
values for integer fields, duplicate oneof fields, and non-string values for
string fields. The JSON serializer will also reject Infinity
and NaN
for
number values.
Fix Silent Ignoring of Default Values
The PHP runtime will be fixed to honor default values on scalar fields in proto2 and editions, instead of silently ignoring them.
Type Checking Alignment
Type checking for pure-PHP and upb-PHP implementations will be aligned. Notably,
pure-PHP will reject null
for string fields, matching the behavior of upb-PHP.
Changes in Objective-C
Objective-C will bump its major version to 5 with the 5.34.0 release. 4.33 will be the final minor version release on 4.x
The nullability annotations for some GPB*Dictionary
APIs will be corrected to
mark when APIs could return nil
. This will result in Swift code getting a
Swift Optional<T>
and thus becoming a breaking API change. For Objective-C
callers, the annotation correction is less likely to have any impact on the
source code.
Remove Deprecated APIs
This release will remove the following public runtime APIs.
-[GPBFieldDescriptor optional]
API: -[GPBFieldDescriptor optional]
Replacement: Use !required && fieldType == GPBFieldTypeSingle
instead.
Other Changes
The following are additional breaking changes.
Bazel: Remove deprecated ProtoInfo.transitive_imports
The deprecated transitive_imports
field in ProtoInfo
will be removed. Users
should migrate to transitive_sources
.
Remove protobuf_allow_msvc flag and continue support Bazel+MSVC
Due to Bazel’s recent improvements on Windows, we now plan to continue to
support Bazel+MSVC. The --define=protobuf_allow_msvc
flag will be removed.
Languages Without a Major Version Bump
Java, Ruby, C#, Rust, and JRuby will not have a major version bump in this release.