github protocolbuffers/protobuf v37.0-rc1
Protocol Buffers v37.0-rc1

pre-release2 hours ago

Announcements

  • Protobuf News may include additional announcements or pre-announcements for upcoming changes.

Bazel

  • Prepare Protobuf for a future version of Bazel which will lack the proto fragment (f1c23cb)

Compiler

  • Add compiler flag --source_code_info_out to output SourceCodeInfo separately. (6acc31c)
  • Detects single-crate cross-file symbol collisions and conditionally emits crate-root re-exports. (e25ea67)
  • Apply protoc depth limit of nested messages also to group types. (77eb569)
  • Silence bad error when option dependencies are missing in the filesystem but present in input descriptor sets. (71e4548)
  • Implement GetSourceLocation for sub-fields and names of aggregate options. (c251d1a)

C++

  • Accept absl::Cord by value in Protobuf setters. (4d7adfc)
  • Optimize ReadSize with 2-byte inlined fast path in parse_context.h (524c72e)
  • Add field ownership check to SwapFields to prevent OOB memory access (#27289) (6ab198d)
  • Suppress deprecation warnings for EnumTraitsImpl on deprecated enums.(3b378b0)
  • Marking deprecated Enum messages deprecated within c++ gencode. (f70a00f)
  • Honor cc_namespace option by using updated Namespace() (2b880cf)
  • Fix InlinedStringField memory leak when string donation is disabled. (98fa2c5)
  • Prepare Protobuf for a future version of Bazel which will lack the proto fragment (f1c23cb)
  • [Py/C++] Fixed data race in Python free threading by removing obsolete hack (1a23830)
  • Automated rollback of commit 780ba8c. (915853d)
  • Silence bad error when option dependencies are missing in the filesystem but present in input descriptor sets. (71e4548)
  • Fix a bug in LazyField where parsing with a custom DescriptorPool or MessageFactory failed or lost extension data (b/519244881). (5d717fd)
  • Implement GetSourceLocation for sub-fields and names of aggregate options. (c251d1a)
  • Add deprecation warning for Reflection::GetEnum() and Reflection::GetRepeatedEnum(). (6a31b74)

Java

  • Log a warning in JsonFormat when printing extension fields with short names. (086584c)
  • Align DynamicMessage.hashCode() with GeneratedMessage.hashCode() (799556e)
  • Harden StreamDecoder in the face of >2 GiB INT_MAX overflow risks. (925e0f5)
  • Avoid empty byte array allocations in Proto Lite toByteArray(). (dee117a)
  • Avoid UTF8 length calculations in ArrayEncoder.writeStringNoTag (54fe86b)
  • Omit GET_MEMOIZED_IS_INITIALIZED in Java Lite for messages without required fields. (572ca36)
  • Inline MapEntryLite default instances in generated Java Lite code. (1aaaaae)
  • Automated rollback of commit ea0e67a. (bbe28f2)
  • Use ConcurrentMap in GeneratedMessageLite parser registry to avoid unsafe Java 8 API usage. (b0b22dd)
  • Optimize Java Lite Map Field Codegen by removing DefaultEntryHolder (e1acb1a)
  • Optimize GeneratedMessageLite parser registry to reduce memory footprint. (687c7d5)
  • Optimize Java Lite Parser Registry with Centralized Cache (51df91d)

Kotlin

    • Updates DslList and ExtensionList to take a lazy supplier lambda () -> List, retaining secondary constructors for binary backward compatibility with existing compiled proto code. (37f7857)

Csharp

  • Allow later enum aliases to overwrite in C# custom JSON enum mapping. (6836552)

Objective-C

  • [ObjC] Raise the Xcode project minimum iOS version to 15 (#30092) (8683532)
  • Deprecate Objective-C support in the protobuf compiler. (7cfcf45)
  • Validate php_class_prefix and objc_class_prefix in code generators (#29130) (1e1a0a8)
  • [ObjC] Carry recursion depth across MessageSet item parsing (#27571) (dd9d2ad)

Rust

  • Wrapping Rust thunk gencode with deprecation suppression. Rust generates call fields for all messages (deprecated or not) in their thunk.cc. This would trigger deprecation warnings [-Wdeprecated-declarations] on all deprecated proto messages. (1d004b2)
  • Rename Rust protobuf Proxied and MutProxied traits to ProtoObject and MutProtoObject and clarify rustdoc about what these things are. (0a3a348)
  • Rust: Give generated proto enums a const fn number() (41f6072)
  • Release the google-protobuf-example, google-protobuf-macros and google-protobuf-well-known-types crates, and stop publishing the legacy protobuf-* crates for 37.x+ (db9cb46)
  • Slightly relax the Mut<'_> lifetime in RepeatedMut get_mut (a5baafe)
  • Update README to note that the protobuf crate is superseded by google-protobuf. (8e70aa9)
  • Detects single-crate cross-file symbol collisions and conditionally emits crate-root re-exports. (e25ea67)
  • Rust protobuf matchers: Add a partially matcher to mirror C++ (e1c5f3a)
  • Re-export to google-protobuf crate in 0.x.y for 36.0 and above (97fcd43)
  • Remove iterator trait implementations for RepeatedMutIter (e8bd2b5)
  • Enable inherent next() and next_back() API for RepeatedMutIter besides trait implementation. (b1b5f99)
  • Add required_providers to proto aspect (aed6a82)
  • Escape all non-alnum chars in Rust module names (8ce2a36)
  • Fix the behavior of GetOrCreateMutableMessage on fields in oneofs (ad1064c)
  • See also UPB changes below, which may affect Rust.

Python

  • Ensure that we always invalidate map iterators when the message is mutated with MergeFrom() or CopyFrom(). (0dce421)
  • Python: don't emit ClassVar for a file's top-level extensions (#29222) (c0fd602)
  • Fix RepeatedCompositeContainer.add() to initialize the new message before attaching to the parent. (b824e66)
  • Python: Timestamp and Duration FromSeconds, FromMilliseconds, FromMicroseconds and FromNanoseconds now accept floats, rounded to the nearest nanosecond. NaN and infinity raise ValueError. (2e823d2)
  • Avoid EncodeError when ByteSize is called on message missing required fields (d3fa262)
  • Propagate Python C API failures in message field and dynamic attribute handling (#29854) (90229ff)
  • Fix PyFileDescriptor creation data race under free-threading. (c24e4c9)
  • Optimize pure Python parse path for custom JSON enum names. (9d98477)
  • [Py/C++] Fixed data race in Python free threading by removing obsolete hack (1a23830)
  • Protocol buffers support being created from memoryviews. (b43ac42)
  • Fix messageset conformance for pure Python to match Py-C++ and Py-upb (02a9c9d)
  • Extract Python naming helper functions into a separate names library. (b2e1843)
  • Fix(python): reject mismatched CopyToProto targets (#28666) (b5d2e8d)
  • Fix potential Py_DECREF(NULL) crash in PythonMessageMutator destructor. (44fa35f)
  • Sync sub-objects in PyUpb_Message_MergeFromString even when decode fails. (414e414)

PHP

  • Validate nanos range and DateTime creation in PHP Timestamp::toDateTime() (9f37106)
  • Validate php_class_prefix and objc_class_prefix in code generators (#29130) (1e1a0a8)
  • Remove total_bytes_limit from pure PHP CodedInputStream. (ed612a8)

PHP C-Extension

  • Validate nanos range and DateTime creation in PHP Timestamp::toDateTime() (9f37106)
  • See also UPB changes below, which may affect PHP C-Extension.

Ruby

  • Ruby: Add emit_defaults option to Message#to_h (#29761) (378560d)
  • Ruby: fix use-after-free of map keys aliasing a temporary String (#29026) (7d7d6ab)

Ruby C-Extension

  • Ruby: Add emit_defaults option to Message#to_h (#29761) (378560d)
  • Fix google-protobuf gem source build on the mswin platform (#28433) (dce0d24)
  • Ruby: fix use-after-free of map keys aliasing a temporary String (#29026) (7d7d6ab)
  • See also UPB changes below, which may affect Ruby C-Extension.

UPB (Python/PHP/Ruby C-Extension)

  • Fix conflicting types for _upb_Message_NextBaseField on 32-bit targets (3e575b2)
  • Optimize upb_Arena memory allocation with inlined block pool. (0c17ea9)
  • Include .c files in the source_files glob in upb/port/BUILD (0f685d6)
  • Fix macro order in alloc.h and check upb_DefPool_AddFile return value in lua/def.c (9990e50)
  • Fix: UPB JSON encoding for FieldMask (30f89bf)
  • Check sub array bounds before indexing in upb_MiniTable_Link (#28553) (085b305)
  • Fix: [upb] roll back extensions after failed file addition (#28900) (9c66da8)
  • Upb/message/compare: Add support for partial equality comparisons (22677ce)
  • Fix the behavior of GetOrCreateMutableMessage on fields in oneofs (ad1064c)

Other

  • Upgrade Abseil dependency to 20250814.1. (f0b5daf)
  • Only applying Xcode version config in to our CI and update protobuf repository to use the newest version (v7) of protobuf-ci with this change (eaa37fa)
  • Add JSON conformance tests for non-ASCII Unicode digits in quoted numeric fields. (e5f5e1c)
  • Fix Lua call sites for upb nodiscard enablement (7971b31)
  • Add custom option numbers for use by ProtoWire (#28919) (c27007f)
  • Reserve extension numbers 1364-1373 for Flyte (#29013) (8b350fc)
  • Fix Copybara leak for protobuf and add leakr checks. (88d6fd3)
  • Remove csharp from CODEOWNERS assignment (216b587)

Don't miss a new protobuf release

NewReleases is sending notifications on new releases.