Open JaydenFish opened 1 month ago
I tried to reproduce this and build tags/v24.3.25
.
and your example works fine for me.
$ cat include/fbs/greeter.fbs
namespace models;
table HelloReply {
message:string;
}
table HelloRequest {
name:string;
}
table ManyHellosRequest {
name:string;
num_greetings:int;
}
rpc_service Greeter {
SayHello(HelloRequest):HelloReply;
SayManyHellos(ManyHellosRequest):HelloReply (streaming: "server");
}
$ ../flatc -c -p -o api/ include/fbs/greeter.fbs
$ ls
api include
I tried to reproduce this and build
tags/v24.3.25
. and your example works fine for me.$ cat include/fbs/greeter.fbs namespace models; table HelloReply { message:string; } table HelloRequest { name:string; } table ManyHellosRequest { name:string; num_greetings:int; } rpc_service Greeter { SayHello(HelloRequest):HelloReply; SayManyHellos(ManyHellosRequest):HelloReply (streaming: "server"); } $ ../flatc -c -p -o api/ include/fbs/greeter.fbs $ ls api include
This is not with grpc.
Looks like flatbuffer+grpc doesn't support python. I fallback to probobuf.
Ahh you didn't add --grpc
in your initial bug report
but yeah with this flag i can reproduce it :+1:
Looks like flatbuffer+grpc doesn't support python.
I don't think that is true we use flatbuffer with grpc at work :sweat_smile:
I think it's just broken in a recent version if it wouldn't be supported the error message is more along the lines of GRPC interface generator not implemented for
@JaydenFish
Hey, thanks for opening this issue. I think there is a known issue with python with directories which can be found here: https://github.com/google/flatbuffers/pull/8074
However following your own example:
Using the following flag flatc -c -p --grpc api/include/fbs/m.fbs
. I removed the -o
flag since its the cause of the issue to begin with, and the spacing between api/ include
.
Thanks!
Sometimes it go wrong. Sometime it works correctly. It's weird.
I have a Makefile about fbs:
%.grpc.fb.h: %.fbs
flatc -c --grpc -o $(dir $*) $^
flatc -p --grpc -o api $^
prename 's/\.cc$//.cpp/' $(dir $*)*.cc
And this is weird. The command specify write output to pyapi
and generated
, but it generate helloworld_grpc_fb.py
in current dir.
Do I have to use protobuf with grpc? flatc version 24.3.25 with a simple fbs:
and run
flatc -c -p --grpc -o api/ include/fbs/greeter.fbs
output is