frr icon indicating copy to clipboard operation
frr copied to clipboard

frr-10 version grpc compile error

Open nanfengnan1 opened this issue 1 year ago • 3 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

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

nanfengnan1 avatar Jun 13 '24 09:06 nanfengnan1

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

nanfengnan1 avatar Jun 13 '24 12:06 nanfengnan1

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

nanfengnan1 avatar Jun 13 '24 13:06 nanfengnan1

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!

nanfengnan1 avatar Jun 13 '24 13:06 nanfengnan1

This issue is stale because it has been open 180 days with no activity. Comment or remove the autoclose label in order to avoid having this issue closed.

github-actions[bot] avatar Dec 16 '24 02:12 github-actions[bot]

This issue will be automatically closed in the specified period unless there is further activity.

frrbot[bot] avatar Dec 16 '24 02:12 frrbot[bot]