Skip to content
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

Support ghc 9.12 #339

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
150 changes: 86 additions & 64 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.16
# version: 0.19.20241202
#
# REGENDATA ("0.16",["github","cabal.project"])
# REGENDATA ("0.19.20241202",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -23,29 +23,34 @@ 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.12.0.20241128
compilerKind: ghc
compilerVersion: 9.12.0.20241128
setup-method: ghcup-prerelease
allow-failure: false
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.1
- compiler: ghc-9.8.4
compilerKind: ghc
compilerVersion: 9.8.1
compilerVersion: 9.8.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.3
- compiler: ghc-9.6.6
compilerKind: ghc
compilerVersion: 9.6.3
compilerVersion: 9.6.6
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.7
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.4.7
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.2
Expand All @@ -56,7 +61,7 @@ jobs:
- compiler: ghc-9.0.1
compilerKind: ghc
compilerVersion: 9.0.1
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.10.7
compilerKind: ghc
Expand All @@ -66,39 +71,58 @@ jobs:
- compiler: ghc-8.8.3
compilerKind: ghc
compilerVersion: 8.8.3
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
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
if [ "${{ matrix.setup-method }}" = ghcup ]; then
mkdir -p "$HOME/.ghcup/bin"
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" || (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.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 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
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"
- 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 }}
HCVER: ${{ matrix.compilerVersion }}
- name: Install GHC (GHCup prerelease)
if: matrix.setup-method == 'ghcup-prerelease'
run: |
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
"$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 @@ -109,28 +133,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
if [ "${{ matrix.setup-method }}" = ghcup ]; then
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
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-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-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))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -157,6 +165,18 @@ jobs:
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
if $HEADHACKAGE; then
cat >> $CABAL_CONFIG <<EOF
repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
secure: True
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
key-threshold: 3
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
EOF
fi
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
Expand All @@ -180,16 +200,16 @@ 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
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/cborg" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/cbor-tool" >> cabal.project
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/serialise" >> cabal.project ; fi
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/binary-serialise-cbor" >> cabal.project ; fi
echo "packages: $GITHUB_WORKSPACE/source/serialise" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/binary-serialise-cbor" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/cborg-json" >> cabal.project
cat cabal.project
- name: sdist
Expand Down Expand Up @@ -217,31 +237,33 @@ jobs:
touch cabal.project.local
echo "packages: ${PKGDIR_cborg}" >> cabal.project
echo "packages: ${PKGDIR_cbor_tool}" >> cabal.project
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo "packages: ${PKGDIR_serialise}" >> cabal.project ; fi
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo "packages: ${PKGDIR_binary_serialise_cbor}" >> cabal.project ; fi
echo "packages: ${PKGDIR_serialise}" >> cabal.project
echo "packages: ${PKGDIR_binary_serialise_cbor}" >> cabal.project
echo "packages: ${PKGDIR_cborg_json}" >> cabal.project
echo "package cborg" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package cbor-tool" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo "package serialise" >> cabal.project ; fi
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo "package binary-serialise-cbor" >> cabal.project ; fi
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
echo "package serialise" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package binary-serialise-cbor" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package cborg-json" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
allow-newer: store-core:text
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(binary-serialise-cbor|cbor-tool|cborg|cborg-json|serialise)$/; }' >> cabal.project.local
if $HEADHACKAGE; then
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
fi
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(binary-serialise-cbor|cbor-tool|cborg|cborg-json|serialise)$/; }' >> 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 All @@ -265,10 +287,10 @@ jobs:
${CABAL} -vnormal check
cd ${PKGDIR_cbor_tool} || false
${CABAL} -vnormal check
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then cd ${PKGDIR_serialise} || false ; fi
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then cd ${PKGDIR_binary_serialise_cbor} || false ; fi
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
cd ${PKGDIR_serialise} || false
${CABAL} -vnormal check
cd ${PKGDIR_binary_serialise_cbor} || false
${CABAL} -vnormal check
cd ${PKGDIR_cborg_json} || false
${CABAL} -vnormal check
- name: haddock
Expand All @@ -279,8 +301,8 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v3
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
8 changes: 6 additions & 2 deletions binary-serialise-cbor/binary-serialise-cbor.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ tested-with:
GHC == 8.10.7,
GHC == 9.0.1,
GHC == 9.2.2,
GHC == 9.4.2
GHC == 9.4.8
GHC == 9.6.6
GHC == 9.8.4
GHC == 9.10.1
GHC == 9.12.1

extra-source-files:
ChangeLog.md
Expand Down Expand Up @@ -51,7 +55,7 @@ library
exposed-modules: Data.Binary.Serialise.CBOR.Read

build-depends:
base >= 4.11 && < 4.21,
base >= 4.11 && < 4.22,
bytestring < 1.0,

cborg == 0.2.*,
Expand Down
36 changes: 33 additions & 3 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,36 @@ packages:
binary-serialise-cbor/
cborg-json/

-- Needed for serialise benchmarks
allow-newer:
store-core:text
if impl (ghc >= 9.12)
allow-newer:
, aeson:ghc-prim
, aeson:template-haskell
, assoc:base
, bifunctors:template-haskell
, bytestring:base
, bytestring:template-haskell
, data-fix:base
, generically:base
, hashable:base
, indexed-traversable:base
, indexed-traversable-instances:base
, integer-conversion:base
, integer-logarithms:base
, integer-logarithms:ghc-prim
, quickcheck-instances:base
, OneTuple:base
, scientific:base
, scientific:template-haskell
, semialign:base
, splitmix:base
, text-short:base
, text-short:ghc-prim
, text-short:template-haskell
, these:base
, th-abstraction:template-haskell
, th-compat:template-haskell
, time-compat:base
, time-compat:time
, unix:time
, unordered-containers:template-haskell
, uuid-types:template-haskell
9 changes: 6 additions & 3 deletions cbor-tool/cbor-tool.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ tested-with:
GHC == 8.10.7,
GHC == 9.0.1,
GHC == 9.2.2,
GHC == 9.4.2,
GHC == 9.6.1
GHC == 9.4.8
GHC == 9.6.6
GHC == 9.8.4
GHC == 9.10.1
GHC == 9.12.1

executable cbor-tool
main-is: Main.hs
other-extensions: CPP, BangPatterns
ghc-options: -Wall
build-depends:
base >=4.11 && <4.21,
base >=4.11 && <4.22,
filepath >=1.0 && <1.6,
aeson >=0.7 && <2.3,
aeson-pretty >=0.8 && <0.9,
Expand Down
Loading
Loading