[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a55sles9.fsf@gmail.com>
Date: Fri, 27 Jun 2025 20:35:02 -0700
From: Collin Funk <collin.funk1@...il.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Alexander Shishkin
<alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>, Ian
Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
"Liang, Kan" <kan.liang@...ux.intel.com>, James Clark
<james.clark@...aro.org>, Charlie Jenkins <charlie@...osinc.com>, Ravi
Bangoria <ravi.bangoria@....com>, "Masami Hiramatsu (Google)"
<mhiramat@...nel.org>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] perf build: Specify that shellcheck should use the
bash dialect.
Hi Namhyung,
Namhyung Kim <namhyung@...nel.org> writes:
> This caused a trouble on a test environment where 'which' (and
> 'shellcheck' as well) is not available. Now it makes SHELLCHECK
> non-empty unconditionally.
>
> So the version check below failed like below:
>
> make[1]: which: No such file or directory
> /bin/sh: - : invalid option
> Usage: /bin/sh [GNU long option] [option] ...
> /bin/sh [GNU long option] [option] script-file ...
> GNU long options:
> --debug
> --debugger
> --dump-po-strings
> --dump-strings
> --help
> --init-file
> --login
> --noediting
> --noprofile
> --norc
> --posix
> --pretty-print
> --rcfile
> --rpm-requires
> --restricted
> --verbose
> --version
> Shell options:
> -ilrsD or -c command or -O shopt_option (invocation only)
> -abefhkmnptuvxBCEHPT or -o option
> expr: syntax error: unexpected argument ‘060’
>
> And it failed to build later on shellchecks.
>
> TEST /build/arch/x86/tests/gen-insn-x86-dat.sh.shellcheck_log
> /bin/sh: line 1: -s: command not found
> make[6]: *** [arch/x86/tests/Build:25: /build/arch/x86/tests/gen-insn-x86-dat.sh.shellcheck_log] Error 1
> make[6]: *** Waiting for unfinished jobs....
>
> I think it's better to convert 'which' to 'command -v' (in other places
> too) and add the options after the version check.
Oops, I assumed that on a system without shellcheck NO_SHELLCHECK would
be defined. Let me write another version.
I think the 'command -v' change is best left for a separate patch(s).
Since it is used in many other places, and maybe others will raise
objections.
Collin
Powered by blists - more mailing lists