From 03c682778ff83690eee0fa3d8a441bc0883b346f Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Fri, 30 Jun 2023 22:35:10 +0300 Subject: [PATCH] Allow aeson 2.2 --- .github/workflows/haskell-ci.yml | 36 +++++++++++++------------------- cabal.haskell-ci | 8 +++++++ openapi3.cabal | 6 +++--- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 8f0fc576..dead0a16 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.14.3 +# version: 0.16.3 # -# REGENDATA ("0.14.3",["github","cabal.project"]) +# REGENDATA ("0.16.3",["github","cabal.project"]) # name: Haskell-CI on: @@ -37,49 +37,41 @@ jobs: compilerVersion: 9.6.1 setup-method: ghcup allow-failure: true - cabalVersion: 3.10.1.0 - compiler: ghc-9.4.5 compilerKind: ghc compilerVersion: 9.4.5 setup-method: ghcup allow-failure: true - cabalVersion: 3.6.2.0 - compiler: ghc-9.2.7 compilerKind: ghc compilerVersion: 9.2.7 setup-method: ghcup allow-failure: true - cabalVersion: 3.6.2.0 - compiler: ghc-9.0.2 compilerKind: ghc compilerVersion: 9.0.2 setup-method: ghcup allow-failure: false - cabalVersion: 3.6.2.0 - compiler: ghc-8.10.7 compilerKind: ghc compilerVersion: 8.10.7 setup-method: ghcup allow-failure: false - cabalVersion: 3.6.2.0 - compiler: ghc-8.8.4 compilerKind: ghc compilerVersion: 8.8.4 setup-method: hvr-ppa allow-failure: false - cabalVersion: 3.6.2.0 - compiler: ghc-8.6.5 compilerKind: ghc compilerVersion: 8.6.5 setup-method: hvr-ppa allow-failure: false - cabalVersion: 3.6.2.0 - compiler: ghc-8.4.4 compilerKind: ghc compilerVersion: 8.4.4 setup-method: hvr-ppa allow-failure: false - cabalVersion: 3.6.2.0 fail-fast: false steps: - name: apt @@ -88,24 +80,23 @@ jobs: apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 if [ "${{ matrix.setup-method }}" = ghcup ]; then mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.17.5/x86_64-linux-ghcup-0.1.17.5 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" - "$HOME/.ghcup/bin/ghcup" install cabal "$CABALVER" + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) else apt-add-repository -y 'ppa:hvr/ghc' apt-get update apt-get install -y "$HCNAME" mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.17.5/x86_64-linux-ghcup-0.1.17.5 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install cabal "$CABALVER" + "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) fi env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - CABALVER: ${{ matrix.cabalVersion }} - name: Set PATH and environment variables run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH @@ -118,13 +109,13 @@ jobs: echo "HC=$HC" >> "$GITHUB_ENV" echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-$CABALVER -vnormal+nowrap" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" else HC=$HCDIR/bin/$HCKIND echo "HC=$HC" >> "$GITHUB_ENV" echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-$CABALVER -vnormal+nowrap" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" fi HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') @@ -138,7 +129,6 @@ jobs: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - CABALVER: ${{ matrix.cabalVersion }} - name: env run: | env @@ -177,8 +167,8 @@ jobs: - name: install cabal-plan run: | mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c - + curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz + echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan rm -f cabal-plan.xz chmod a+x $HOME/.cabal/bin/cabal-plan @@ -210,6 +200,8 @@ jobs: echo "packages: ${PKGDIR_openapi3}" >> cabal.project echo "package openapi3" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project + cat >> cabal.project <> cabal.project.local cat cabal.project cat cabal.project.local @@ -242,7 +234,7 @@ jobs: ${CABAL} -vnormal check - name: haddock run: | - $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all + if [ $((HCNUMVER < 90000 || HCNUMVER >= 90400)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi - name: unconstrained build run: | rm -f cabal.project.local diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 9afe0795..ea783c4c 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -3,6 +3,14 @@ branches: master distribution: focal allow-failures: >=9.2 +-- https://github.com/haskell-CI/haskell-ci/issues/658#issuecomment-1513692337 +haddock-components: libs + +-- Building docs on GHC 9.2 and 9.4 leads to myriad of different errors. +-- See https://github.com/haskell/cabal/issues/7462, https://github.com/haskell/cabal/issues/8707 +-- and https://github.com/haskell/cabal/issues/8707 +haddock: < 9.0 || >= 9.4 + constraint-set aeson-1 constraints: aeson <2.0 ghc: <9.2 diff --git a/openapi3.cabal b/openapi3.cabal index b7afcf3b..871424c9 100644 --- a/openapi3.cabal +++ b/openapi3.cabal @@ -79,7 +79,7 @@ library -- other dependencies build-depends: base-compat-batteries >=0.11.1 && <0.14 - , aeson >=1.4.2.0 && <1.6 || >=2.0.1.0 && < 2.2 + , aeson >=1.4.2.0 && <1.6 || >=2.0.1.0 && < 2.3 , aeson-pretty >=0.8.7 && <0.9 -- cookie 0.4.3 is needed by GHC 7.8 due to time>=1.4 constraint , cookie >=0.4.3 && <0.5 @@ -103,8 +103,8 @@ test-suite spec hs-source-dirs: test main-is: Spec.hs - -- From library parat - -- We need aeson's toEncoding for doctests too + -- From library part + -- We need aeson's toEncoding for doctests too build-depends: base , QuickCheck