Re: [PATCH v2] rust: kbuild: Replace and dissolve procmacro-extension variable
From: Miguel Ojeda
Date: Sat Oct 03 2026 - 08:30:52 EST
On Wed, Jun 17, 2026 at 4:10 PM Nicolas Schier <n.schier@xxxxxxxxx> wrote:
>
> Use make's $(basename) function [1] and substitution reference [2]
> instead of $(patsubst) to extract crate names for rust procmacro
> targets. As there is only one user of the procmacro-extension variable,
> do the crate name extraction in-place and remove procmacro-extension.
>
> The procmacro-extension variable is used to record the binary file
> suffix of dynamically loadable rust libraries -- which is 'so' on Linux
> and others and 'dylib' in MacOS -- to remove that very suffix from a
> target file name for reconstructing the corresponding crate name in
> cmd_rustc_procmacro. Extracting the crate name from the target name
> in-place is shorter and reduces complexity.
>
> Link: https://www.gnu.org/software/make/manual/html_node/File-Name-Functions.html # [1]
> Link: https://www.gnu.org/software/make/manual/html_node/Substitution-Refs.html # [2]
> Reviewed-by: Tamir Duberstein <tamird@xxxxxxxxxx>
> Tested-by: Tamir Duberstein <tamird@xxxxxxxxxx>
> Signed-off-by: Nicolas Schier <n.schier@xxxxxxxxx>
Applied to `rust-next` -- thanks everyone!
[ Rebased. - Miguel ]
Cheers,
Miguel