Flatbuffers: Compile fails against gRPC v1.17.2

Created on 21 Dec 2018  路  9Comments  路  Source: google/flatbuffers

I'm getting the following error:

|| In file included from /usr/local/include/grpc++/impl/codegen/method_handler_impl.h:26:
/usr/local/Cellar/grpc/1.17.2/include/grpcpp/impl/codegen/method_handler_impl.h|95 col 61| error: cannot initialize a parameter of type 'grpc_byte_buffer *' with an rvalue of type 'grpc::ByteBuffer *'
||     *status = SerializationTraits<RequestType>::Deserialize(&buf, request);
||                                                             ^~~~
/usr/local/Cellar/grpc/1.17.2/include/grpcpp/impl/codegen/method_handler_impl.h|55 col 3| note: in instantiation of member function 'grpc::internal::RpcMethodHandler<XXXX::Service, flatbuffers::grpc::Message<XXX>, flatbuffers::grpc::Message<XXX> >::Deserialize' requested here
||   RpcMethodHandler(std::function<Status(ServiceType*, ServerContext*,
||   ^
dependencies/flatbuffers/include/flatbuffers/grpc.h|264 col 53| note: passing argument to parameter 'buffer' here
||   static grpc::Status Deserialize(grpc_byte_buffer *buffer,
||                                                     ^

Looks like something that broke with this commit.

stale

Most helpful comment

I will write the doc to add the APIs in gRPC soon.

All 9 comments

Yes, sadly we have a fork of some of the gRPC code (in grpc/src/compiler), so this occasionally happens. If you could help by updating those files to the latest gRPC and submitting a PR for it, that be very welcome.

I just submitted a PR, can you please take a look? Thanks.

https://github.com/google/flatbuffers/pull/5100

Hi, @aardappel @henrywoo @vjpai

I have the same error with Visual Studio 2017:

'grpc::Status grpc::SerializationTraits<RequestType,void>::Deserialize(grpc_byte_buffer *,flatbuffers::grpc::Message<ManyHellosRequest> *)': cannot convert argument 1 from 'grpc::ByteBuffer *' to 'grpc_byte_buffer *'    greeter_client  C:\Portable\vcpkg\installed\x64-windows\include\grpcpp\impl\codegen\method_handler_impl.h   200

What's the status of this issue? Do I understand correctly, that this is in fact a blocker against using FlatBuffers with grpc, or is there a workaround?

Yes. You can apply my change in your private branch and it should work. Now it indeed is a blocker for using Flatbuffer in gRPC.

I will write the doc to add the APIs in gRPC soon.

This issue has been automatically marked as stale because it has not had activity for 1 year. It will be automatically closed if no further activity occurs. To keep it open, simply post a new comment. Maintainers will re-open on new activity. Thank you for your contributions.

ping

This issue is stale because it has been open 6 months with no activity. Please comment or this will be closed in 14 days.

Was this page helpful?
0 / 5 - 0 ratings