Closed Bug 1489468 Opened 6 years ago Closed 3 years ago

Use cbindgen to expose Baldrdash rust bindings to C

Categories

(Core :: JavaScript: WebAssembly, enhancement, P5)

enhancement

Tracking

()

RESOLVED INACTIVE
Tracking Status
firefox64 --- affected

People

(Reporter: bbouvier, Unassigned)

References

Details

There's already the cbindgen crate in tree, used for WebRender, from which we can draw inspiration: https://searchfox.org/mozilla-central/source/gfx/webrender_bindings/src/bindings.rs

Using cbindgen will avoid possible function signature mismatches between Rust and C.

Hey, I am interested. Can anybody guide me through this issue?

That's a good question; I haven't used cbindgen myself. The way I'd do it would be to look at cbindgen documentation, then look at other uses of cbindgen in tree, then see what I can replace by using cbindgen (and if that's actually better or as good as the current implementation). To be transparent, I don't think this is an easy bug, because it might involve build hardships (e.g. do we need to pass platform specific build flags to cbindgen, which ones, etc). Feel free to try and let us know, though, if you feel like it :)

I'm happy to mentor this if you want. Grepping RunCbindgen.py should show how it's used.

Priority: -- → P3
Priority: P3 → P5
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.