[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230616170635.GA3474164@dev-arch.thelio-3990X>
Date: Fri, 16 Jun 2023 10:06:35 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
Wedson Almeida Filho <wedsonaf@...il.com>,
Alex Gaynor <alex.gaynor@...il.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nicolas Schier <nicolas@...sle.eu>,
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>,
Alice Ryhl <aliceryhl@...gle.com>,
Andreas Hindborg <nmi@...aspace.dk>,
linux-kbuild@...r.kernel.org, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org, patches@...ts.linux.dev,
Russell Currey <ruscur@...sell.cc>
Subject: Re: [PATCH v2 02/11] kbuild: rust_is_available: fix version check
when CC has multiple arguments
On Fri, Jun 16, 2023 at 02:16:22AM +0200, Miguel Ojeda wrote:
> From: Russell Currey <ruscur@...sell.cc>
>
> rust_is_available.sh uses cc-version.sh to identify which C compiler is
> in use, as scripts/Kconfig.include does. cc-version.sh isn't designed to
> be able to handle multiple arguments in one variable, i.e. "ccache clang".
> Its invocation in rust_is_available.sh quotes "$CC", which makes
> $1 == "ccache clang" instead of the intended $1 == ccache & $2 == clang.
>
> cc-version.sh could also be changed to handle having "ccache clang" as one
> argument, but it only has the one consumer upstream, making it simpler to
> fix the caller here.
>
> Signed-off-by: Russell Currey <ruscur@...sell.cc>
> Fixes: 78521f3399ab ("scripts: add `rust_is_available.sh`")
> Link: https://github.com/Rust-for-Linux/linux/pull/873
> [ Reworded title prefix and reflow line to 75 columns. ]
> Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
Reviewed-by: Nathan Chancellor <nathan@...nel.org>
> ---
> scripts/rust_is_available.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh
> index f43a010eaf30..0c9be438e4cd 100755
> --- a/scripts/rust_is_available.sh
> +++ b/scripts/rust_is_available.sh
> @@ -113,10 +113,10 @@ fi
> #
> # In the future, we might be able to perform a full version check, see
> # https://github.com/rust-lang/rust-bindgen/issues/2138.
> -cc_name=$($(dirname $0)/cc-version.sh "$CC" | cut -f1 -d' ')
> +cc_name=$($(dirname $0)/cc-version.sh $CC | cut -f1 -d' ')
> if [ "$cc_name" = Clang ]; then
> clang_version=$( \
> - LC_ALL=C "$CC" --version 2>/dev/null \
> + LC_ALL=C $CC --version 2>/dev/null \
> | sed -nE '1s:.*version ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
> )
> if [ "$clang_version" != "$bindgen_libclang_version" ]; then
> --
> 2.41.0
>
Powered by blists - more mailing lists