github protocolbuffers/protobuf v34.0-rc1.1
Protocol Buffers v34.0-rc1

pre-release8 hours ago

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, and Map private. (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_imports generation option warning (45b1297)
  • [ObjC] Fix nullability annotations on some GPB*Dictionary types. (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 Xyz and a direct sibling enum named XyzView (eba53e8)
  • Generalizing and implementing ValidateFeatureSupport for both Options and Features during proto parsing (ed3c571)
  • Fix a bug with custom features outside of the pb package. (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_redact options 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 modify LogIndexOutOfBoundsAndAbort to 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: Remove deprecated FieldDescriptor::label() in OSS. Use is_repeated() or is_required() instead (b76faa9)
  • Generalizing and implementing ValidateFeatureSupport for both Options and Features during proto parsing (ed3c571)
  • Breaking change: Remove deprecated FieldDescriptor::has_optional_keyword() in OSS. Use is_repeated() or has_presence() instead (68346ec)
  • Test that all entity names have some limit, and that passing that limit will (2afb0dc)
  • Breaking change: Remove deprecated FieldDescriptor::is_optional() in OSS. Use (!is_required() && !is_repeated()) instead (9dbc5d4)
  • Breaking change: Remove AddUnusedImportTrackFile() and ClearUnusedImportTrackFiles(). Remove PROTOBUF_FUTURE_RENAME_ADD_UNUSED_IMPORT (837a2cd)
  • Breaking change: 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)
  • Mark mutable repeated fields/maps as [[nodiscard]] (bc60e2e)
  • Apply [[nodiscard]] to constant, non-message accessors. (46575f0)
  • Add [[nodiscard]] to many const methods of Message/Reflection. (8c981b8)
  • Fix a bug with custom features outside of the pb package. (872d3ce)
  • Delete safe_boundary_check as this now supported via build flag, --//third_party/protobuf:bounds_check_mode. (3079d15)
  • Add [[nodiscard]] to const message field accessors. (60f60d0)
  • CMake: Stop building tests by default (related to #20539) (#24373) (88261aa)
  • Optimize TcParser::RepeatedVarint (88efe88)
  • Add nodiscard to has_/_size accessors. (40fe103)
  • Enable removed arena pointers from all fields. (1f3fe2e)
  • Fix a bug in STRICT check of namespaced enums to properly check for 'reserved 1 to max' (1229d4a)
  • Breaking change: Add a debug check that the target of CopyFrom is not a descendant of the source. (7a75898)
  • Breaking change: Make the arena-enabled constructors of RepeatedField, RepeatedPtrField, and Map private. (ef890c3)
  • Update AddAlreadyReserved/AddNAlreadyReserved to use the runtime bounds checks. (b8e690a)
  • Use __builtin_operator_new to faciliate compiler optimizations of these allocs. (4624d81)
  • Add has_default_instance() to ImplicitWeakTypeHandler (818b8ef)
  • Add a macro to make RepeatedField(Arena*) constructor private in a future release. (b39f10c)
  • Use __builtin_operator_new to faciliate compiler optimizations of these allocs. (195da19)
  • Change LogIndexOutOfBoundsAndAbort logging message. (bc0b635)

Java

  • Optimize TextFormatEscaper to just return the String input if it didn't need any escaping. (e536204)
  • Adding deprecation comment when isInitialized() accessor is deprecated (2732c60)
  • Deprecating isInitialized() if there aren't required fields (2607595)
  • Avoid skipping descriptors with option dependencies (1bc2c63)
  • Remove PROTOBUF_CONSTEXPR to unconditionally use constexpr (7f431bb)
  • Correctly apply JSON recursion limit when parsing an Any-of-Any. (33b16e8)
  • Avoid potential exceptions on serialize in the face of malformed lazy extensions. (531c644)
  • Remove unused canUseUnsafe() protected method from GeneratedMessage (1041d62)
  • Apply [[nodiscard]] to constant, non-message accessors. (46575f0)
  • Add check if sun.misc.Unsafe is present but throws on use, to use the preexisting no-Unsafe paths if it does. (3514901)
  • Fix a bug with custom features outside of the pb package. (872d3ce)
  • Expose NestedInFileClass naming helpers for Java immutable. (0c48552)
  • Add nodiscard to has_/_size accessors. (40fe103)
  • Remove defunct protected mergeFromAndMakeImmutableInternal method. This method was planned to be used by gencode but was never used in practice. (57770eb)
  • Fix bugs in Java Large Enums that have aliased values, and improve performance of valueOf / forNumber. (57338e8)
  • Remove unused test-only method Protobuf.registerSchemaOverride (8e623d1)
  • Remove unused method com.google.protobuf.Protobuf.mergeFrom(T,Reader) (7b6be54)
  • Remove unused method com.google.protobuf.Protobuf.makeImmutable (8fa15e9)
  • Mark com.google.protobuf.Protobuf.registerSchema as private (db16bca)
  • Remove "public" from methods in com.google.protobuf.Protobuf (f50c425)
  • Remove unused method com.google.protobuf.Protobuf.getTotalSchemaSize() (dead64c)
  • Fix large java enums not being honored on lite runtime. (ec3c8a7)

Csharp

  • Fix: apply recursion limits when parsing JSON well-known types with deep arrays (c3ddacb)

Objective-C

  • Adds support for 3 modes for proto extension generation: (0bc4192)
  • Breaking change: Remove generate_minimal_imports generation option warning (45b1297)
  • Emit hassers for oneofs in objectivec. (2aae07e)
  • Breaking change: Fix nullability annotations on some GPB*Dictionary types. (ea67d6d)
  • Breaking change: Remove -[GPBFieldDescriptor optional] (3414dc1)

Rust

  • Rust protobuf: use crate name aliases to disambiguate generated dependencies (1f07ec6)
  • Avoid collision name problems between a message named Xyz and a direct sibling enum named XyzView (eba53e8)
  • Mark MessageMut trait as + Send (bc517b9)
  • Protobuf-rust: adapt for rules_rust 0.67 (eb8d34e)
  • Adapt for rules_rust 0.66.0. (adb1957)
  • Expose protobuf::message_eq() free function on the Rust Protobuf runtime api. (cfa8f67)
  • Protobuf-rust: pass DepVariantInfo's attributes explicitily (a42e64f)
  • See also UPB changes below, which may affect Rust.

Python

  • Prevent crashes when creating objects during interpreter shutdown (46061cb)
  • Drop Python 3.9 support (bbc9dd9)
  • Breaking change: Remove deprecated UseDeprecatedLegacyJsonFieldConflicts() (c301c2c)
  • Breaking change: Remove deprecated FieldDescriptor::label() in OSS. Use is_repeated() or is_required() instead (b76faa9)
  • Support more chars in type URLs in the Python text-format parser. (4459a20)
  • Breaking change: Raise errors in OSS when assign bool to int/enum field in Python Proto. (5b116fe)
  • Breaking change: Remove float_format/double_format from python proto text_format (e4854a1)
  • Two new functions in PyProto_API to manage DescriptorPools (59f2a6e)
  • Breaking change: Remove deprecated FieldDescriptor.label (0a8ff55)
  • Python Proto scalar repeated numpy binding. (1eb4e52)
  • Python Proto Free Threading tests/experimental (b8bef14)
  • Add Python 3.14 test coverage (8e35431)
  • Put ABSL annotations back in descriptor (e2ddebe)
  • Free threading compat - Only access interned_descriptors behind a mutex (13fe37f)
  • Breaking change: Remove float_precision from python proto json_format (f027f1f)
  • Breaking change: Raise TypeError when convert non-timedelta to Duration, or convert non-datetime to Timestamp in python proto. (Original code may raise ArributeError) (00aaca1)
  • Python: kwargs initialization would silently swallow some errors with repeated fields. (412d0a2)
  • Fix Python cpp memory crash when MergeFrom Oneof. (26d08d5)

PHP

  • Feat(php): Add PHP typehints for setters and remove redundant GPBUtil checks (#25296) (aee03b7)
  • Raise minimum php version to 8.2.0. Drop tests for 8.1. (5d29dca)
  • Feat(php): support default values for editions/proto2 (#25161) (b01099d)
  • Breaking change: Remove deprecated PHP APIs FieldDescriptor getLabel, use IsRepeated or isRequired instead. (4208121)
  • Automated rollback of commit 8f569de. (94fe944)
  • Breaking change: Remove deprecated PHP APIs FieldDescriptor getLabel, use IsRepeated or isRequired instead (cd76e67)
  • Breaking change: Remove deprecated PHP APIs (9c45014)
  • Make PHPDoc for enum getters/setters correspond to enum class. (#24515) (996e04c)
  • Add option for PHP to emit default values for JSON. (#23985) (6df6c8a)
  • Implement hasPresence helper in PHP, remove broken hasOptionalKeyword. (69efbc6)

PHP C-Extension

  • Raise minimum php version to 8.2.0. Drop tests for 8.1. (5d29dca)
  • Feat(php): support default values for editions/proto2 (#25161) (b01099d)
  • Breaking change: Remove deprecated PHP APIs FieldDescriptor getLabel, use IsRepeated or isRequired instead. (4208121)
  • Automated rollback of commit 8f569de. (94fe944)
  • Add option for PHP to emit default values for JSON. (#23985) (6df6c8a)
  • Implement hasPresence helper in PHP, remove broken hasOptionalKeyword. (69efbc6)
  • See also UPB changes below, which may affect PHP C-Extension.

Ruby

UPB (Python/PHP/Ruby C-Extension)

  • Add conformance tests for utf8 validation. (e8923a8)
  • Added more validations of syntax and edition when parsing descriptors. (4c5c4b2)
  • Fixes a compiler crash when building the Windows arm64 Ruby/Python extension (0e84323)
  • Add BTI to branch targets when branch protection is enabled. This resolves (a3ca522)
  • Enable edition 2024 in upb generators (e44d421)

Other

  • Drop Bazel 7 tests for bazel, python, partially java partially cpp. (b046c9a)
  • Update protobuf's dep on bazel-skylib to version 1.9.0 (27e67a7)
  • Breaking change: Remove deprecated flag for enabling MSVC support (97c979b)
  • Protobuf: update php from macos-13 to macos-15-intel (7b9feca)
  • Bazel: Remove hardcoded dependency on //:protoc from language runtimes (#19679) (4986a77)
  • Move ObjC to the next major version to be ready for release in 2026Q1. (31cadad)

Don't miss a new protobuf release

NewReleases is sending notifications on new releases.