dep-protobuf/upb
Samuel Benzaquen d94cbe4dfb Change the failure implementation in UPB_UNREACHABLE to a custom function.
This makes the error message better, and it silences misc-static-assert
clang-tidy warnings.

PiperOrigin-RevId: 925461291
2026-06-02 11:00:28 -07:00
..
base upb: Adds a new error code kUpb_ErrorCode_MaxDepthExceeded. 2026-05-29 09:59:31 -07:00
bazel Add Bazel9 test 2026-04-30 10:53:12 -07:00
cmake Added debug printing for MiniTables. 2025-10-24 20:11:37 -07:00
conformance Conformance performance tests for Recursion Limit on map and message_set_extension 2026-04-10 13:42:56 -07:00
hash Fix iteration bug where removing the head of a chain resulted in missing elements 2026-05-07 13:03:19 -07:00
json upb/json: fix sign-extended index in jsondec_base64_tablelookup (#27215) 2026-05-13 14:19:07 -07:00
lex Internal change 2026-03-23 12:46:13 -07:00
mem Backwards allocation for encode. 2026-05-07 17:19:17 -07:00
message upb: Adds a new error code kUpb_ErrorCode_MaxDepthExceeded. 2026-05-29 09:59:31 -07:00
mini_descriptor Fasttable: Fix ODR errors and create dual staleness test. 2026-05-20 10:09:06 -07:00
mini_table Handle unlinked submessages in the fasttable unknowns loop and mismatch handler 2026-05-28 16:15:34 -07:00
port Change the failure implementation in UPB_UNREACHABLE to a custom function. 2026-06-02 11:00:28 -07:00
reflection Remove flag guard on _UPB_FREEZE_OPTIONS function definition 2026-05-28 11:30:41 -07:00
test bazel 9 tests for csharp, hpb, objc, php, python, rust and upb 2026-05-19 19:58:47 -07:00
text Delete array part of inttable, reducing complexity 2026-05-06 17:00:23 -07:00
util Add UPB_NODISCARD in many places, prioritizing ones that use the return value to indicate an error 2026-04-20 14:07:50 -07:00
wire upb: Adds a new error code kUpb_ErrorCode_MaxDepthExceeded. 2026-05-29 09:59:31 -07:00
BUILD Fasttable: Fix ODR errors and create dual staleness test. 2026-05-20 10:09:06 -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.