rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Miguel Ojeda <ojeda@kernel.org>,
	rust-for-linux@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] rust: suppress error messages from CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT
Date: Sun, 28 Jul 2024 17:02:46 +0900	[thread overview]
Message-ID: <CAK7LNAQBqcBEYvJQNMHgP7WfQmLbsj_j-wz4DpwQ4Cr3D1bj-w@mail.gmail.com> (raw)
In-Reply-To: <CANiq72=4vX_tJMJLE6e+bg7ZECHkS-AQpm8GBzuK75G1EB7+Nw@mail.gmail.com>

On Sun, Jul 28, 2024 at 2:05 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Sat, Jul 27, 2024 at 4:03 PM Masahiro Yamada <masahiroy@kernel.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`.



Agree.
pahole-version.sh should be fixed too.




>
> > 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@kernel.org>
> Tested-by: Miguel Ojeda <ojeda@kernel.org>
>
> Otherwise, I can take it too.


Yes, please take this to your tree. Thanks.






-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2024-07-28  8:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-27 14:02 [PATCH 1/2] rust: suppress error messages from CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT Masahiro Yamada
2024-07-27 14:03 ` [PATCH 2/2] rust: fix the default format for CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT Masahiro Yamada
2024-07-27 17:13   ` Miguel Ojeda
2024-07-27 17:05 ` [PATCH 1/2] rust: suppress error messages from CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT Miguel Ojeda
2024-07-28  8:02   ` Masahiro Yamada [this message]
2024-07-29 12:46     ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK7LNAQBqcBEYvJQNMHgP7WfQmLbsj_j-wz4DpwQ4Cr3D1bj-w@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).