Commit graph

23482 commits

Author SHA1 Message Date
rgoldfinger6
4b269eb436 Updating version.json and repo version numbers to: 37.0-dev (#28425)
NOTE: This should be reviewed and imported via Copybara per the normal PR review process.

Closes #28425

PiperOrigin-RevId: 945675238
2026-07-10 06:22:59 -07:00
Ada Zhang
b7c5ce1d3c Support non-canonical extensions in message promotions (upb_Message_GetOrPromoteExtension, upb_MiniTable_PromoteUnknownToMessage, upb_MiniTable_PromoteUnknownToMessageArray, upb_MiniTable_PromoteUnknownToMap).
PiperOrigin-RevId: 945453462
2026-07-09 20:30:06 -07:00
Protobuf Team Bot
2b0b5066bd Expand visibility of alias, needed for grpc update
PiperOrigin-RevId: 945374887
2026-07-09 16:32:31 -07:00
Jason Aragorn Tobias Lunn
604527297c Internal change
PiperOrigin-RevId: 945344501
2026-07-09 15:23:53 -07:00
Protobuf Team Bot
e22cabffa4 Auto-generate files after cl/945282190 2026-07-09 20:35:22 +00:00
Protobuf Team Bot
3692b2bb22 Optimize UPB_CONSTRUCTOR for ELF with COMDAT deduplication
Changes the UPB_CONSTRUCTOR macro for ELF platforms to use COMDAT-grouped assembly for .init_array. This allows the linker to deduplicate the constructor pointer entries to exactly one copy, eliminating binary bloat and preventing the weak constructor from being executed multiple times at startup.

PiperOrigin-RevId: 945282190
2026-07-09 13:27:29 -07:00
Jason Aragorn Tobias Lunn
7875e9179e Enable Edition 2026 for protoc
PiperOrigin-RevId: 944862281
2026-07-08 20:43:19 -07:00
Protobuf Team Bot
1eb5913459 Auto-generate files after cl/944789082 2026-07-09 00:33:26 +00:00
Ada Zhang
e57b518585 Add upb_Message_FindUnknown2 to support messages possibly with non-canonical extensions.
PiperOrigin-RevId: 944789082
2026-07-08 17:23:26 -07:00
Protobuf Team Bot
648080151f Auto-generate files after cl/944782315 2026-07-09 00:17:24 +00:00
Ada Zhang
9fc8c0c4cd 1) Encode unknown varint values as 64-bit varints; also 2) errors out for zero skip value in the minitable decoder.
PiperOrigin-RevId: 944782315
2026-07-08 17:07:23 -07:00
Tony Liao
5977c229a4 Change the Json EnumValue option to be usable in Edition 2026.
PiperOrigin-RevId: 944728814
2026-07-08 15:22:49 -07:00
Samuel Benzaquen
3fce765ed2 Fix layout for repeated primitives/enum to avoid padding caused by the
`CachedSize` members.

