Skip to content

Conversation

@beingbrijesh
Copy link

@beingbrijesh beingbrijesh commented Nov 7, 2025

"Fixes #8762 ": Use ConCatPathFileName(options_.output_path, path) and EnsureDirExists(full_dir) so generators create namespace directories under the provided -o path.

Also: added goldens/schema/namespace_first.fbs, updated Lua goldens, added tests/test_bfbs_namespace_output.py (Lua + Nim tests), and integrated the Python test into CMake.

Testing: built flatc, ran CTest; both new tests passed locally.

@github-actions github-actions bot added c++ codegen Involving generating code from schema lua nim python swift labels Nov 7, 2025
@beingbrijesh beingbrijesh marked this pull request as ready for review November 7, 2025 14:59
@beingbrijesh beingbrijesh force-pushed the pr/fix-bfbs-namespace-output branch from 7b8b8f7 to 3c33db7 Compare November 7, 2025 15:09
@beingbrijesh beingbrijesh force-pushed the pr/fix-bfbs-namespace-output branch from 3c33db7 to 8edf3bd Compare November 7, 2025 15:12
@beingbrijesh
Copy link
Author

beingbrijesh commented Nov 8, 2025

@cosmith-nvidia @dbaileychess @aardappel can you please review my fixes for the issue #8762

@jtdavis777
Copy link
Collaborator

@beingbrijesh just a friendly note - if you update your description with "fixes #8762" it will link this PR and that issue :)

@beingbrijesh
Copy link
Author

@beingbrijesh just a friendly note - if you update your description with "fixes #8762" it will link this PR and that issue :)

@thejtshow thank you for your feedback, I have updated the description :)

Copy link
Collaborator

@jtdavis777 jtdavis777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked over the lua changes and test strapping, and it all looks good to me, though I'm no expert and I am not sure what the etiquette is around the goldens folder :)

I'm also not sure if the cmake based unit tests are executed as part of the CI -- that should probably be confirmed before merging. It seems like most tests are ran from dedicated shell scripts.

std::replace(path.begin(), path.end(), '.', '/');
}

// TODO(derekbailey): figure out a save file without depending on util.h
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the old TODO which was here is still relevant

@@ -0,0 +1,8 @@
# Test that bfbs generators handle namespace-first schemas correctly
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this change since it integrates with IDEs better. Would you be able to add tests/py_test.py here as well?

@aardappel
Copy link
Collaborator

This is not the way to do it, the goldens dir is for a specific purpose and we should not add new schemas there that are only generated for 2 languages.

It also generates new files (for Nim) without renaming the old ones.

Generally, if something can be tested with the existing files in tests that is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ codegen Involving generating code from schema lua nim python swift

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-o option conflicts with namespace when generating lua code.

3 participants