Re: [PATCH 3/3] rust: generate bindings via cbindgen
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 28, 2025, 04:15 UTC
- Message-ID
- <xmqq8qgvfyq0.fsf@gitster.g>
- In-Reply-To
- <aP_gy-Rj8MI7zAWd@fruit.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 21 quoted lines
> On 2025-10-27 at 20:35:59, Ezekiel Newren wrote: >> On Fri, Oct 24, 2025 at 12:37 AM Patrick Steinhardt <ps@pks.im> wrote: >> > > cbindgen is a Rust crate and it should be specified in the Cargo.toml >> > > under [build-dependencies] block. >> > >> > What is the benefit for us? The generated code is not a dependency of >> > the Rust code, and neither do we use it via "build.rs". And if we use >> > cbindgen via "Cargo.toml" we'd be forced to build it first, which slows >> > down our CI jobs. >> > >> > Please let me know in case I miss any reasons to have it in our build >> > dependencies instead. >> >> You're targeting a very old version of Rust (1.49). I'm not even sure >> that cbindgen will work with a version that old, but if it does then >> we should use it in build.rs to make sure we're not using any features >> of cbindgen that aren't available until later versions. > ... > For instance, I'm using Debian unstable with a system cbindgen 0.27.0. > This requires Rust 1.70 or newer. If I use rustup to test my code on > Rust 1.49, then the code won't compile for me.
Have we even agreed on which Rust version we would aim for? With BreakingChanges.adoc We have agreed to make some version of Rust mandatory by the time we hit Git 3.0 but IIRC, there isn't anything written down except for an old message from you
https://lore.kernel.org/git/ZZ9K1CVBKdij4tG0@tapette.crustytoothpaste.net/
that expressed your preference to support the version of Rust in the latest Debian stable plus the version in Debian's oldstable until the latest stable has been out for a year, which nobody responded to, so we cannot quite say that is the consensus of the community, yet.
Given that the stable/trixie was released on August 9th, 2025, we still need to go by oldstable/bookworm, which has Rust 1.63, if people agree that your rule to decide the floor version is sensible (which I would say is OK).