[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNATDZaGrqvugf7JBOvYvJTH=ZUacSvFZtiJW=9k24-wWHw@mail.gmail.com>
Date: Sat, 10 Aug 2024 02:52:21 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Alex Gaynor <alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...sung.com>,
Alice Ryhl <aliceryhl@...gle.com>, rust-for-linux@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>, Nicolas Schier <nicolas@...sle.eu>, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH 2/6] kbuild: rust: make command for `RUSTC_VERSION_TEXT`
closer to the `CC` one
On Fri, Aug 9, 2024 at 7:12 AM Miguel Ojeda <ojeda@...nel.org> 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@...nel.org>
> ---
> 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
Powered by blists - more mailing lists