Skip to content

Support GHC 9.12 #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 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.19.20240708
# version: 0.19.20250115
#
# REGENDATA ("0.19.20240708",["github","cabal.project"])
# REGENDATA ("0.19.20250115",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -28,6 +28,11 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.12.1
compilerKind: ghc
compilerVersion: 9.12.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.10.1
Expand Down Expand Up @@ -85,15 +90,29 @@ jobs:
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 libtinfo5 libnuma-dev
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.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:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -104,21 +123,12 @@ jobs:
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
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"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$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=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand Down Expand Up @@ -234,8 +244,8 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v4
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
3 changes: 1 addition & 2 deletions haskell-src-meta/examples/HsHere.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module HsHere

import qualified Control.Monad.Fail as Fail
import Data.Generics (Data)
import Data.Typeable (Typeable)
import Language.Haskell.Meta (parseExp, parsePat)
import Language.Haskell.Meta.Utils (cleanNames)
import Language.Haskell.TH.Lib hiding (parensP)
Expand All @@ -42,7 +41,7 @@ data Here
= CodeH Exp
| TextH String
| ManyH [Here]
deriving (Eq,Show,Data,Typeable)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 9.12, -Wderiving-typeable has been added to -Wall.

deriving (Eq,Show,Data)

-- | Example:
--
Expand Down
3 changes: 1 addition & 2 deletions haskell-src-meta/examples/SKI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module SKI

import qualified Control.Monad.Fail as Fail
import Data.Generics (Data)
import Data.Typeable (Typeable)
import Language.Haskell.Meta (parseExp, parsePat)
import Language.Haskell.Meta.Utils (cleanNames, ppDoc, unsafeRunQ)
import Language.Haskell.TH.Lib hiding (parensP)
Expand All @@ -40,7 +39,7 @@ quoteDecNotImplemented = fail . ("dec quoter not implemented: " ++ )


data SKI = S | K | I | E Exp | SKI :$ SKI
deriving (Eq,Data,Typeable)
deriving (Eq,Data)

run :: String -> [SKI]
run = fmap eval . fst . parse
Expand Down
4 changes: 2 additions & 2 deletions haskell-src-meta/haskell-src-meta.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ author: Matt Morrow
copyright: (c) Matt Morrow
maintainer: [email protected]
bug-reports: https://github.com/haskell-party/haskell-src-meta/issues
tested-with: 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.2, GHC == 9.4.1, GHC == 9.6.1, GHC == 9.8.1, GHC == 9.10.1
tested-with: 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.2, GHC == 9.4.1, GHC == 9.6.1, GHC == 9.8.1, GHC == 9.10.1, GHC == 9.12.1
synopsis: Parse source to template-haskell abstract syntax.
description: The translation from haskell-src-exts abstract syntax
to template-haskell abstract syntax isn't 100% complete yet.
Expand All @@ -22,7 +22,7 @@ library
haskell-src-exts >= 1.21 && < 1.24,
pretty >= 1.0 && < 1.2,
syb >= 0.1 && < 0.8,
template-haskell >= 2.12 && < 2.23,
template-haskell >= 2.12 && < 2.24,
th-orphans >= 0.12 && < 0.14

hs-source-dirs: src
Expand Down
8 changes: 8 additions & 0 deletions haskell-src-meta/src/Language/Haskell/Meta/Extensions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,14 @@ fromExtension e = case e of
TH.ListTuplePuns -> Nothing
#endif

-- 2.23.0 ---------------------------------------

#if MIN_VERSION_template_haskell(2,23,0)
TH.MultilineStrings -> Nothing
TH.NamedDefaults -> Nothing
TH.OrPatterns -> Nothing
#endif

-- NB: when adding a case here, you may also need to update `toExtension`


Expand Down