FRRouting / frr

The FRRouting Protocol Suite

Home Page:https://frrouting.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

frr-10 version grpc compile error

nanfengnan1 opened this issue · comments

Description

frr-10 configure show checking for GRPC (grpc >= 6.0.0 grpc++ >= 1.16.1 protobuf >= 3.6.1 )... yes.
but if you conserve protobuf version, you will find protobuf v3.18 is a huge version.
before: SetTotalBytesLimit function owns two parameters, buf lack of google/protobuf/generated_message_bases.h file.
after: SetTotalBytesLimit function owns one parameters, buf own google/protobuf/generated_message_bases.h file.
however, frr configure with --enable-grpc and make use two protobuf version. it will generate error. neither lack of SetTotalBytesLimit param or lack of google/protobuf/generated_message_bases.h file.
so can't compile frr grpc.

Version

ubuntu20.04
frr-10
probuf v3.12.0 or protobuf v3.18.0, all did't work.

How to reproduce

./configure --prefix=/usr/local/frr -exec-prefix=/usr/local/frr --enable-watchfrr --enable-user=root --enable-group=root --enable-grpc
make -jnproc

Expected behavior

make okay

Actual behavior

probuf v3.18 after
/usr/include/grpcpp/impl/codegen/proto_utils.h: In function 'grpc::Status grpc::GenericDeserialize(grpc::ByteBuffer*, grpc::protobuf::Message*)':
/usr/include/grpcpp/impl/codegen/proto_utils.h:86:48: error: no matching function for call to 'google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int, int)'
86 | decoder.SetTotalBytesLimit(INT_MAX, INT_MAX);
protobuf v3.18.0 before
lack of google/protobuf/generated_message_bases.h

Additional context

i don't know about frr-northbound.proto, but i think it needs to modify. otherwise version will mismach.

Checklist

  • I have searched the open issues for this bug.
  • I have not included sensitive information in this report.

temp method, guest grpc question :
vim /usr/include/grpcpp/impl/codegen/proto_utils.h +86

// BufferReader must be a subclass of ::protobuf::io::ZeroCopyInputStream.
template <class ProtoBufferReader, class T>
Status GenericDeserialize(ByteBuffer* buffer, grpc::protobuf::Message* msg) {
static_assert(std::is_base_of<protobuf::io::ZeroCopyInputStream,
ProtoBufferReader>::value,
"ProtoBufferReader must be a subclass of "
"::protobuf::io::ZeroCopyInputStream");
if (buffer == nullptr) {
return Status(StatusCode::INTERNAL, "No payload");
}
Status result = g_core_codegen_interface->ok();
{
ProtoBufferReader reader(buffer);
if (!reader.status().ok()) {
return reader.status();
}
::grpc::protobuf::io::CodedInputStream decoder(&reader);
// decoder.SetTotalBytesLimit(INT_MAX, INT_MAX);
decoder.SetTotalBytesLimit(INT_MAX);
if (!msg->ParseFromCodedStream(&decoder)) {
result = Status(StatusCode::INTERNAL, msg->InitializationErrorString());
}
if (!decoder.ConsumedEntireMessage()) {
result = Status(StatusCode::INTERNAL, "Did not read entire message");
}
}
buffer->Clear();
return result;
},

this is grpc version qz, but frr configure through configure and didn't show anything for me????

I carefully compare protobuf and grpc, find they ocurrs version diff,i did't know how to resolve it. more high version grpc support two param of the SetTotalBytesLimit function, protobuf higher version lack of one param. it is so interesting!