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

Templates in Docs & Quick Start both Provide an Incomplete cbindgen.toml #858

Open
Sewer56 opened this issue Jul 21, 2023 · 1 comment
Open

Comments

@Sewer56
Copy link

Sewer56 commented Jul 21, 2023

The template.toml provided in the root of the repository and linked from Quick Start is incomplete, and lacks:

  • export.pre_body
  • [layout] (packed & aligned)
  • swift_name_macro
  • derive_tagged_enum_copy_assignment
  • [ptr]
  • [cython]

While the template in docs.md lacks:

  • line_endings

While I'm not exactly sure which are live in the current released build, I do know that at the very least the layout fields, i.e. layout.packed & layout.aligned have been available for years, but not available in the template.


To give a user story.

In my case, as someone who is new to Rust, this caused confusion. Porting my GPL libraries I've spent a long time trying to figure out how to correctly create a header for a type which was #[repr(C, packed)] as the docs mentioned #[repr(packed)] us supported, but I could not get it to work.

I've only noticed after a pretty long troubleshooting session the feature was working correctly, just that the default value for packed wasn't in the quick start template and thus output as '' (empty string).


In any case; if needed I'm happy to make a PR that would bring the two configurations to parity, including their much more detailed descriptions in docs.md. It's just a matter of finding out which should be included (are currently live in released builds), and whether you'd prefer for the documentation [field descriptions] to be transferred over aswell.

Thanks.

@BKSalman
Copy link

BKSalman commented Mar 18, 2024

I also had to read the code to figure out how this features works, would be really helpful for other people to have it in the docs.

Edit:
I just noticed it was in the docs, but not very clear, so nvm :p

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

2 participants