Skip to content

Support building with Protobuf v34+#3241

Open
cho-m wants to merge 1 commit intoapache:masterfrom
cho-m:protobuf-34
Open

Support building with Protobuf v34+#3241
cho-m wants to merge 1 commit intoapache:masterfrom
cho-m:protobuf-34

Conversation

@cho-m
Copy link

@cho-m cho-m commented Mar 10, 2026

What problem does this PR solve?

Issue Number: n/a

Problem Summary: Support building with Protobuf v34+ (C++ 7.34.0) which introduced breaking API changes.

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects:

  • Breaking backward compatibility: no


Check List:

This handles removal of FieldDescriptor::is_optional()[^1] and ClassData
removal of on_demand_register_arena_dtor[^2]

[^1]: protocolbuffers/protobuf@9dbc5d4
[^2]: protocolbuffers/protobuf@49e15fe
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates bRPC’s Protobuf integration points to compile with Protobuf v34+ (C++ 7.34.0), addressing upstream breaking API changes.

Changes:

  • Replace removed FieldDescriptor::is_optional() usage with equivalent logic based on is_required() / is_repeated().
  • Add a new GOOGLE_PROTOBUF_VERSION >= 7034000 conditional initialization path for NonreflectableMessage class metadata to account for removed on_demand_register_arena_dtor.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/mcpack2pb/generator.cpp Updates optional/required labeling logic to avoid removed is_optional() API.
src/json2pb/json_to_pb.cpp Updates optional-field detection to avoid removed is_optional() API.
src/brpc/nonreflectable_message.h Adds Protobuf 7.34+ ClassData initialization variant to match upstream internal layout changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wwbmmm
Copy link
Contributor

wwbmmm commented Mar 11, 2026

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants