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

[kotlin-kmp] Enums only files skipped when multiple schemas are used as input #8218

Open
DadiBit opened this issue Jan 17, 2024 · 1 comment

Comments

@DadiBit
Copy link

DadiBit commented Jan 17, 2024

  • Language: kotlin-kmp (kotlin/jvm & swift do not face this issue, probably just a kmp thing)
  • Compiler: gcc 13.2
  • OS: Ubuntu 23.10
  • Flatc: master, commit 129ef42]

I have multiple fbs source files. Some of these have tables, some others have enums, which are included and used in those tables.
When I run flatc --kotlin-kmp schema/*.fbs I see that MyEnum.kt is always "empty": the file doesn't have any enum, just the "head":

// automatically generated by the FlatBuffers compiler, do not modify

package com.openmeteo.flatbuffers.forecast

import com.google.flatbuffers.kotlin.*
import kotlin.jvm.JvmInline

But (!), when I run flatc --kotlin-kmp schema/model.fbs everything is fixed.

"Actually, you could just run a loop as workaround" - strangely, looping over each single file doesn't fix the issue: I suspect there's some async/caching stuff not getting properly set/cleaned-up, or at the very least something time-related.

Can anyone else replicate the issue with the latest repo source code?

If needed, I can share my fbs files.

My finds so far:

Kind regards 😄

@DadiBit
Copy link
Author

DadiBit commented Jan 17, 2024

Found a workaround:
Comment out the if (enum_def.generated) return; check at L383:

void GenEnum(EnumDef &enum_def, CodeWriter &writer) const {
if (enum_def.generated) return;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant