dep-protobuf/upb
Protobuf Team Bot d21931d398 Remove C23 requirement from FastTable.
Provide dummy argument for variadic macro to satisfy pre-C23 requirements.

Remove trailing `;` that duplicates `;` generated by macro expansion.

PiperOrigin-RevId: 967288052
2026-08-19 10:38:05 -07:00
..
base upb: Adds a new error code kUpb_ErrorCode_MaxDepthExceeded. 2026-05-29 09:59:31 -07:00
bazel Automated rollback of commit d46a6ff074. 2026-08-17 20:39:44 -07:00
cmake protobuf: improve staleness test regeneration to reduce confusion 2026-08-11 21:03:35 -07:00
conformance Update conformance tests with updated relaxed duplicate key handling in ProtoJSON 2026-08-02 09:58:52 -07:00
hash Introduce overflow checking functions for add and multiply in upb to replace error-prone manual checks 2026-08-17 17:17:05 -07:00
json Introduce overflow checking functions for add and multiply in upb to replace error-prone manual checks 2026-08-17 17:17:05 -07:00
lex Remove unused upb _upb_NoLocaleStrtod (Google Bug Hunters VRP) (#26377) 2026-06-25 12:23:47 -07:00
mem Don't enforce that the return value of upb_Arena_Fuse is used; this only fails if an initial block is in use, and in that case it's reasonable to assume that the program is managing those lifetimes manually. 2026-07-29 13:39:58 -07:00
message Support converting non-canonical extensions in upb message conversion. 2026-08-18 18:24:53 -07:00
mini_descriptor Introduce overflow checking functions for add and multiply in upb to replace error-prone manual checks 2026-08-17 17:17:05 -07:00
mini_table Automated rollback of commit d46a6ff074. 2026-08-17 20:39:44 -07:00
port Fix UPB_FASTTABLE declaration to avoid errors with recursive C macro expansion. 2026-08-18 15:17:19 -07:00
reflection Introduce overflow checking functions for add and multiply in upb to replace error-prone manual checks 2026-08-17 17:17:05 -07:00
test upb/message/compare: Add support for partial equality comparisons 2026-08-12 08:53:40 -07:00
text Delete array part of inttable, reducing complexity 2026-05-06 17:00:23 -07:00
util fix missed oom handling in unset required 2026-07-30 10:42:17 -07:00
wire Remove C23 requirement from FastTable. 2026-08-19 10:38:05 -07:00
BUILD Fix fasttable support in Kotlin UPB. 2026-08-18 14:48:59 -07:00
generated_code_support.h Automated rollback of commit efacad9581. 2025-11-18 15:24:59 -08:00
README.md Fixed broken link in upb README.md (#16717) 2024-05-14 08:34:33 -07:00

μpb: small, fast C protos

μpb (often written 'upb') is a small protobuf implementation written in C.

upb is the core runtime for protobuf languages extensions in Ruby, PHP, and Python.

While upb offers a C API, the C API & ABI are not stable. For this reason, upb is not generally offered as a C library for direct consumption, and there are no releases.

Features

upb has comparable speed to protobuf C++, but is an order of magnitude smaller in code size.

Like the main protobuf implementation in C++, it supports:

  • a generated API (in C)
  • reflection
  • binary & JSON wire formats
  • text format serialization
  • all standard features of protobufs (oneofs, maps, unknown fields, extensions, etc.)
  • full conformance with the protobuf conformance tests

upb also supports some features that C++ does not:

  • optional reflection: generated messages are agnostic to whether reflection will be linked in or not.
  • no global state: no pre-main registration or other global state.
  • fast reflection-based parsing: messages loaded at runtime parse just as fast as compiled-in messages.

However there are a few features it does not support:

  • text format parsing
  • deep descriptor verification: upb's descriptor validation is not as exhaustive as protoc.

Install

For Ruby, use RubyGems:

$ gem install google-protobuf

For PHP, use PECL:

$ sudo pecl install protobuf

For Python, use PyPI:

$ sudo pip install protobuf

Alternatively, you can build and install upb using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install upb

The upb port in vcpkg is kept up to date by microsoft team members and community contributors.

If the version is out of date, please create an issue or pull request on the vcpkg repository.

Contributing

Please see CONTRIBUTING.md.