flatbuffers
flatbuffers copied to clipboard
grpc/compiler: Respect filename suffix and extension during code generation
grpc compiler is not respecting filename suffix and extension passed to flatc CLI. This causes compiler to spit out incorrect code, which then cannot be compiled without modification.
Following patch fixes the problem.
Signed-off-by: Aman Priyadarshi [email protected]
Looks OK to me, can we add a test to show that it is working?
mmhm, I had a second look at the code just now, while adding tests.
Turns out, this entire generation code is a mess, with things all over the place.
For example, we have generator suffix is defined in two places cpp_generator.cc and idle_gen_grpc.cpp.
While the former definition is still "okay", but the later doesn't makes sense to be defined in the base class (".h" is not a valid extension for other languages).
My changes does the right thing of keeping language specific stuff in *lang*_generator.cc
file.
@dbaileychess I've made some additional changes compared to the last revision, and added tests too.
Please rebase and run scripts/generate_code.py
and reupload. You were missed checking in some generated files.
@dbaileychess Not really. Build failed because commit b7f13cd8 ("cpp_generator: comment out unused parameter to avoid warnings (#7381)")
was merged to master before my PR :)
Anyway, I'll rebase my branch against master and raise a new PR.