Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brpc build failed when protobuf update to 3.19.3 #1676

Closed
LilyWangLL opened this issue Jan 19, 2022 · 4 comments
Closed

Brpc build failed when protobuf update to 3.19.3 #1676

LilyWangLL opened this issue Jan 19, 2022 · 4 comments

Comments

@LilyWangLL
Copy link

Describe the bug (描述bug)
Hello, I'm a member of Microsoft VCPKG. When I upgrade protobuf to 3.19.3, brpc build failed with the following error:

/mnt/vcpkg-ci/buildtrees/brpc/src/a1b8d7f990-fb64781158.clean/src/brpc/nshead_service.h:66:19: error: cannot declare field ‘brpc::NsheadClosure::_request’ to be of abstract type ‘brpc::NsheadMessage’
   66 |     NsheadMessage _request;
      |                   ^~~~~~~~
In file included from /mnt/vcpkg-ci/buildtrees/brpc/src/a1b8d7f990-fb64781158.clean/src/brpc/nshead_service.h:23,
                 from /mnt/vcpkg-ci/buildtrees/brpc/src/a1b8d7f990-fb64781158.clean/src/brpc/builtin/connections_service.cpp:28:
/mnt/vcpkg-ci/buildtrees/brpc/src/a1b8d7f990-fb64781158.clean/src/brpc/nshead_message.h:30:7: note:   because the following virtual functions are pure within ‘brpc::NsheadMessage’:
   30 | class NsheadMessage : public ::google::protobuf::Message {
      |       ^~~~~~~~~~~~~
In file included from /mnt/vcpkg-ci/buildtrees/brpc/x64-linux-dbg/brpc/options.pb.h:30,
                 from /mnt/vcpkg-ci/buildtrees/brpc/src/a1b8d7f990-fb64781158.clean/src/brpc/controller.h:31,
                 from /mnt/vcpkg-ci/buildtrees/brpc/src/a1b8d7f990-fb64781158.clean/src/brpc/builtin/connections_service.cpp:24:
/mnt/vcpkg-ci/installed/x64-linux/include/google/protobuf/message.h:251:12: note: 	‘virtual google::protobuf::Message* google::protobuf::Message::New(google::protobuf::Arena*) const’
  251 |   Message* New(Arena* arena) const override = 0;
      |            ^~~
In file included from /mnt/vcpkg-ci/buildtrees/brpc/src/a1b8d7f990-fb64781158.clean/src/brpc/builtin/connections_service.cpp:28:
/mnt/vcpkg-ci/buildtrees/brpc/src/a1b8d7f990-fb64781158.clean/src/brpc/nshead_service.h:67:19: error: cannot declare field ‘brpc::NsheadClosure::_response’ to be of abstract type ‘brpc::NsheadMessage’
   67 |     NsheadMessage _response;
      |                   ^~~~~~~~~

I did some investigation and found the cause of the error is the class Message in protobuf was changed to virtual. The related codes in protobuf: src/google/protobuf/message.h Line 251

  // Construct a new instance on the arena. Ownership is passed to the caller
  // if arena is a nullptr.
  Message* New(Arena* arena) const override = 0;

The original codes:

  // Construct a new instance on the arena. Ownership is passed to the caller
  // if arena is a nullptr. Default implementation allows for API compatibility
  // during the Arena transition.
  Message* New(Arena* arena) const override {
    Message* message = New();
    if (arena != nullptr) {
      arena->Own(message);
    }
    return message;
  }

Could you help confirm and resolve this issue? Thanks in advance.
The related PR on VCPKG: microsoft/vcpkg#21485
The full fail log: install-x64-linux-dbg-out.log

To Reproduce (复现方法)

Expected behavior (期望行为)

Versions (各种版本)
OS: Windows 10
Compiler: Visual Studio 2019
brpc: 0.9.7
protobuf: 3.19.3

Additional context/screenshots (更多上下文/截图)

@wwbmmm
Copy link
Contributor

wwbmmm commented Jan 19, 2022

You can try this PR first: #1657

@LilyWangLL
Copy link
Author

Thanks for your reply. PR #1657 works fine for me. Waiting it merged, I will sync new change to VCPKG.

@lorinlee
Copy link
Contributor

Hi @LilyWangLL , #1679 also solves this problem, and it has been merged, could you try the master branch? Thanks!

@LilyWangLL
Copy link
Author

Thanks for fix this error. I have submited a PR microsoft/vcpkg#22685 to merge #1679 to VCPKG.

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

No branches or pull requests

3 participants