From 12cb18df113a570c24812a931817e96810733f6f Mon Sep 17 00:00:00 2001 From: Christiaan Baaij Date: Wed, 22 May 2024 22:34:44 +0200 Subject: [PATCH] Add support for GHC 9.10.1 --- .github/workflows/haskell-ci.yml | 45 ++++++++++++++++++-------------- CHANGELOG.md | 7 +++-- ghc-typelits-extra.cabal | 12 ++++----- tests-ghc-9.4/ErrorTests.hs | 12 +++++++++ 4 files changed, 46 insertions(+), 30 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 1a7b6ca..7ba529f 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.17.20231010 +# version: 0.19.20240514 # -# REGENDATA ("0.17.20231010",["github","ghc-typelits-extra.cabal"]) +# REGENDATA ("0.19.20240514",["github","ghc-typelits-extra.cabal"]) # name: Haskell-CI on: @@ -23,14 +23,19 @@ jobs: timeout-minutes: 60 container: - image: buildpack-deps:bionic + image: buildpack-deps:jammy continue-on-error: ${{ matrix.allow-failure }} strategy: matrix: include: - - compiler: ghc-9.8.1 + - compiler: ghc-9.10.1 compilerKind: ghc - compilerVersion: 9.8.1 + compilerVersion: 9.10.1 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.8.2 + compilerKind: ghc + compilerVersion: 9.8.2 setup-method: ghcup allow-failure: false - compiler: ghc-9.6.3 @@ -61,27 +66,27 @@ jobs: - compiler: ghc-8.8.4 compilerKind: ghc compilerVersion: 8.8.4 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.6.5 compilerKind: ghc compilerVersion: 8.6.5 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.4.4 compilerKind: ghc compilerVersion: 8.4.4 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false fail-fast: false steps: @@ -91,18 +96,18 @@ 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.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" "$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) + "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.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.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) fi env: HCKIND: ${{ matrix.compilerKind }} @@ -122,13 +127,13 @@ jobs: echo "HC=$HC" >> "$GITHUB_ENV" echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.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-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.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))') @@ -187,7 +192,7 @@ jobs: chmod a+x $HOME/.cabal/bin/cabal-plan cabal-plan --version - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: source - name: initial cabal.project for sdist @@ -215,7 +220,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 /^(ghc-typelits-extra)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -223,7 +228,7 @@ jobs: $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all cabal-plan - name: restore cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store @@ -253,7 +258,7 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v3 + uses: actions/cache/save@v4 if: always() with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2954a5e..e9a58ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,9 @@ # Changelog for the [`ghc-typelits-extra`](http://hackage.haskell.org/package/ghc-typelits-extra) package -# Unreleased -* Fix faulty lookup for `Mod` and `Div` in GHC >= 9.2 - -# 0.4.7 +# 0.4.7 *May 22nd, 2024* +* Add support for GHC 9.10.1 * Fix Plugin silently fails when normalizing <= in GHC 9.4+ [#50](https://github.com/clash-lang/ghc-typelits-extra/issues/50) +* Fix faulty lookup for `Mod` and `Div` in GHC >= 9.2 # 0.4.6 *October 10th 2023* * Support for GHC-9.8.1 diff --git a/ghc-typelits-extra.cabal b/ghc-typelits-extra.cabal index 40acd71..5503ccc 100644 --- a/ghc-typelits-extra.cabal +++ b/ghc-typelits-extra.cabal @@ -49,7 +49,7 @@ extra-source-files: README.md cabal-version: >=1.10 tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, - GHC == 9.4.7, GHC == 9.6.3, GHC == 9.8.1 + GHC == 9.4.7, GHC == 9.6.3, GHC == 9.8.2, GHC == 9.10.1 source-repository head @@ -68,8 +68,8 @@ library other-modules: GHC.TypeLits.Extra.Solver.Unify GHC.TypeLits.Extra.Solver.Operations build-depends: base >= 4.8 && <5, - containers >= 0.5.7.1 && <0.7, - ghc >= 7.10 && <9.10, + containers >= 0.5.7.1 && <0.8, + ghc >= 7.10 && <9.12, ghc-prim >= 0.5 && <1.0, ghc-tcplugins-extra >= 0.3.1, ghc-typelits-knownnat >= 0.7.2 && <0.8, @@ -82,9 +82,9 @@ library hs-source-dirs: src if impl(ghc >= 8.0) && impl(ghc < 9.4) hs-source-dirs: src-pre-ghc-9.4 - if impl(ghc >= 9.4) && impl(ghc < 9.10) + if impl(ghc >= 9.4) && impl(ghc < 9.12) hs-source-dirs: src-ghc-9.4 - build-depends: template-haskell >= 2.17 && <2.22 + build-depends: template-haskell >= 2.17 && <2.23 default-language: Haskell2010 other-extensions: DataKinds FlexibleInstances @@ -116,7 +116,7 @@ test-suite test-ghc-typelits-extra hs-source-dirs: tests if impl(ghc >= 8.0) && impl(ghc < 9.4) hs-source-dirs: tests-pre-ghc-9.4 - if impl(ghc >= 9.4) && impl(ghc < 9.10) + if impl(ghc >= 9.4) && impl(ghc < 9.12) hs-source-dirs: tests-ghc-9.4 default-language: Haskell2010 other-extensions: DataKinds diff --git a/tests-ghc-9.4/ErrorTests.hs b/tests-ghc-9.4/ErrorTests.hs index 4cc5fbe..2bed8e3 100644 --- a/tests-ghc-9.4/ErrorTests.hs +++ b/tests-ghc-9.4/ErrorTests.hs @@ -212,14 +212,26 @@ testFail23Errors = ["Couldn't match type ‘'True’ with ‘'False’"] testFail24Errors = +#if __GLASGOW_HASKELL__ >= 910 + ["Couldn't match type ‘ghc-internal-9.1001.0:GHC.Internal.Data.Type.Ord.OrdCond" + ,"(CmpNat z (Max x y)) 'True 'True 'False’" + ,"with ‘'True’"] +#else ["Couldn't match type ‘Data.Type.Ord.OrdCond" ,"(CmpNat z (Max x y)) 'True 'True 'False’" ,"with ‘'True’"] +#endif testFail25Errors = +#if __GLASGOW_HASKELL__ >= 910 + ["Couldn't match type ‘ghc-internal-9.1001.0:GHC.Internal.Data.Type.Ord.OrdCond" + ,"(CmpNat (x + 1) (Max x y)) 'True 'True 'False’" + ,"with ‘'True’"] +#else ["Couldn't match type ‘Data.Type.Ord.OrdCond" ,"(CmpNat (x + 1) (Max x y)) 'True 'True 'False’" ,"with ‘'True’"] +#endif testFail26Errors = #if __GLASGOW_HASKELL__ >= 906