Shellcheck started failing for one of our applications today. I narrowed the issue down to a few lines in a shell script in combination with the latest docker image (it works on 0.7.0 or the previous latest).
My shellcheck version (latest docker image):
docker run --rm -v $PWD:/mnt --workdir /mnt koalaman/shellcheck --version
ShellCheck - shell script analysis tool
version: 0.7.0
license: GNU General Public License, version 3
website: https://www.shellcheck.net
v0.7.0 works but reports the same version:❯ docker run --rm -v $PWD:/mnt --workdir /mnt koalaman/shellcheck:v0.7.0 --version
ShellCheck - shell script analysis tool
version: 0.7.0
license: GNU General Public License, version 3
website: https://www.shellcheck.net
file.sh:
#!/bin/bash
TIMEOUT=300
timeout ${TIMEOUT} bash -xc "while [[ \"\$(curl --write-out %{http_code} -s -k -o /dev/null https://localhost:${PORT}/health)\" != '200' ]]; do sleep 2; echo -n '.'; done"
❯ docker run --rm -v $PWD:/mnt --workdir /mnt koalaman/shellcheck file.sh
shellcheck: src/ShellCheck/Analytics.hs:1404:10-27: No instance nor default method for class operation mappend
On 0.7.0:
❯ docker run --rm -v $PWD:/mnt --workdir /mnt koalaman/shellcheck:v0.7.0 file.sh
❯ echo $?
0
Yes, it's due to the Semigroup-issues recently.
Is there any workaround?
How can this be fixed. ?
Switching back to stable release binary from https://storage.googleapis.com/shellcheck/shellcheck-stable.linux.x86_64.tar.xz or https://storage.googleapis.com/shellcheck/shellcheck-v0.7.0.linux.x86_64.tar.xz fixed this issue for me
Both binaries packed in stable and latest show version 0.7.0 but they actually differ
https://storage.googleapis.com/shellcheck/shellcheck-stable.linux.x86_64.tar.xz
https://storage.googleapis.com/shellcheck/shellcheck-latest.linux.x86_64.tar.xz
stable binary SHA1
latest binary SHA1
A work around would be using the tag v0.7.0 instead of latest @akhilerm @janlanger
Sorry about that! The :latest docker image should now be back up and running. The issue was not caused by the Docker image sanity tests because it only triggers on certain code paths, and it was not caught by unit tests because it only triggers on older versions of GHC.
Definitely do use :stable or explicitly :v0.7.0 for CI and anything else that may block you. :latest is git master.
Most helpful comment
A work around would be using the tag v0.7.0 instead of latest @akhilerm @janlanger