-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Flatc converts enums within proto messages to wrong namespace in fbs [all languages, FlatBuffers 1.12, 2.0] #7109
Comments
Thanks for the report. Could you stripe down the proto to a bare minimum example and also post the command line arguments you are using? I can take a look. |
Can you look at #7121, I tried to recreate the issue you are seeing and it seems to be generating it correctly. Maybe there is some other tidbit that is different. |
Thank you for your reply. I did a little more testing and it seems that the order of defining the enums and defining the messages using the enums plays a role.
As a command to convert the proto file to fbs I simply use the following command: |
Thanks, I'll take a look. |
Hi @dbaileychess! |
Hey @dbaileychess do you need any more information on this or support? Is there already a plan to integrate a fix in the next release? Could you outline a timeframe for this? |
At an initial glance this bug seems to be the result of how we parse proto files. We can be reproduces this bug if the following criteria are met:
When we perform an enum look up we traverse up the namespace until we find a matching qualified name in the symbol table for defined enums. If our desired enum is defined after the field it won't exists in the symbols table so our look up function will travel up the namespace to find an enum with a similiar name. To fix this issue, off the top of my head I think we can do a two pass on the proto file. On the initial pass we can populate our symbol tables and on the second pass we'll process the proto file like we currently do. Here's another minimal example to reproduce this bug. Example
|
Blocked by #7827 |
This issue is stale because it has been open 6 months with no activity. Please comment or label |
Seems that this is not fixed yet? |
Not fixed yet. I'll take a look at this again. |
This issue is stale because it has been open 6 months with no activity. Please comment or label |
This issue still needs to be fixed. |
This issue is stale because it has been open 6 months with no activity. Please comment or label |
This is still no resolved but needed |
We are trying out Flatbuffers instead of the currently used Protobuf in the ASAM Open Simulation Interface.
We are converting interface definitions from proto files to fbs using flatc. In the proto files we have nested messages with enums of the same name. See the following example from the osi_object.proto:
The namespaces of the enums are correctly set by flatc in the fbs files:
The usage of the enums however is wrong:
The namespaces of the enums "Type" are mixed up.
The text was updated successfully, but these errors were encountered: