[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72=4vX_tJMJLE6e+bg7ZECHkS-AQpm8GBzuK75G1EB7+Nw@mail.gmail.com>
Date: Sat, 27 Jul 2024 19:05:31 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] rust: suppress error messages from CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT
On Sat, Jul 27, 2024 at 4:03 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> The successful execution of 'command -v rustc' does not necessarily mean
> that 'rustc --version' will succeed.
+1, it could also be e.g. non-executable.
By the way, I was checking recently `pahole-version.sh` for a series I
will send about `RUSTC_VERSION` and I saw that one has a `[ ! -x`
check after the `command -v` for the non-executable case. But taking
into account what you say here, I wonder if something needs to be done
there too, e.g.
$ echo 'bad' > bad-pahole
$ chmod u+x bad-pahole
$ make PAHOLE=./bad-pahole defconfig
...
./bad-pahole: 1: bad: not found
init/Kconfig:112: syntax error
init/Kconfig:112: invalid statement
So perhaps we can put in pahole-version.sh something like:
if output=$("$@" --version 2>/dev/null); then
echo $output | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'
else
echo 0
exit 1
fi
i.e. similar to what you do here for `rustc`/`bindgen`.
> However, I did not understand the necessity of 'command -v $(RUSTC)'.
I agree, I don't think it is needed.
If you want to take it through your tree:
Acked-by: Miguel Ojeda <ojeda@...nel.org>
Tested-by: Miguel Ojeda <ojeda@...nel.org>
Otherwise, I can take it too.
Cheers,
Miguel
Powered by blists - more mailing lists