haskell-CI/haskell-ci

Wrong condition for start of hlint with ghc-9.6.+

Closed this issue · 2 comments

if is requested ghc-9.6+ in matrix haskell-ci generates

- name: install hlint
       run: |
         if [ $((HCNUMVER => 90600)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint  --constraint='hlint >=3.5 && <3.6' |  perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
         if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then if [ ! -e $HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint ]; then echo "Downloading HLint version $HLINTVER"; mkdir -p $HOME/.haskell-ci-tools; curl --write-out 'Status Code: %{http_code} Redirects: %{num_redirects} Total time: %{time_total} Total Dsize: %{size_download}\n' --silent --location --output $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz "https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz"; tar -xzv -f $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz -C $HOME/.haskell-ci-tools; fi ; fi
         if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi
         if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then hlint --version ; fi

but hlint dont support ghc-9.6.x yet so this action and all other with same condition will fail

The workaround is simple: don't request GHC-9.6+.

Perfectly, hlint could be installable with ghcup.

I don't think there is an easy way to query which hlint versions exist and satisfy the version predicate specified (possibly implicitly) in config.

This is likely obsolete after #717.