google/crubit — A bidirectional bindings generator for C++ and Rust.
Description and use
**Brief Summary**
google/crubit is an open‑source tool that automatically generates bidirectional bindings between C++ and Rust, letting developers call C++ code from Rust and vice‑versa without writing the glue code by hand. With over a thousand stars and recent activity, it can speed up cross‑language prototyping, especially in teams that already use both languages.
**Value**
- **Time‑saving**: Generates the boilerplate for FFI, reducing manual
extern "C"declarations,#[repr(C)]structs, and build‑system tweaks. - **Consistency**: Guarantees that the generated signatures stay in sync with the source APIs, lowering the risk of mismatched types or calling‑convention bugs.
- **Bidirectional**: Supports both “Rust‑calls‑C++” and “C++‑calls‑Rust” scenarios, which is rare among FFI generators.
**Practical Adoption Path**
- **Prototype** – Clone the repo, run the provided
crubitCLI on a small C++ library, and verify the generated Rust bindings compile. - **Code Review** – Manually inspect the generated code for safety‑critical sections (e.g., ownership semantics,
unsafeblocks) and adjust annotations as needed. - **CI Integration** – Add the
crubitstep to your build pipeline (e.g., as acargoorbazelrule) so bindings are regenerated on every change. - **Dependency Check** – Ensure the required toolchain (LLVM/Clang, Rust 1.70+, and any optional
bazelrules) is available and that the generated code does not introduce unwanted transitive dependencies.
**Production Readiness**
- **Maturity**: Medium. The project is actively maintained (last commit 2026‑05‑11) and has a healthy star/fork count, but integration signals are sparse and no formal LTS release exists.
- **Suitability**: Good for internal tools, prototypes, or services where you control both the C++ and Rust codebases. Before shipping to production, perform a security audit of the generated
unsafecode, verify the licensing (Apache‑2.0 compatible), and confirm that the maintainers respond to issues relevant to your use case. - **Risk Mitigation**: Pin the
crubitversion in your dependency lock file, add regression tests for the generated bindings, and schedule periodic reviews of upstream changes.
In short, google/crubit can dramatically simplify C++/Rust interop, but it should be introduced behind a review gate and monitored as part of your CI/CD process before being considered production‑grade.
Problem
google/crubit may be useful when its README and activity match a concrete workflow.
Outcome
Medium: useful for prototypes or internal workflows, with dependency and maintenance checks before production.
Evidence
A bidirectional bindings generator for C++ and Rust.
- Record date: 2026-09-20T06:15:55.557Z