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 Friday, August 9th, 2024 at 00:11, 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.

Cargo depends on the rustc version string not getting localized. Or to be precise it depends on the version string being fixed for a given rustc version, which would not be the case if the value of LC_ALL could change the version string. If the version string changes, cargo will rebuild everything from scratch. There is also not really anything to localize in the non-verbose version string. I guess setting LC_ALL doesn't hurt either though.

> 
> 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





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

  Powered by Linux