Skip to content
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

BFBS: Distinguish Input FBS Files from Includes #8053

Closed
jamescourtney opened this issue Aug 2, 2023 · 2 comments
Closed

BFBS: Distinguish Input FBS Files from Includes #8053

jamescourtney opened this issue Aug 2, 2023 · 2 comments
Labels

Comments

@jamescourtney
Copy link
Contributor

I use reflection.fbs as the basis for an independent FlatBuffer implementation. This is nice because it allows flatc to be the IDL parser so I don't need to worry about grammar / parsing rules.

The fundamental issue I'm having is that the SchemaFiles vector in BFBS output doesn't allow me to distinguish between these two cases:

  • File was directly passed to flatc as an input
  • File was discovered while processing include directives, but wasn't explicitly passed in

This affects me for the following case:

  • User has a common set of FBS schemas that are shared between multiple libraries in their project. They want to generate these type definitions once in the common library so that the types are universal across their project.

  • User has another library with a specialized set of FBS schemas that include the common set. The user doesn't want to regenerate the common set of schemas here because those have already been generated by the common location, so doing so again would lead to compiler errors due to type name conflicts.

This seems almost possible today. However, when parsing the specialized FBS files list, everything is thrown together in the SchemaFiles list without indication as to which were include-only (for lack of a better word).

So, what I'd like is the ability to distinguish between the two cases so my tool will know how to generate files for situations such as this. For now, there is a workaround by just lumping everything into one "FBS schemas" project. The simplest form of this is likely just adding a bool to the SchemaFile table that indicates if it was an explicit input or not.

Thanks!

Copy link

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

@github-actions github-actions bot added the stale label Jan 31, 2024
Copy link

This issue was automatically closed due to no activity for 6 months plus the 14 day notice period.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant