lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] [PATCH] Fix shellcheck 0.7.2 errors in the CI builds


From: Vadim Zeitlin
Subject: [lmi] [PATCH] Fix shellcheck 0.7.2 errors in the CI builds
Date: Tue, 17 Aug 2021 15:17:38 +0200

 Hello,

 Debian Sid has updated shellcheck to 0.7.2 version and this has resulted
in many failures when running "make check_concinnity" in the CI builds, see
e.g. https://github.com/let-me-illustrate/lmi/runs/3342831481 or the
extract of the build log at the end of this email[*].

 First of all, let me say that if you don't care about the details, these
errors can be fixed by merging my shellcheck-0.7.2-fixes branch
corresponding to https://github.com/let-me-illustrate/lmi/pull/189


 The rest of this message explains the fixes in this branch, so please feel
free to skip it:

 I can reproduce these errors here, even though they didn't (and still
don't) appear with shellcheck 0.7.1, so it's really due to the changes in
the new shellcheck version. There seem to be at least 2 of them:

1. It now complains about the use of non-POSIX features such as process
   substitution, brace expansion and arrays in POSIX sh scripts. We don't
   actually use any of those in the sh scripts, but we pretend that zsh
   scripts are sh scripts as shellcheck doesn't know about zsh at all (and
   probably won't any time soon, seeing how the discussion in
   https://github.com/koalaman/shellcheck/issues/809 went absolutely
   nowhere since 5+ years). The simplest solution I can think of is to just
   pretend that zsh is ksh instead, as it's fairly compatible with it and
   this is enough to avoid the warnings.

2. It also complains about the use of non-POSIX "local" in set_toolchain.sh.
   This one is indeed a /bin/sh script, but an existing comment there
   explains that using "local" is actually fine and the corresponding
   shellcheck warning was already disabled. However the new version changes
   the warning given for "local", so the fix here is to just disable the
   new warning too.


 Please let me know if you see anything wrong with either of these fixes
and thanks in advance for merging them otherwise!
VZ


[*]: build log at the end of this email:

---------------------------------- >8 --------------------------------------
In - line 20:
    >(grep '\*\*\*') \
    ^--------------^ SC3001: In POSIX sh, process substitution is undefined.


In - line 21:
    >(grep \?\?\?\?) \
    ^--------------^ SC3001: In POSIX sh, process substitution is undefined.


In - line 22:
    >(grep '!!!!' --count | xargs printf '%d tests succeeded\n') \
    ^-- SC3001: In POSIX sh, process substitution is undefined.

For more information:
  https://www.shellcheck.net/wiki/SC3001 -- In POSIX sh, process substitution...
...in file /__w/lmi/lmi/gwc/unit_test.sh

In - line 36:
X=$(printf '\%03o' {255..0})
                   ^------^ SC3009: In POSIX sh, brace expansion is undefined.


In - line 37:
Y=$(printf '\%03o' {0..255})
                   ^------^ SC3009: In POSIX sh, brace expansion is undefined.


In - line 39:
MST=(*.mst(N))
    ^--------^ SC3030: In POSIX sh, arrays are undefined.
          ^-^ SC3030: In POSIX sh, arrays are undefined.


In - line 40:
XST=(*.xst(N))
    ^--------^ SC3030: In POSIX sh, arrays are undefined.
          ^-^ SC3030: In POSIX sh, arrays are undefined.

For more information:
  https://www.shellcheck.net/wiki/SC3009 -- In POSIX sh, brace expansion is u...
  https://www.shellcheck.net/wiki/SC3030 -- In POSIX sh, arrays are undefined.
...in file /__w/lmi/lmi/gwc/invert.sh

In - line 213:
  | tee >(grep '\*\*\*') >(grep \?\?\?\?) >(grep '!!!!' --count | xargs printf 
'%d tests succeeded\n') >"$log_dir"/unit_tests
        ^--------------^ SC3001: In POSIX sh, process substitution is undefined.
                         ^--------------^ SC3001: In POSIX sh, process 
substitution is undefined.
                                          ^-- SC3001: In POSIX sh, process 
substitution is undefined.


In - line 230:
  | tee >(grep '\*\*\*') >(grep \?\?\?\?) >(grep '!!!!' --count | xargs printf 
'%d tests succeeded\n') >"$log_dir"/unit_tests_safestdlib
        ^--------------^ SC3001: In POSIX sh, process substitution is undefined.
                         ^--------------^ SC3001: In POSIX sh, process 
substitution is undefined.
                                          ^-- SC3001: In POSIX sh, process 
substitution is undefined.


In - line 295:
for z in "$throwaway_dir"/*(N); do rm "$z"; done
                          ^--^ SC3002: In POSIX sh, extglob is undefined.

For more information:
  https://www.shellcheck.net/wiki/SC3001 -- In POSIX sh, process substitution...
  https://www.shellcheck.net/wiki/SC3002 -- In POSIX sh, extglob is undefined.
...in file /__w/lmi/lmi/nychthemeral_test.sh

In /__w/lmi/lmi/set_toolchain.sh line 88:
local   lmi_build_type
^--------------------^ SC3043: In POSIX sh, 'local' is undefined.


In /__w/lmi/lmi/set_toolchain.sh line 91:
local      prefix="/opt/lmi"
^---------------^ SC3043: In POSIX sh, 'local' is undefined.


In /__w/lmi/lmi/set_toolchain.sh line 92:
local      bindir="$prefix/bin"
^---------------^ SC3043: In POSIX sh, 'local' is undefined.


In /__w/lmi/lmi/set_toolchain.sh line 93:
local localbindir="$prefix/local/${LMI_COMPILER}_${LMI_TRIPLET}/bin"
^---------------^ SC3043: In POSIX sh, 'local' is undefined.


In /__w/lmi/lmi/set_toolchain.sh line 94:
local locallibdir="$prefix/local/${LMI_COMPILER}_${LMI_TRIPLET}/lib"
^---------------^ SC3043: In POSIX sh, 'local' is undefined.

For more information:
  https://www.shellcheck.net/wiki/SC3043 -- In POSIX sh, 'local' is undefined.
make: *** [GNUmakefile:477: check_concinnity] Error 123
---------------------------------- >8 --------------------------------------

Attachment: pgpQ95KB5Q1D9.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]