Skip to contentSkip to conversation

perf build: Make minimal shellcheck version to v0.6.0

PATCH Applied Yicong Yang 4 participants 4 messages Jan 22, 2024 – Jan 26, 2024 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf build: Make minimal shellcheck version to v0.6.0

From: Yicong Yang <[email protected]>

perf build failed due to the shellcheck on my machine (v0.4.6 on Ubuntu 18.04.1 LTS) doesn't support -a/--check-sourced and -S/--severity option. These two options are introduced in shellcheck v0.4.7 and v0.6.0 respectively. So restrict the minimal version of shellcheck to v0.6.0.

Fixes b809fc656e76 ("perf build: Shellcheck support for OUTPUT directory")
---
 tools/perf/Makefile.perf | 10 ++++++++++
 1 file changed, 10 insertions(+)
tools/perf/Makefile.perf +10 -0
index 27e7c478880f..f8774a9b1377 100644
@@ -236,6 +236,16 @@ else
   SHELLCHECK := $(shell which shellcheck 2> /dev/null)
 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.
+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)
+    SHELLCHECK :=
+  endif
+endif
+
 export srctree OUTPUT RM CC CXX LD AR CFLAGS CXXFLAGS V BISON FLEX AWK
 export HOSTCC HOSTLD HOSTAR HOSTCFLAGS SHELLCHECK
 
Signature · 1 line
2.24.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Yicong Yang

From: Yicong Yang <[email protected]>

perf build failed due to the shellcheck on my machine (v0.4.6 on Ubuntu 18.04.1 LTS) doesn't support -a/--check-sourced and -S/--severity option. These two options are introduced in shellcheck v0.4.7 and v0.6.0 respectively. So restrict the minimal version of shellcheck to v0.6.0.

Fixes b809fc656e76 ("perf build: Shellcheck support for OUTPUT directory")

Thanks,
Ian

Quoted 28 lines
---
 tools/perf/Makefile.perf | 10 ++++++++++
 1 file changed, 10 insertions(+)
tools/perf/Makefile.perf +10 -1
index 27e7c478880f..f8774a9b1377 100644
@@ -236,6 +236,16 @@ else
   SHELLCHECK := $(shell which shellcheck 2> /dev/null)
 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.
+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)
+    SHELLCHECK :=
+  endif
+endif
+
 export srctree OUTPUT RM CC CXX LD AR CFLAGS CXXFLAGS V BISON FLEX AWK
 export HOSTCC HOSTLD HOSTAR HOSTCFLAGS SHELLCHECK
 
--

2.24.0

maintainer Applied
#2 lore raw

Em Tue, Jan 23, 2024 at 08:04:55AM -0800, Ian Rogers escreveu:

Quoted 9 lines · Yicong Yang
Quoted 8 lines

From: Yicong Yang <[email protected]>

perf build failed due to the shellcheck on my machine (v0.4.6 on Ubuntu 18.04.1 LTS) doesn't support -a/--check-sourced and -S/--severity option. These two options are introduced in shellcheck v0.4.7 and v0.6.0 respectively. So restrict the minimal version of shellcheck to v0.6.0.

Quoted 4 lines
Quoted 2 lines
Fixes b809fc656e76 ("perf build: Shellcheck support for OUTPUT directory")

Thanks, applied to perf-tools.

- Arnaldo

maintainer
#3 lore raw
In reply to Yicong Yang

Adding Athira to CC.

Thanks,
Namhyung

Quoted 38 lines · Yicong Yang

From: Yicong Yang <[email protected]>

perf build failed due to the shellcheck on my machine (v0.4.6 on Ubuntu 18.04.1 LTS) doesn't support -a/--check-sourced and -S/--severity option. These two options are introduced in shellcheck v0.4.7 and v0.6.0 respectively. So restrict the minimal version of shellcheck to v0.6.0.

Fixes b809fc656e76 ("perf build: Shellcheck support for OUTPUT directory")
---
 tools/perf/Makefile.perf | 10 ++++++++++
 1 file changed, 10 insertions(+)
tools/perf/Makefile.perf +10 -1
index 27e7c478880f..f8774a9b1377 100644
@@ -236,6 +236,16 @@ else
   SHELLCHECK := $(shell which shellcheck 2> /dev/null)
 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.
+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)
+    SHELLCHECK :=
+  endif
+endif
+
 export srctree OUTPUT RM CC CXX LD AR CFLAGS CXXFLAGS V BISON FLEX AWK
 export HOSTCC HOSTLD HOSTAR HOSTCFLAGS SHELLCHECK
 
--

2.24.0