From 5af2e70bc29951f42596f88d53146c0489670dcd Mon Sep 17 00:00:00 2001 From: Alistair Burrowes Date: Mon, 22 Nov 2021 19:49:01 +1100 Subject: [PATCH] Gracefully ignore Haskell stack edge case Haskell stack can be slow to add new Haskell compiler versions. The stack container test will fail until this is done, which blocks docker Haskell updating as well. Rather, lets ignore that particular failure, but still verify with stack if the compiler version is supported. --- test/tests/haskell-stack/container.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) mode change 100644 => 100755 test/tests/haskell-stack/container.sh diff --git a/test/tests/haskell-stack/container.sh b/test/tests/haskell-stack/container.sh old mode 100644 new mode 100755 index 9df5935d9..3bb8c9932 --- a/test/tests/haskell-stack/container.sh +++ b/test/tests/haskell-stack/container.sh @@ -2,6 +2,19 @@ set -e # stack mostly sends to stderr -stack --resolver ghc-$(ghc --print-project-version) new myproject 2> /dev/null +if ! stackResult="$(stack --resolver ghc-$(ghc --print-project-version) new myproject 2>&1 > /dev/null)"; then + case "$stackResult" in + *"Unable to load global hints for"*) + echo >&2 'skipping; stack does not yet support this Haskell version' + exit 0 + ;; + *) + echo >&2 'error: stack failed:' + echo >&2 "$stackResult" + exit 1 + ;; + esac +fi + cd myproject stack run 2> /dev/null