PiperOrigin-RevId: 944693721
2026-07-08 14:16:37 -07:00
Protobuf Team Bot
706fc1e3cb Optimize SmallSortedMap to improve getAllFields() efficiency.
PiperOrigin-RevId: 944593820
2026-07-08 11:08:58 -07:00
Protobuf Team Bot
ba087538d2 Auto-generate files after PR #26247 2026-07-08 15:15:24 +00:00
Alex Eagle
8ccb4faa9b chore: add a unit test for .github/release_prep.sh (#26247)
Requested by protobuf team after having a rough time in v34.0 release

Closes #26247

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/26247 from protocolbuffers:test_release_sh c6f620da1d
PiperOrigin-RevId: 944502159
2026-07-08 08:05:06 -07:00
Protobuf Team Bot
342944aa64 Auto-generate files after cl/944424868 2026-07-08 11:48:06 +00:00
Jason Aragorn Tobias Lunn
271ca53b50 Migrate top-level protobuf unittest protos from Edition 2024 to Edition 2026.
* Updates edition to 2026 in the unittest protos.
* Removes the obsolete target compile option `cc_enable_arenas` since C++
  options are moved and arenas are enabled by default.
* Updates `maximum_edition` target constraints to edition 2026 in Java,
  Python, C#, and upb build targets to allow loading and validation of
  Edition 2026 files.
* Regenerates internal_options_bootstrap compiler files.

PiperOrigin-RevId: 944424868
2026-07-08 04:38:22 -07:00
Mark Hansen
5759717273 Automated rollback of commit 42b411e7c9.
PiperOrigin-RevId: 944198382
2026-07-07 18:19:12 -07:00
Protobuf Team Bot
42b411e7c9 Optimize Java Lite Parser Registry with Centralized Cache
Avoid generating double-checked locking inside every generated message class's
dynamicMethod(GET_PARSER) by centralizing the parser instantiation and caching
in a thread-safe map inside GeneratedMessageLite.

This saves substantial DEX and ODEX size for apps with many protobuf classes.

Note: This change requires the generated code to run against a runtime of at
least the same version. Mixing new generated code with an older runtime version
is not supported (see https://protobuf.dev/support/cross-version-runtime-guarantee/).
PiperOrigin-RevId: 944139195
2026-07-07 15:57:19 -07:00
Rachel Goldfinger
d5e039a302 Make Timestamps.parse() attempt non-lenient parsing first and warning if this fails.
PiperOrigin-RevId: 944126931
2026-07-07 15:34:12 -07:00
Protobuf Team Bot
5e24bccb66 Auto-generate files after cl/944116273 2026-07-07 22:24:32 +00:00
Jason Aragorn Tobias Lunn
636ae747e6 Update our compiled_edition_default's maximum_edition to 2026
PiperOrigin-RevId: 944116273
2026-07-07 15:13:49 -07:00
Charlie Beattie
4f5350ef98 Internal change.
PiperOrigin-RevId: 943935338
2026-07-07 09:27:46 -07:00
Protobuf Team Bot
35b5692ddd Optimize C++ TextFormat printing by avoiding absl::CEscape allocation for clean strings.
PiperOrigin-RevId: 943902079
2026-07-07 08:17:07 -07:00
Protobuf Team Bot
f98ab0592f Set JRuby dev flag on conformance tests to reduce 30s timeouts
PiperOrigin-RevId: 943900327
2026-07-07 08:15:50 -07:00
Jason Aragorn Tobias Lunn
7008dd1aa7 Drop support for Ruby 3.1
PiperOrigin-RevId: 943899182
2026-07-07 08:11:48 -07:00
Samuel Benzaquen
743bf169bb Simplify offset tagging in the reflection code.
Move all the tags to the high bits. This avoids alignment issues and we can
unconditionally mask all the tags in one go. Previously we would have to know
the type of the field to see if we could mask the low bit tags.

We can now remove both the template type and the runtime type input parameters.

PiperOrigin-RevId: 943899071
2026-07-07 08:07:28 -07:00
Protobuf Team Bot
27a0b8b687 Automated Code Change
PiperOrigin-RevId: 943864493
2026-07-07 06:47:10 -07:00
Jason Aragorn Tobias Lunn
b70d2497e2 Add test for RepeatedField concatenation and arena lifetime.
PiperOrigin-RevId: 943843380
2026-07-07 05:59:28 -07:00
Protobuf Team Bot
b846555308 Add aliases for reflection and reflection_internal in preparation for c/cc split
PiperOrigin-RevId: 943842807
2026-07-07 05:55:49 -07:00
Runze Wang
11c34350bb Format descriptor_pool.cc to eliminate pre-existing lint issues.
PiperOrigin-RevId: 943655751
2026-07-06 21:38:41 -07:00
Adam Cozzette
06e205948b Fail loudly if we try to use a prebuilt protoc with unreleased code (#28167)
Currently if you build with `--incompatible_enable_proto_toolchain_resolution`
(on by default in Bazel 9) on main or any recent Git commit, you end up using
an old v33.0 prebuilt protoc binary. The `authenticity_validation` rule does
not catch this, because it just checks that the `RELEASE_VERSION` prebuilt we
downloaded has version `RELEASE_VERSION`. This constant is never updated in
Git, only in releases published to BCR. As a result, we get mysterious compiler
errors rather than a clear error about what is going wrong.

This commit fixes the problem by keeping `RELEASE_VERSION` up to date with the
existing `PROTOC_VERSION`. This will cause the build to fail loudly if you try
to use a prebuilt protoc binary with a protobuf Git checkout. To make sure that
developers do not hit this issue, I updated .bazelrc to explicitly turn off use
of the prebuilt protoc.

I also removed `examples/example_without_cc_toolchain/`, because I don't think
this test is doing anything useful anymore. It attempts to exercise the
prebuilt protoc, but that is something we do not expect to work correctly with
unreleased protobuf code, and with my change it would result in a build error.

Closes #28167

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/28167 from protocolbuffers:prebuilt d7c67c9ce7
PiperOrigin-RevId: 943511369
2026-07-06 15:01:10 -07:00
Protobuf Team Bot
f25fb36bfe Correct add_descriptor_set size from an int to a size_t
Closes potential bug as reported externally by mhmadqw909-cloud if an encoded descriptor >2GB was reached.

PiperOrigin-RevId: 943444689
2026-07-06 12:50:58 -07:00
Rachel Goldfinger
a8d0be3d42 Add deprecation warning for internal_py_proto_library prior to Q1 2027 breaking changes.
PiperOrigin-RevId: 943389220
2026-07-06 11:09:17 -07:00
Samuel Benzaquen
0e069eb706 Enable message globals.
In this mode we collocate the default instance, the ClassData and the parse
table in a single structure. This allows for better memory locality, but also
reduces pointer crosslinking, making the merged data structure smaller than its
parts.

For now, we only turn on in ASan builds to give it some more coverage.

PiperOrigin-RevId: 943327512
2026-07-06 09:16:24 -07:00
Rachel Goldfinger
ab69831380 Add a warning for potential OneofDescriptor collisions prior to Q1 2027 breaking changes.
PiperOrigin-RevId: 943277587
2026-07-06 07:37:05 -07:00
Protobuf Team Bot
65a15e586d Auto-generate files after cl/943010563 2026-07-06 03:02:36 +00:00
Ada Zhang
f1b00c3245 Add new upb_Message_NextUnknown2 and upb_Message_DeleteUnknown2 functions to support non-canonical extensions in unknown field iteration/deletion.
PiperOrigin-RevId: 943010563
2026-07-05 19:52:56 -07:00
Protobuf Team Bot
9597fa9e5a Automated Code Change
PiperOrigin-RevId: 942890101
2026-07-05 11:56:22 -07:00
Mitchell Allain
3aa022a269 Configure extra compile args in setup.py (#28264)
Fixes https://github.com/protocolbuffers/protobuf/issues/28261 by setting symbol visibility in `setup.py`, similar to `py_extension.bzl`, using the existing branching logic to bypass the flag on MSVC.

This issue manifests in the [NixOS/nixpkgs](https://github.com/NixOS/nixpkgs) build of the `protobuf` python package, which contains upb symbols, and causes fatal failures when loaded in a process that separately links/loads libprotobuf. We'll supply a patch there as well, until this can be backported or released in future protobuf versions.

Closes #28264

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/28264 from mitchallain:mallain/fix-python-upb-symbols 6e118a62bf
PiperOrigin-RevId: 942223178
2026-07-03 12:47:05 -07:00
Protobuf Team Bot
e1b94ce8f9 Optimize MapEntry allocations during map serialization
PiperOrigin-RevId: 941708409
2026-07-02 08:16:13 -07:00
Hana Joo
ebedfb958e Automated Code Change
PiperOrigin-RevId: 941625858
2026-07-02 04:39:38 -07:00
Tobias Werth
412b61745a Automated Code Change
PiperOrigin-RevId: 941551630
2026-07-02 01:48:16 -07:00
Tobias Werth
3907d14b7d Automated Code Change
PiperOrigin-RevId: 941537305
2026-07-02 01:08:39 -07:00
Protobuf Team Bot
eaa8c8cca5 Automated Code Change
PiperOrigin-RevId: 941496740
2026-07-01 23:28:07 -07:00
Karen Wu
45f6d9c513 This change moves several tests from JavaProtoLibraryTest.java to Starlark-based analysis tests in java_proto_library_tests
PiperOrigin-RevId: 941318755
2026-07-01 15:13:19 -07:00
Samuel Benzaquen
91a50d5e0c Fix memoization key collision for function pointers.
PiperOrigin-RevId: 941306300
2026-07-01 14:49:17 -07:00
Protobuf Team Bot
050bd07378 Auto-generate files after cl/941296469 2026-07-01 21:39:42 +00:00
Protobuf Team Bot
c4e07ae402 Harden against size_t overflow in upb json decode
PiperOrigin-RevId: 941296469
2026-07-01 14:29:54 -07:00