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. 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 } };