Subject: Re: [PATCH RFC 1/3] meson: add infrastructure to build internal Rust library

From: Junio C Hamano <[email-masked]>
Date: Thu, 04 Sep 2025 11:50:14 -0700

Patrick Steinhardt <[email-masked]> writes:

> Add the infrastructure into Meson to build an internal Rust library.

I am a bit surprised that Meson needs to learn Rust now.  How have
you been dealing with contrib/libgit-{sys,rs}?

> Building the Rust parts of Git are for now entirely optional, as they
> are mostly intended as a test balloon for both Git developers, but also
> for distributors of Git. So for now, they may contain:
>
>   - New features that are not mission critical to Git and that users can
>     easily live without.
>
>   - Alternative implementations of small subsystems.
>
> If these test balloons are successful, we will eventually make Rust a
> mandatory dependency for our build process in Git 3.0.
>
> The availability of a Rust toolchain will be auto-detected by Meson at
> setup time. This behaviour can be tweaked via the `-Drust=` feature
> toggle.
>
> Next to the linkable Rust library, also wire up tests that can be
> executed via `meson test`. This allows us to use the native unit testing
> capabilities of Rust.

OK.

> Signed-off-by: Patrick Steinhardt <[email-masked]>
> ---
>  meson.build       | 16 +++++++++++++++-
>  meson_options.txt |  2 ++
>  src/lib.rs        |  0
>  src/meson.build   | 12 ++++++++++++
>  4 files changed, 29 insertions(+), 1 deletion(-)