From 48c44fe6d43a05b37597070719011ab1e91eb79e Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Wed, 24 Feb 2021 14:55:28 +0100 Subject: [PATCH] Run spatch jobs in parallel Also make the script more verbose to identify which patch is being processed and check for failures in spatch standard error output. --- util/check-cocci | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/util/check-cocci b/util/check-cocci index 3a1190e821..8e09d2f7fd 100755 --- a/util/check-cocci +++ b/util/check-cocci @@ -15,7 +15,12 @@ ret=0 for spatch in cocci/*.spatch; do patch="$(dirname "$spatch")/$(basename "$spatch" .spatch).patch" : > "$patch" - spatch --sp-file "$spatch" --use-gitgrep --dir "." --very-quiet --include-headers "$@" >> "$patch"; + echo "Applying semantic patch $spatch..." + spatch --jobs "${TEST_PARALLEL_JOBS:-1}" --sp-file "$spatch" --use-gitgrep --dir "." --very-quiet --include-headers "$@" >> "$patch" 2> cocci.stderr + cat cocci.stderr + if grep -q -e "parse error" cocci.stderr; then + ret=1 + fi if [ "$(< "$patch" wc -l)" -gt "0" ]; then cat "$patch" ret=1 @@ -24,4 +29,6 @@ for spatch in cocci/*.spatch; do fi done +rm -f cocci.stderr + exit $ret