Re: [PATCH v5 1/2] kbuild: add rustc-max-version macro
From: Miguel Ojeda
Date: Tue Mar 10 2026 - 18:46:01 EST
On Thu, Feb 5, 2026 at 4:55 PM Nicolas Schier <nsc@xxxxxxxxxx> wrote:
>
> For readability, a less-than version check might be easier to read; and
> that would probably better match the suggested version range check:
>
> rustc-lt-version = $(if $(call rustc-min-version, $(1)),,y)
> rustc-version-range = $(and $(call rustc-lt-version,$(2)), $(call rustc-min-version,$(1)))
>
> so that the actual version check could become
>
> # The bug was fixed in Rust 1.90.0, so only apply for 1.88.x to < 1.90.0
> rustdoc_modifiers_workaround := $(if $(call rustc-version-range, 108800, 109000), \
> -Cunsafe-allow-abi-mismatch=fixed-x18)
>
> or:
>
> ifeq ($(call rustc-version-range, 108800, 109000),y)
> rustdoc_modifiers_workaround := -Cunsafe-allow-abi-mismatch=fixed-x18
> endif
Yeah, exactly, I think the range check looks simpler for readers.
I would say let's do it as an improvement on top, and to simplify the
delta needed later on and to avoid the `99`, I will change the patch
on apply to be `rustc-lt-version`.
If no one shouts, I will do that, keeping the Acked-bys. Then we can
easily add the range check on top.
Thanks!
Cheers,
Miguel