Skip to content

Commit

Permalink
Add support for GHC 9.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
christiaanb committed May 22, 2024
1 parent b737434 commit bcfb186
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 28 deletions.
45 changes: 25 additions & 20 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-natnormalise.cabal"])
# REGENDATA ("0.19.20240514",["github","ghc-typelits-natnormalise.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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 }}
Expand All @@ -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))')
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -215,15 +220,15 @@ jobs:
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(ghc-typelits-natnormalise)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(ghc-typelits-natnormalise)$/; }' >> 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: restore cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand Down Expand Up @@ -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 }}
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog for the [`ghc-typelits-natnormalise`](http://hackage.haskell.org/package/ghc-typelits-natnormalise) package

## 0.7.10 *May 22nd 2024*
* Support for GHC 9.10.1

## 0.7.9 *October 10th 2023*
* Support for GHC 9.8.1

Expand Down
10 changes: 5 additions & 5 deletions ghc-typelits-natnormalise.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: ghc-typelits-natnormalise
version: 0.7.9
version: 0.7.10
synopsis: GHC typechecker plugin for types of kind GHC.TypeLits.Nat
description:
A type checker plugin for GHC that can solve /equalities/ and /inequalities/
Expand Down Expand Up @@ -50,7 +50,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
type: git
Expand All @@ -67,8 +67,8 @@ library
GHC.TypeLits.Normalise.SOP,
GHC.TypeLits.Normalise.Unify
build-depends: base >=4.9 && <5,
containers >=0.5.7.1 && <0.7,
ghc >=8.0.1 && <9.10,
containers >=0.5.7.1 && <0.8,
ghc >=8.0.1 && <9.12,
ghc-tcplugins-extra >=0.3.1,
transformers >=0.5.2.0 && < 0.7
if impl(ghc >= 9.0.0)
Expand All @@ -80,7 +80,7 @@ library
hs-source-dirs: src-pre-ghc-9.4
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: CPP
LambdaCase
Expand Down
43 changes: 40 additions & 3 deletions tests/ErrorTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,24 @@ testProxy10 :: Proxy (a :: Nat) -> Proxy (a + 2) -> ()
testProxy10 = proxyInEq'

testProxy10Errors =
#if __GLASGOW_HASKELL__ >= 906
#if __GLASGOW_HASKELL__ >= 910
[$(do localeEncoding <- runIO (getLocaleEncoding)
if textEncodingName localeEncoding == textEncodingName utf8
then litE $ stringL "Couldn't match type ‘ghc-internal-9.1001.0:GHC.Internal.Data.Type.Ord.OrdCond"
else litE $ stringL "Couldn't match type `ghc-internal-9.1001.0:GHC.Internal.Data.Type.Ord.OrdCond"
)
,$(do localeEncoding <- runIO (getLocaleEncoding)
if textEncodingName localeEncoding == textEncodingName utf8
then litE $ stringL "(CmpNat a (a + 2)) True True False’"
else litE $ stringL "(CmpNat a (a + 2)) True True False'"
)
,$(do localeEncoding <- runIO (getLocaleEncoding)
if textEncodingName localeEncoding == textEncodingName utf8
then litE $ stringL "with ‘False"
else litE $ stringL "with `False"
)
]
#elif __GLASGOW_HASKELL__ >= 906
[$(do localeEncoding <- runIO (getLocaleEncoding)
if textEncodingName localeEncoding == textEncodingName utf8
then litE $ stringL "Couldn't match type ‘Data.Type.Ord.OrdCond"
Expand Down Expand Up @@ -239,7 +256,10 @@ testProxy11 = proxyInEq'
testProxy11Errors =
[$(do localeEncoding <- runIO (getLocaleEncoding)
if textEncodingName localeEncoding == textEncodingName utf8
#if __GLASGOW_HASKELL__ >= 906
#if __GLASGOW_HASKELL__ >= 910
then litE $ stringL "Couldn't match type ‘True’ with ‘False’"
else litE $ stringL "Couldn't match type `True' with `False'"
#elif __GLASGOW_HASKELL__ >= 906
then litE $ stringL "Couldn't match type ‘True’ with ‘False’"
else litE $ stringL "Couldn't match type True with False"
#else
Expand Down Expand Up @@ -314,7 +334,24 @@ testProxy14 :: Proxy (2*a) -> Proxy (4*a) -> ()
testProxy14 = proxyInEq'

testProxy14Errors =
#if __GLASGOW_HASKELL__ >= 906
#if __GLASGOW_HASKELL__ >= 910
[$(do localeEncoding <- runIO (getLocaleEncoding)
if textEncodingName localeEncoding == textEncodingName utf8
then litE $ stringL "Couldn't match type ‘ghc-internal-9.1001.0:GHC.Internal.Data.Type.Ord.OrdCond"
else litE $ stringL "Couldn't match type `ghc-internal-9.1001.0:GHC.Internal.Data.Type.Ord.OrdCond"
)
,$(do localeEncoding <- runIO (getLocaleEncoding)
if textEncodingName localeEncoding == textEncodingName utf8
then litE $ stringL "(CmpNat (2 * a) (4 * a)) True True False’"
else litE $ stringL "(CmpNat (2 * a) (4 * a)) True True False'"
)
,$(do localeEncoding <- runIO (getLocaleEncoding)
if textEncodingName localeEncoding == textEncodingName utf8
then litE $ stringL "with ‘False"
else litE $ stringL "with `False"
)
]
#elif __GLASGOW_HASKELL__ >= 906
[$(do localeEncoding <- runIO (getLocaleEncoding)
if textEncodingName localeEncoding == textEncodingName utf8
then litE $ stringL "Couldn't match type ‘Data.Type.Ord.OrdCond"
Expand Down

0 comments on commit bcfb186

Please sign in to comment.