From 154388aa208fdb2e45da8afa6f72c72deb0251b9 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Sun, 1 May 2022 23:10:55 +0100 Subject: [PATCH] ci: Drop hlint -XCPP workaround https://github.com/ndmitchell/hlint/issues/1360 is fixed and the fix released. --- .github/workflows/haskell-ci-hlint.patch | 16 ---------------- .github/workflows/haskell-ci.yml | 6 +++--- cabal.haskell-ci | 2 +- 3 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/haskell-ci-hlint.patch diff --git a/.github/workflows/haskell-ci-hlint.patch b/.github/workflows/haskell-ci-hlint.patch deleted file mode 100644 index fc9f1640..00000000 --- a/.github/workflows/haskell-ci-hlint.patch +++ /dev/null @@ -1,16 +0,0 @@ -Work around an hlint bug where it does not recognise CPP when -Haskell2010 is passed to it; see - - https://github.com/ndmitchell/hlint/issues/1360 - ---- a/.github/workflows/haskell-ci.yml.orig -+++ b/.github/workflows/haskell-ci.yml -@@ -247,7 +247,7 @@ - $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - - name: hlint - run: | -- if [ $((HCNUMVER >= 90000 && HCNUMVER < 90200)) -ne 0 ] ; then (cd ${PKGDIR_xmonad_contrib} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 .) ; fi -+ if [ $((HCNUMVER >= 90000 && HCNUMVER < 90200)) -ne 0 ] ; then (cd ${PKGDIR_xmonad_contrib} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 -XCPP .) ; fi - - name: cabal check - run: | - cd ${PKGDIR_xmonad_contrib} || false diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index d8b0af0f..8be142ba 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -163,7 +163,7 @@ jobs: - name: cache (tools) uses: actions/cache@v2 with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-d795995c + key: ${{ runner.os }}-${{ matrix.compiler }}-tools-c0dbbd39 path: ~/.haskell-ci-tools - name: install cabal-plan run: | @@ -176,7 +176,7 @@ jobs: cabal-plan --version - name: install hlint run: | - if [ $((HCNUMVER >= 90000 && HCNUMVER < 90200)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.3 && <3.4' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi + if [ $((HCNUMVER >= 90000 && HCNUMVER < 90200)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.4 && <3.5' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi if [ $((HCNUMVER >= 90000 && HCNUMVER < 90200)) -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 >= 90000 && HCNUMVER < 90200)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi if [ $((HCNUMVER >= 90000 && HCNUMVER < 90200)) -ne 0 ] ; then hlint --version ; fi @@ -247,7 +247,7 @@ jobs: $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - name: hlint run: | - if [ $((HCNUMVER >= 90000 && HCNUMVER < 90200)) -ne 0 ] ; then (cd ${PKGDIR_xmonad_contrib} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 -XCPP .) ; fi + if [ $((HCNUMVER >= 90000 && HCNUMVER < 90200)) -ne 0 ] ; then (cd ${PKGDIR_xmonad_contrib} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 .) ; fi - name: cabal check run: | cd ${PKGDIR_xmonad_contrib} || false diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 99531839..7e93e801 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -9,10 +9,10 @@ apt: hlint: True hlint-job: 9.0.2 hlint-yaml: .hlint.yaml +hlint-version: ==3.4.* github-patches: .github/workflows/haskell-ci-hackage.patch - .github/workflows/haskell-ci-hlint.patch raw-project optimization: False