[PATCH v3] perf build: Raise minimum shellcheck version to 0.7.2

Nicolas Schier posted 1 patch 1 month ago
tools/perf/Makefile.perf | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
[PATCH v3] perf build: Raise minimum shellcheck version to 0.7.2
Posted by Nicolas Schier 1 month ago
Raise the minimum shellcheck version for perf builds to 0.7.2, so that
systems with shellcheck versions below 0.7.2 will automatically skip the
shell script checking, even if NO_SHELLCHECK is unset.

Since commit 241f21be7d0f ("perf test perftool_testsuite: Use absolute
paths"), shellcheck versions before 0.7.2 break the perf build with
several SC1090 [2] warnings due to its too strict dynamic source
handling [1], e.g.:

  In tests/shell/base_probe/test_line_semantics.sh line 20:
  . "$DIR_PATH/../common/init.sh"
    ^---------------------------^ SC1090: Can't follow non-constant source. Use a directive to specify location.

Fixes: 241f21be7d0f ("perf test perftool_testsuite: Use absolute paths")
Link: https://github.com/koalaman/shellcheck/issues/1998 # [1]
Link: https://www.shellcheck.net/wiki/SC1090
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Nicolas Schier <n.schier@avm.de>
---
Changes in v3:
  * Update comment about minimum shellcheck version (Arnaldo Melo)
  * Link to v2: https://lore.kernel.org/r/20260107-perf-raise-minimum-shellcheck-version-v2-1-019ef32d7711@avm.de

Changes in v2:
  * Add one of the shellcheck messages to commit message (Namhyung Kim)
  * Link to v1: https://lore.kernel.org/r/20260106-perf-raise-minimum-shellcheck-version-v1-1-b46739a78888@avm.de
---
 tools/perf/Makefile.perf | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index b3f481a626afa314632876449a11eb79b2978824..e6895626c1872a84c0a592df01d32403b7df3d2b 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -251,11 +251,12 @@ else
 endif
 
 # shellcheck is using in tools/perf/tests/Build with option -a/--check-sourced (
-# introduced in v0.4.7) and -S/--severity (introduced in v0.6.0). So make the
-# minimal shellcheck version as v0.6.0.
+# introduced in v0.4.7) and -S/--severity (introduced in v0.6.0) as well as
+# dynamic source inclusions (properly handled since v0.7.2).
+# So make the minimal shellcheck version as v0.7.2.
 ifneq ($(SHELLCHECK),)
   ifeq ($(shell expr $(shell $(SHELLCHECK) --version | grep version: | \
-        sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \< 060), 1)
+        sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \< 072), 1)
     SHELLCHECK :=
   else
     SHELLCHECK := $(SHELLCHECK) -s bash -a -S warning

---
base-commit: 9ace4753a5202b02191d54e9fdf7f9e3d02b85eb
change-id: 20260106-perf-raise-minimum-shellcheck-version-5d684fe90a39

Best regards,
-- 
Nicolas Schier
Re: [PATCH v3] perf build: Raise minimum shellcheck version to 0.7.2
Posted by Arnaldo Carvalho de Melo 3 weeks, 4 days ago
On Thu, Jan 08, 2026 at 12:29:10PM +0100, Nicolas Schier wrote:
> Raise the minimum shellcheck version for perf builds to 0.7.2, so that
> systems with shellcheck versions below 0.7.2 will automatically skip the
> shell script checking, even if NO_SHELLCHECK is unset.
> 
> Since commit 241f21be7d0f ("perf test perftool_testsuite: Use absolute
> paths"), shellcheck versions before 0.7.2 break the perf build with
> several SC1090 [2] warnings due to its too strict dynamic source
> handling [1], e.g.:
> 
>   In tests/shell/base_probe/test_line_semantics.sh line 20:
>   . "$DIR_PATH/../common/init.sh"
>     ^---------------------------^ SC1090: Can't follow non-constant source. Use a directive to specify location.
> 
> Fixes: 241f21be7d0f ("perf test perftool_testsuite: Use absolute paths")

Thanks, applied to perf-tools-next,

- Arnaldo