Re: [PATCH 2/6] kbuild: rust: make command for `RUSTC_VERSION_TEXT` closer to the `CC` one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 9, 2024 at 7:12 AM Miguel Ojeda <ojeda@xxxxxxxxxx> wrote:
>
> `CC_VERSION_TEXT` is defined as:
>
>     CC_VERSION_TEXT = $(subst $(pound),,$(shell LC_ALL=C $(CC) --version 2>/dev/null | head -n 1))
>
> Make `RUSTC_VERSION_TEXT` closer to that, i.e. add `LC_ALL=C` and `|
> head -n 1` in case it matters in the future, and for consistency.



Even if "rustc --version" starts to print multiple lines,
it will not cause an immediate problem.

$(shell ... ) (both Makefile and Kconfig) replaces a new line
with a space.

CONFIG_RUSTC_VERSION_TEXT is not broken in any way.
It would be just longer than we would expect.











>
> This reduces the difference in the next commit.
>
> Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
> ---
>  init/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/init/Kconfig b/init/Kconfig
> index 47e2c3227b99..2f974f412374 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1926,7 +1926,7 @@ config RUST
>  config RUSTC_VERSION_TEXT
>         string
>         depends on RUST
> -       default "$(shell,$(RUSTC) --version 2>/dev/null)"
> +       default "$(shell,LC_ALL=C $(RUSTC) --version 2>/dev/null | head -n 1)"
>
>  config BINDGEN_VERSION_TEXT
>         string
> --
> 2.46.0
>


-- 
Best Regards
Masahiro Yamada





[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux