From c22985f8009c994e902dfbbee3cc402b15d55aab Mon Sep 17 00:00:00 2001 From: Wang Xiaofeng Date: Sun, 9 Aug 2026 00:12:57 +0800 Subject: [PATCH 1/2] Support Protobuf v35 --- src/brpc/nonreflectable_message.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/brpc/nonreflectable_message.h b/src/brpc/nonreflectable_message.h index 089b23957d..fab6301249 100644 --- a/src/brpc/nonreflectable_message.h +++ b/src/brpc/nonreflectable_message.h @@ -288,8 +288,13 @@ class NonreflectableMessage : public ::google::protobuf::Message { # endif ) { // Only can be used to determine whether the Types are the same. - descriptor = default_instance().GetMetadata().descriptor; - reflection = default_instance().GetMetadata().reflection; +# if GOOGLE_PROTOBUF_VERSION >= 7035000 + set_descriptor(NonreflectableMessage::default_instance().GetMetadata().descriptor); + set_reflection(NonreflectableMessage::default_instance().GetMetadata().reflection); +# else + descriptor = NonreflectableMessage::default_instance().GetMetadata().descriptor; + reflection = NonreflectableMessage::default_instance().GetMetadata().reflection; +# endif } }; From 196f087164da64788ef4593f4570ce796b6f997a Mon Sep 17 00:00:00 2001 From: Wang Xiaofeng Date: Sun, 9 Aug 2026 16:28:05 +0800 Subject: [PATCH 2/2] Add CI for Protobuf v35 --- .github/workflows/ci-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index b3462d227e..1bc4a5729d 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -278,7 +278,7 @@ jobs: clang-unittest-bazel-with-babylon-and-new-pb: runs-on: ubuntu-22.04 env: - TEST_PROTOBUF_VERSION: "34.1" + TEST_PROTOBUF_VERSION: "35.1" # protobuf >= 34.x uses new ProtoInfo fields (option_deps, extension_declarations) # introduced in Bazel 8.x. The repo's .bazelversion (7.2.1) is too old. bazelisk # honors USE_BAZEL_VERSION.