git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 0/5] rust: generate bindings via cbindgen

From
Patrick Steinhardt <ps@pks.im>
Date
Oct 30, 2025, 09:50 UTC
Message-ID
<aQM0-IwB3e4t7YKE@pks.im>
In-Reply-To
<CAH=ZcbAC_u88_cD33bRxAuAPhJh02zNOHAVnkhxthncDFdZOOA@mail.gmail.com>
On Tue, Oct 28, 2025 at 01:37:00PM -0600, Ezekiel Newren wrote:
Show 37 quoted lines
> On Fri, Oct 24, 2025 at 3:51 AM Patrick Steinhardt <ps@pks.im> wrote:
> >
> > Hi,
> >
> > this small patch series introduces support for cbindgen(1). This tool is
> > used to generate C headers from `extern "C"` blocks so that Rust code
> > can easily be called from C code.
> >
> > For now, the only use case is to verify that our varint reimplementation
> > matches the C implementation. But later on this can and will be used to
> > call Rust-specific features from C, as well.
> >
> > The topic is built on top of c54a18ef67 (The twenty-second batch,
> > 2025-10-22) with ps/ci-rust at e509b5b8be (rust: support for Windows,
> > 2025-10-15) merged into it.
> >
> > Changes in v2:
> >   - Take some of the pieces from Ezekiel's "cbindgen.toml" file. I have
> >     not yet taken `usize_is_size_t`, as that option requires cbindgen
> >     v0.16.0, which is not available on Ubuntu 20.04.
> >   - Backfill missing jobs for GitLab CI.
> >   - Fix CI failures on Alma Linux 8 because cbindgen isn't available
> >     there.
> >   - Link to v1: https://lore.kernel.org/r/20251023-b4-pks-rust-cbindgen-v1-0-c19b61b03127@pks.im
> 
> I really think that this patch series should include migrating to a
> Cargo Workspace. That'll mean moving /Cargo.toml and /src into
> gitcore/ and creating a new top-level /Cargo.toml with the following
> content:
> [workspace]
> members = [
>     "gitcore",
> ]
> resolver = "2"
> 
> Along with the other cascading refactor changes needed to make this
> work. Let's do this now while it's still easy.

I simply think that cbindgen and workspaces are quite unrelated to one another for now. So an alternate suggestion: once this patch series here lands we could introduce workspaces in the subsequent patch series. I think that's still early enough, and this patch series here shouldn't cause significant additional churn.

In any case, I'd prefer if you wrote that patch series to introduce workspaces. I don't feel like I have enough experience with them to be able to argue properly why we want to have them.

Does that work for you?
Thanks!
Patrick
Previous: Ezekiel Newren
Message 38 of 38 in “rust: generate bindings via cbindgen”
  1. 0/3 rust: generate bindings via cbindgenPatrick Steinhardt, Oct 23, 2025
  2. 1/3 ci: use Debian instead of deprecated i386/ubuntuPatrick Steinhardt, Oct 23, 2025
  3. Junio C HamanoOct 23, 2025
  4. Patrick SteinhardtOct 24, 2025
  5. 2/3 meson: rename Rust library targetPatrick Steinhardt, Oct 23, 2025
  6. 3/3 rust: generate bindings via cbindgenPatrick Steinhardt, Oct 23, 2025
  7. Ezekiel NewrenOct 23, 2025
  8. Patrick SteinhardtOct 24, 2025
  9. Ezekiel NewrenOct 27, 2025
  10. brian m. carlsonOct 27, 2025
  11. Junio C HamanoOct 28, 2025
  12. Ezekiel NewrenOct 28, 2025
  13. Patrick SteinhardtOct 30, 2025
  14. Patrick SteinhardtOct 30, 2025
  15. brian m. carlsonOct 30, 2025
  16. Junio C HamanoOct 30, 2025
  17. brian m. carlsonOct 30, 2025
  18. Patrick SteinhardtOct 31, 2025
  19. Patrick SteinhardtOct 30, 2025
  20. Ezekiel NewrenOct 31, 2025
  21. Junio C HamanoOct 23, 2025
  22. Junio C HamanoOct 23, 2025
  23. Junio C HamanoOct 23, 2025
  24. Patrick SteinhardtOct 24, 2025
  25. 0/5 rust: generate bindings via cbindgenPatrick Steinhardt, Oct 24, 2025
  26. 1/5 gitlab-ci: reorder Linux job matrix to match GitHub's orderPatrick Steinhardt, Oct 24, 2025
  27. Ezekiel NewrenOct 28, 2025
  28. 2/5 gitlab-ci: backfill missing Linux jobsPatrick Steinhardt, Oct 24, 2025
  29. Ezekiel NewrenOct 28, 2025
  30. 3/5 ci: use Debian instead of deprecated i386/ubuntuPatrick Steinhardt, Oct 24, 2025
  31. Ezekiel NewrenOct 28, 2025
  32. Patrick SteinhardtOct 30, 2025
  33. 4/5 meson: rename Rust library targetPatrick Steinhardt, Oct 24, 2025
  34. 5/5 rust: generate bindings via cbindgenPatrick Steinhardt, Oct 24, 2025
  35. Toon ClaesOct 24, 2025
  36. Patrick SteinhardtOct 30, 2025
  37. Ezekiel NewrenOct 28, 2025
  38. Patrick SteinhardtOct 30, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.