-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading binary schemas to generate code files not supported? #6817
Comments
Its not currently supported but I'd like to make that happen. See #6428 for a roadmap that I'm hoping to push I'd be happy to review a PR though it probably should also be looked over by @aardappel too |
Note: You need to provide the flags you want as |
@CasperN we do support reading binary schemas like this. Yes, that code looks buggy, it is parsing the binary file as text. An even simpler fix may be simply to add While we're at it, I spot another potential bug, the PRs welcome :) |
Thank you both for this feedback. I had also thought at first of just inserting an @aardappel, your proposed changes work as desired for me, I'll prepare a PR. |
This issue is stale because it has been open 6 months with no activity. Please comment or this will be closed in 14 days. |
I'd like to use binary schemas created from schema files for later re-generation of source files. My aim is to store binary data together with the bfbs files to reconstruct not only the data, but also the classes to deal with this data (e.g. in Python). Calling flatc with the bfbs file as argument does not work out of the box.
My test message looks like this:
Then I generate the binary schema with
flatc-orig.exe -b --schema test.fbs
. This works and results in thetest.bfbs
file.Running
flatc.exe -c test.bfbs
results in the following error message:error: d:\consys_ws\cs_flatbuffers\src\test_flatbuffers\test.bfbs(1, 1): error: illegal character: code: 24
I looked at the source code and found the following lines in file
flatc.cpp
, function `FlatCompiler::Compile``:If I change the code to not parse the binary schema (which has already been successfully parsed), the generators work again. Is this change acceptable to create a PR? Or does it possibly affect the flatc compiler for other use cases?
Here are the changes I applied:
The text was updated successfully, but these errors were encountered: