Re: [PATCH v1] tools build: Fix feature test for rust compiler
From: Arnaldo Carvalho de Melo
Date: Wed Feb 11 2026 - 07:23:44 EST
On Wed, Feb 11, 2026 at 10:58:01AM +0100, Dmitrii Dolgov wrote:
> Currently a dummy rust code is compiled to detect if the rust feature
> could be enabled. It turns out that in this case rust emits a dependency
> file without any external references:
>
> /perf/feature/test-rust.d: test-rust.rs
>
> /perf/feature/test-rust.bin: test-rust.rs
>
> test-rust.rs:
>
> This can lead to a situation, when rustc was removed after a successful build,
> but the build process still thinks it's there and the feature is enabled on
> subsequent runs.
>
> Instead simply check the compiler presence to detect the feature, as
> suggested by Arnaldo Carvalho de Melo. This way no actual test-rust.bin
> will be created, meaning the feature check will not be cached and always
> performed. That's exactly what we want, and the overhead of doing this
> every time is minimal.
>
> Tested with multiple rounds of install/remove of the rust package.
Yeah, seems to work, applied.
- Arnaldo