From bc4861b77af72713f26fe25c9c428b094faca92c Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Sat, 26 Jul 2025 15:09:19 +0200 Subject: [PATCH 1/9] Make CI work again (GHC 8.0 - 9.12) While updating the `tested-with` field in `pretty.cabal`, I did some cosmetic fixes. --- .github/workflows/haskell-ci.yml | 164 ++++++++++++++++++++++--------- cabal.haskell-ci | 2 +- pretty.cabal | 75 +++++++++----- 3 files changed, 168 insertions(+), 73 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index e24330e..72e1532 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.11.20210220 +# version: 0.19.20250506 # -# REGENDATA ("0.11.20210220",["github","cabal.project"]) +# REGENDATA ("0.19.20250506",["github","cabal.project"]) # name: Haskell-CI on: @@ -22,67 +22,126 @@ on: - master jobs: linux: - name: Haskell-CI - Linux - GHC ${{ matrix.ghc }} - runs-on: ubuntu-18.04 + name: Haskell-CI - Linux - ${{ matrix.compiler }} + runs-on: ubuntu-24.04 + timeout-minutes: + 60 container: - image: buildpack-deps:bionic + image: buildpack-deps:jammy continue-on-error: ${{ matrix.allow-failure }} strategy: matrix: include: - - ghc: 9.0.1 + - compiler: ghc-9.12.2 + compilerKind: ghc + compilerVersion: 9.12.2 + setup-method: ghcup allow-failure: false - - ghc: 8.10.3 + - compiler: ghc-9.10.2 + compilerKind: ghc + compilerVersion: 9.10.2 + setup-method: ghcup allow-failure: false - - ghc: 8.8.4 + - compiler: ghc-9.8.4 + compilerKind: ghc + compilerVersion: 9.8.4 + setup-method: ghcup allow-failure: false - - ghc: 8.6.5 + - compiler: ghc-9.6.7 + compilerKind: ghc + compilerVersion: 9.6.7 + setup-method: ghcup allow-failure: false - - ghc: 8.4.4 + - compiler: ghc-9.4.8 + compilerKind: ghc + compilerVersion: 9.4.8 + setup-method: ghcup allow-failure: false - - ghc: 8.2.2 + - compiler: ghc-9.2.8 + compilerKind: ghc + compilerVersion: 9.2.8 + setup-method: ghcup allow-failure: false - - ghc: 8.0.2 + - compiler: ghc-9.0.2 + compilerKind: ghc + compilerVersion: 9.0.2 + setup-method: ghcup allow-failure: false - - ghc: 7.10.3 + - compiler: ghc-8.10.7 + compilerKind: ghc + compilerVersion: 8.10.7 + setup-method: ghcup allow-failure: false - - ghc: 7.8.4 + - compiler: ghc-8.8.4 + compilerKind: ghc + compilerVersion: 8.8.4 + setup-method: ghcup allow-failure: false - - ghc: 7.6.3 + - compiler: ghc-8.6.5 + compilerKind: ghc + compilerVersion: 8.6.5 + setup-method: ghcup allow-failure: false - - ghc: 7.4.2 + - compiler: ghc-8.4.4 + compilerKind: ghc + compilerVersion: 8.4.4 + setup-method: ghcup + allow-failure: false + - compiler: ghc-8.2.2 + compilerKind: ghc + compilerVersion: 8.2.2 + setup-method: ghcup + allow-failure: false + - compiler: ghc-8.0.2 + compilerKind: ghc + compilerVersion: 8.0.2 + setup-method: ghcup allow-failure: false fail-fast: false steps: - - name: apt + - name: apt-get install run: | apt-get update - apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common - apt-add-repository -y 'ppa:hvr/ghc' - apt-get update - apt-get install -y ghc-$GHC_VERSION cabal-install-3.4 + apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev + - name: Install GHCup + run: | + mkdir -p "$HOME/.ghcup/bin" + curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup" + chmod a+x "$HOME/.ghcup/bin/ghcup" + - name: Install cabal-install + run: | + "$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' + run: | + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") + HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') + HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" + echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" env: - GHC_VERSION: ${{ matrix.ghc }} + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} - name: Set PATH and environment variables run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - echo "LANG=C.UTF-8" >> $GITHUB_ENV - echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV - echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV - HC=/opt/ghc/$GHC_VERSION/bin/ghc - echo "HC=$HC" >> $GITHUB_ENV - echo "HCPKG=/opt/ghc/$GHC_VERSION/bin/ghc-pkg" >> $GITHUB_ENV - echo "HADDOCK=/opt/ghc/$GHC_VERSION/bin/haddock" >> $GITHUB_ENV - echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') - echo "HCNUMVER=$HCNUMVER" >> $GITHUB_ENV - echo "ARG_TESTS=--enable-tests" >> $GITHUB_ENV - echo "ARG_BENCH=--disable-benchmarks" >> $GITHUB_ENV - echo "HEADHACKAGE=false" >> $GITHUB_ENV - echo "ARG_COMPILER=--ghc --with-compiler=$HC" >> $GITHUB_ENV - echo "GHCJSARITH=0" >> $GITHUB_ENV + echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" + echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" + echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" + echo "HEADHACKAGE=false" >> "$GITHUB_ENV" + echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" env: - GHC_VERSION: ${{ matrix.ghc }} + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} - name: env run: | env @@ -105,6 +164,10 @@ jobs: repository hackage.haskell.org url: http://hackage.haskell.org/ EOF + cat >> $CABAL_CONFIG < 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 cabal-plan --version - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: source - name: initial cabal.project for sdist @@ -143,7 +206,8 @@ jobs: - name: generate cabal.project run: | PKGDIR_pretty="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/pretty-[0-9.]*')" - echo "PKGDIR_pretty=${PKGDIR_pretty}" >> $GITHUB_ENV + echo "PKGDIR_pretty=${PKGDIR_pretty}" >> "$GITHUB_ENV" + rm -f cabal.project cabal.project.local touch cabal.project touch cabal.project.local echo "packages: ${PKGDIR_pretty}" >> cabal.project @@ -151,19 +215,19 @@ jobs: if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi cat >> cabal.project <> cabal.project.local + $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(pretty)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan run: | $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all cabal-plan - - name: cache - uses: actions/cache@v2 + - name: restore cache + uses: actions/cache/restore@v4 with: - key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} + key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store - restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- + restore-keys: ${{ runner.os }}-${{ matrix.compiler }}- - name: install dependencies run: | $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all @@ -183,8 +247,14 @@ jobs: ${CABAL} -vnormal check - name: haddock run: | - $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all + $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all - name: unconstrained build run: | rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all + - name: save cache + if: always() + uses: actions/cache/save@v4 + with: + key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} + path: ~/.cabal/store diff --git a/cabal.haskell-ci b/cabal.haskell-ci index c344e59..8d148fe 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,2 +1,2 @@ branches: master -benchmarks: False +-- benchmarks: False diff --git a/pretty.cabal b/pretty.cabal index e79b836..93de5eb 100644 --- a/pretty.cabal +++ b/pretty.cabal @@ -1,3 +1,4 @@ +cabal-version: 1.18 name: pretty version: 1.1.3.6 synopsis: Pretty-printing library @@ -7,35 +8,41 @@ description: format of your choosing. This is useful for compilers and related tools. . - This library was originally designed by John Hughes's and has since + This library was originally designed by John Hughes and has since been heavily modified by Simon Peyton Jones. license: BSD3 license-file: LICENSE category: Text maintainer: David Terei -homepage: http://github.com/haskell/pretty -bug-reports: http://github.com/haskell/pretty/issues +homepage: https://github.com/haskell/pretty +bug-reports: https://github.com/haskell/pretty/issues stability: Stable build-type: Simple -Extra-Source-Files: README.md CHANGELOG.md -Cabal-Version: >= 1.8 -Tested-with: - GHC ==7.4.2 - || ==7.6.3 - || ==7.8.4 - || ==7.10.3 - || ==8.0.2 - || ==8.2.2 - || ==8.4.4 - || ==8.6.5 - || ==8.8.4 - || ==8.10.3 - || ==9.0.1 + +-- extra-doc-files supported since cabal-version 1.18 +extra-doc-files: + README.md + CHANGELOG.md + +tested-with: + GHC == 9.12.2 + GHC == 9.10.2 + GHC == 9.8.4 + GHC == 9.6.7 + GHC == 9.4.8 + GHC == 9.2.8 + GHC == 9.0.2 + GHC == 8.10.7 + GHC == 8.8.4 + GHC == 8.6.5 + GHC == 8.4.4 + GHC == 8.2.2 + GHC == 8.0.2 source-repository head type: git - location: http://github.com/haskell/pretty.git + location: https://github.com/haskell/pretty.git Library hs-source-dirs: src @@ -46,22 +53,22 @@ Library Text.PrettyPrint.Annotated Text.PrettyPrint.Annotated.HughesPJ Text.PrettyPrint.Annotated.HughesPJClass + build-depends: base >= 4.5 && < 5, deepseq >= 1.1 if impl(ghc) build-depends: ghc-prim + + default-language: Haskell98 extensions: CPP, BangPatterns, DeriveGeneric ghc-options: -Wall -fwarn-tabs Test-Suite test-pretty type: exitcode-stdio-1.0 + main-is: Test.hs hs-source-dirs: tests src - build-depends: base >= 4.5 && < 5, - deepseq >= 1.1, - ghc-prim, - QuickCheck >= 2.5 && <3 - main-is: Test.hs + include-dirs: src/Text/PrettyPrint/Annotated other-modules: Text.PrettyPrint.Annotated.HughesPJ Text.PrettyPrint.HughesPJ @@ -73,15 +80,33 @@ Test-Suite test-pretty UnitPP1 UnitT3911 UnitT32 + + build-depends: base >= 4.5 && < 5, + deepseq >= 1.1, + ghc-prim, + QuickCheck >= 2.5 && <3 + + default-language: Haskell98 extensions: CPP, BangPatterns, DeriveGeneric - include-dirs: src/Text/PrettyPrint/Annotated ghc-options: -rtsopts -with-rtsopts=-K2M benchmark pretty-bench type: exitcode-stdio-1.0 main-is: Bench.hs hs-source-dirs: bench - ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates -O2 -threaded -rtsopts -with-rtsopts=-N1 -with-rtsopts=-s -with-rtsopts=-qg + build-depends: base >= 4.5 && < 5 , criterion , pretty + + ghc-options: + -Wall + -fwarn-tabs + -fwarn-incomplete-uni-patterns + -fwarn-incomplete-record-updates + -O2 + -threaded + -rtsopts + -with-rtsopts=-N1 + -with-rtsopts=-s + -with-rtsopts=-qg From afbea45a7e805597c3aacec69279d749d79c88a2 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Sat, 26 Jul 2025 15:20:22 +0200 Subject: [PATCH 2/9] CI: disable benchmarks again --- .github/workflows/haskell-ci.yml | 2 +- cabal.haskell-ci | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 72e1532..94a1377 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -135,7 +135,7 @@ jobs: HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" - echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" + echo "ARG_BENCH=--disable-benchmarks" >> "$GITHUB_ENV" echo "HEADHACKAGE=false" >> "$GITHUB_ENV" echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" env: diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 8d148fe..761775a 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,2 +1,3 @@ branches: master --- benchmarks: False +installed: +all -pretty +benchmarks: False From 761a55550d6268e6e4d0cd83ceb8a2f7dc2552ef Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Sat, 26 Jul 2025 15:36:35 +0200 Subject: [PATCH 3/9] Complete .gitignore --- .gitignore | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 56911da..7df900c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ dist/ +dist-newstyle/ GNUmakefile dist-install ghc.mk cabal.sandbox.config -.cabal-sandbox -.stack-work +.cabal-sandbox/ +.stack-work/ +*~ From 881b32b629b850d6d5a5aa0866e8d4b681aa0bad Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Sat, 26 Jul 2025 15:37:16 +0200 Subject: [PATCH 4/9] Try fix Haskell CI --- .github/workflows/haskell-ci.yml | 2 +- cabal.haskell-ci | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 94a1377..a98bba2 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -215,7 +215,7 @@ jobs: if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi cat >> cabal.project <> cabal.project.local + $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(pretty|template-haskell)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 761775a..2917b35 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,3 +1,3 @@ branches: master -installed: +all -pretty +installed: +all -pretty -template-haskell benchmarks: False From 82dc23d13bb7c30ceec0e4e043b8cd9896bf3d36 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Sat, 26 Jul 2025 15:37:29 +0200 Subject: [PATCH 5/9] Hand-written CI using cabal --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0eb112c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: Cabal CI +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + name: ${{ matrix.os }} GHC ${{ matrix.ghc }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + ghc: ['9.12'] + + steps: + - uses: actions/checkout@v4 + - uses: haskell-actions/setup@v2 + id: setup + with: + ghc-version: ${{ matrix.ghc }} + + - name: Restore cache + uses: actions/cache/restore@v4 + id: cache + with: + path: ${{ steps.setup.outputs.cabal-store }} + key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}-sha-${{ github.sha }} + + - run: cabal build --dependencies-only + - run: cabal build + - run: cabal build --enable-tests + - run: cabal test + - run: cabal build --enable-tests --enable-benchmarks + - run: cabal bench + + - name: Save cache + uses: actions/cache/save@v4 + if: always() + with: + path: ${{ steps.setup.outputs.cabal-store }} + key: ${{ steps.cache.outputs.cache-primary-key }} From 338b0d6a8b83659f864e7f116171d2e5081cdd16 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Sat, 26 Jul 2025 15:56:14 +0200 Subject: [PATCH 6/9] Haskell CI: disable tests and benchmarks (cyclic build constraints) --- .github/workflows/haskell-ci.yml | 8 +++----- cabal.haskell-ci | 5 ++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index a98bba2..db8d323 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -134,7 +134,7 @@ jobs: echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" - echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" + echo "ARG_TESTS=--disable-tests" >> "$GITHUB_ENV" echo "ARG_BENCH=--disable-benchmarks" >> "$GITHUB_ENV" echo "HEADHACKAGE=false" >> "$GITHUB_ENV" echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" @@ -214,8 +214,9 @@ jobs: if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package pretty" >> cabal.project ; fi if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi cat >> cabal.project <> cabal.project.local + $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(pretty)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -238,9 +239,6 @@ jobs: - name: build run: | $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always - - name: tests - run: | - $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - name: cabal check run: | cd ${PKGDIR_pretty} || false diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 2917b35..9271dbb 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,3 +1,6 @@ branches: master -installed: +all -pretty -template-haskell +installed: +all -pretty +-- Tests and benchmarks do not build due to cycling package dependencies. +-- QuickCheck/containers -> template-haskell -> pretty. benchmarks: False +tests: False From fa36110d9a03870dcff3b362c513cac2ed258557 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Sat, 26 Jul 2025 15:56:58 +0200 Subject: [PATCH 7/9] Cabal CI: disable tests and benchmarks --- .github/workflows/ci.yml | 12 ++++++++---- cabal.project | 6 ++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0eb112c..8560ef4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,10 +32,14 @@ jobs: - run: cabal build --dependencies-only - run: cabal build - - run: cabal build --enable-tests - - run: cabal test - - run: cabal build --enable-tests --enable-benchmarks - - run: cabal bench + + # Cannot build the testsuite because template-haskell depends on pretty + # and containers and QuickCheck depend on template-haskell. + # See also https://github.com/haskell/containers/issues/1156 + # - run: cabal build -c 'QuickCheck -templatehaskell' --enable-tests + # - run: cabal test -c 'QuickCheck -templatehaskell' --enable-tests + # - run: cabal build -c 'QuickCheck -templatehaskell' --enable-tests --enable-benchmarks + # - run: cabal bench -c 'QuickCheck -templatehaskell' --enable-tests --enable-benchmarks - name: Save cache uses: actions/cache/save@v4 diff --git a/cabal.project b/cabal.project index e6fdbad..5226b0e 100644 --- a/cabal.project +++ b/cabal.project @@ -1 +1,7 @@ packages: . + +constraints: QuickCheck -templatehaskell + +-- If we could get rid of template-haskell we could build the testsuite. +-- https://github.com/haskell/containers/issues/1156 +-- constraints: containers -templatehaskell From 3f400e779207704bf8b2b5bd58e3ad637c73ceb2 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Sat, 26 Jul 2025 16:07:46 +0200 Subject: [PATCH 8/9] Fix problems in .cabal file --- pretty.cabal | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pretty.cabal b/pretty.cabal index 93de5eb..a58588b 100644 --- a/pretty.cabal +++ b/pretty.cabal @@ -60,7 +60,7 @@ Library build-depends: ghc-prim default-language: Haskell98 - extensions: CPP, BangPatterns, DeriveGeneric + default-extensions: CPP, BangPatterns, DeriveGeneric ghc-options: -Wall -fwarn-tabs Test-Suite test-pretty @@ -87,7 +87,7 @@ Test-Suite test-pretty QuickCheck >= 2.5 && <3 default-language: Haskell98 - extensions: CPP, BangPatterns, DeriveGeneric + default-extensions: CPP, BangPatterns, DeriveGeneric ghc-options: -rtsopts -with-rtsopts=-K2M benchmark pretty-bench @@ -99,6 +99,7 @@ benchmark pretty-bench , criterion , pretty + default-language: Haskell98 ghc-options: -Wall -fwarn-tabs From 39947dbe45ba176a383d087fdb915bc6f74221af Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Sat, 26 Jul 2025 16:08:02 +0200 Subject: [PATCH 9/9] Extend Cabal CI to windows and macos --- .github/workflows/ci.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8560ef4..7512a2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,5 @@ +# Andreas, 2025-07-26, hand-knitted CI using Cabal + name: Cabal CI on: push: @@ -14,7 +16,27 @@ jobs: strategy: matrix: os: [ubuntu-latest] - ghc: ['9.12'] + ghc: + # - '9.12' # currently subsumed by latest + - '9.10' + - '9.8' + - '9.6' + # - '9.4' # skip intermediate ghc version + # - '9.2' # skip intermediate ghc version + # - '9.0' # skip intermediate ghc version + # - '8.10' # skip intermediate ghc version + # - '8.8' # skip intermediate ghc version + # - '8.6' # skip intermediate ghc version + # - '8.4' # skip intermediate ghc version + # - '8.2' # skip intermediate ghc version + - '8.0' + include: + - os: ubuntu-latest + ghc: latest + - os: macos-latest + ghc: latest + - os: windows-latest + ghc: latest steps: - uses: actions/checkout@v4