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

Information discarded by bindgen which we need (tracker bug) #124

Open
8 tasks
adetaylor opened this issue Nov 24, 2020 · 6 comments
Open
8 tasks

Information discarded by bindgen which we need (tracker bug) #124

adetaylor opened this issue Nov 24, 2020 · 6 comments

Comments

@adetaylor
Copy link
Collaborator

adetaylor commented Nov 24, 2020

bindgen doesn't pass on quite all the information we need in order to be able to generate autocxx bindings. Options in the future might be to fork bindgen, ask very nicely if they mind us upstreaming patches to add metadata, or switch away from bindgen and use llvm directly.

In any case this bug will be a live tracker of all known cases where we don't have all the information that we require about the underlying C++.

@martinboehme
Copy link
Collaborator

  • Classes vs structs. Both present as structs in the bindgen output. When we then generate extra C++ we have to plump for one or the other. In some ABIs this will result in a binary incompatibility or failure to compile.

Not sure I understand -- I always thought a struct was exactly identical to a class, just that it has public visibility by default? And I believe it's legal for forward declarations of a struct to use class and vice versa (see this StackOverflow answer). I'm pretty sure there isn't an ABI difference either. Or am I misunderstanding what you're referring to here?

@adetaylor
Copy link
Collaborator Author

This is #54 - let's discuss over there.

@martinboehme
Copy link
Collaborator

Thanks for the clarification -- interesting!

@adetaylor
Copy link
Collaborator Author

For #414 and #102 many types have 'annotations' attached (the RustTy type in our fork of bindgen). Such annotations are currently discarded using an ignore_annotations method. Each time that happens, it's probably a bug. For example this means we would try (and fail) to generate POD struct fields using types with template parameters which bindgen has dropped. Once a plan presents itself here, we should ensure we never drop information like this.

@martinboehme
Copy link
Collaborator

Note from #426: The Rust function signature for copy constructors and move constructors is the same, so bindgen needs to add an annotation that allows us to distinguish between them.

@bsilver8192
Copy link
Contributor

#799 is also on this list, and I'm pretty sure #815 is too.

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

3 participants