google / google/autocxx

Unfork bindgen

Open
#124 8 comments 0 reactions 0 assignees View on GitHub
architectural
Dominant language
Rust
Stars
2.6k
Forks
175
PR merge metrics
No merged PRs in 30d

Description

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++.

- [ ] **Classes vs structs**. Both present as `struct`s 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. Per #54.
- [ ] **Overloaded methods vs methods ending in digits.** Two methods `a(uint32_t)` and `a(uint8_t)` will be output as `a` and `a1`. There is no way for us to distinguish that from methods really called `a` and `a1`. Worse, this is across all the types in a namespace, so `MyStruct::a` and `MyOtherStruct::a` become `MyStruct::a` and `MyOtherStruct::a1`.
- [ ] **Nested types**. A `struct` nested inside another `struct` is not noted in the bindgen output, so we can't generate compatible C++ code - #115.
- [ ] **Private constructors**. Per #122.
- [ ] **Pointers vs references**. Per #102.
- [ ] **Virtual functions**. Per #195 and #305.
- [ ] **When template params are unused**, per #414 and #416.
- [ ] **Deleted functions**, per #426.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing bindgen's output requirements and the linked issues for each missing case: #54, #115, #122, #102, #195, #305, #414, #416, and #426. The issue names no files or tests; done requires resolving the listed metadata gaps or choosing a documented strategy for replacing, forking, or upstreaming bindgen.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.