Skip to content

Commit

Permalink
Merge pull request #82 from iconnect/ghc-9.10
Browse files Browse the repository at this point in the history
Support newer versions of dependencies, change GHC support range to 9.4-9.10
  • Loading branch information
adamgundry authored Aug 22, 2024
2 parents 1a3df4b + dd16e72 commit bbf689a
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 36 deletions.
57 changes: 35 additions & 22 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.15.202211107
# version: 0.19.20240708
#
# REGENDATA ("0.15.202211107",["github","api-tools.cabal"])
# REGENDATA ("0.19.20240708",["github","api-tools.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -23,24 +23,29 @@ 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.4.3
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.4.3
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.5
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.2.5
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.10.7
- compiler: ghc-9.6.6
compilerKind: ghc
compilerVersion: 8.10.7
compilerVersion: 9.6.6
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
fail-fast: false
Expand All @@ -50,10 +55,10 @@ jobs:
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
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)
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -65,11 +70,13 @@ jobs:
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
HC=$HOME/.ghcup/bin/$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=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$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"
Expand Down Expand Up @@ -119,14 +126,14 @@ jobs:
- name: install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > 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
Expand Down Expand Up @@ -154,15 +161,15 @@ jobs:
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(api-tools)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(api-tools)$/; }' >> 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.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand All @@ -186,8 +193,14 @@ jobs:
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --haddock-all $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
uses: actions/cache/save@v4
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
36 changes: 24 additions & 12 deletions api-tools.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: api-tools
Version: 0.10.1.0
Version: 0.10.1.1
Synopsis: DSL for generating API boilerplate and docs
Description: api-tools provides a compact DSL for describing an API.
It uses Template Haskell to generate the
Expand All @@ -11,13 +11,13 @@ Homepage: http://github.com/iconnect/api-tools
License: BSD3
License-file: LICENSE
Author: Chris Dornan <chrisd@irisconnect.co.uk> and Adam Gundry <adam@well-typed.com>
Maintainer: Chris Dornan <chrisd@irisconnect.co.uk> and Adam Gundry <adam@well-typed.com>
Copyright: (c) Iris Connect 2013-2022
Maintainer: Adam Gundry <adam@well-typed.com>
Copyright: (c) Iris Connect 2013-2024
Category: Network, Web, Cloud, Distributed Computing
Build-type: Simple
Extra-source-files: changelog
Cabal-version: >=1.10
Tested-with: GHC == 8.10.7, GHC == 9.2.5, GHC == 9.4.3
Tested-with: GHC == 9.4.8, GHC == 9.6.6, GHC == 9.8.2, GHC == 9.10.1

Source-Repository head
Type: git
Expand All @@ -28,6 +28,11 @@ Source-Repository this
Location: git://github.com/iconnect/api-tools.git
Tag: 0.10.1.0

flag use-attoparsec-aeson
description: Depend on Data.Aeson.Parser from attoparsec-aeson
default: True
manual: False

Library
Hs-Source-Dirs: src

Expand Down Expand Up @@ -78,32 +83,39 @@ Library
Text.Regex

Build-depends:
QuickCheck >= 2.5.1 && < 2.15 ,
aeson >= 0.10 && < 1.6 || >= 2.0 && < 2.2 ,
QuickCheck >= 2.5.1 && < 2.16 ,
aeson-pretty >= 0.1 && < 0.9 ,
array >= 0.4 && < 0.6 ,
attoparsec >= 0.10.4 && < 0.15 ,
base >= 4.9 && < 5 ,
base16-bytestring >= 0.1 && < 1.1 ,
base64-bytestring >= 1.0 && < 1.3 ,
bytestring >= 0.9 && < 0.12 ,
bytestring >= 0.9 && < 0.13 ,
case-insensitive >= 1.0 && < 1.3 ,
cborg >= 0.1.1.0 && < 0.3 ,
containers >= 0.5 && < 0.7 ,
deepseq >= 1.1 && < 1.5 ,
lens >= 3.8.7 && < 5.3 ,
containers >= 0.5 && < 0.8 ,
deepseq >= 1.1 && < 1.6 ,
lens >= 3.8.7 && < 5.4 ,
regex-base >= 0.93 && < 0.95 ,
regex-tdfa >= 1.1.0 && < 1.4 ,
safe >= 0.3.3 && < 0.4 ,
safecopy >= 0.8.1 && < 0.11 ,
scientific >= 0.3 && < 0.4 ,
serialise >= 0.1.0.0 && < 0.3 ,
template-haskell >= 2.7 && < 2.20 ,
text >= 0.11.3 && < 2.1 ,
template-haskell >= 2.7 && < 2.23 ,
text >= 0.11.3 && < 2.2 ,
time >= 1.5.0 && < 1.14 ,
unordered-containers >= 0.2.3.0 && < 0.3 ,
vector >= 0.10.0.1 && < 0.14

if flag(use-attoparsec-aeson)
Build-Depends:
aeson >= 2.2 && < 2.3 ,
attoparsec-aeson >= 2.1 && < 2.3
else:
Build-Depends:
aeson >= 0.10 && < 1.6 || >= 2.0 && < 2.2 ,

Build-tools:
alex,
happy
Expand Down
3 changes: 3 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
-*-change-log-*-

0.10.1.1 Adam Gundry <adam@well-typed.com> August 2024
* Relax dependency bounds and support building on GHC 9.4 through to 9.10

0.10.1.0 Adam Gundry <adam@well-typed.com> March 2023
* Fix a space leak in CBOR encoding
* Add traversalsTool to Data.API.Tools.Traversal
Expand Down
4 changes: 3 additions & 1 deletion src/Data/API/TH/Compat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ module Data.API.TH.Compat where

import Language.Haskell.TH

#if MIN_VERSION_template_haskell(2,17,0)
#if MIN_VERSION_template_haskell(2,21,0)
type TyVarBndr' = TyVarBndr BndrVis
#elif MIN_VERSION_template_haskell(2,17,0)
type TyVarBndr' = TyVarBndr ()
#else
type TyVarBndr' = TyVarBndr
Expand Down
4 changes: 3 additions & 1 deletion tests/Data/API/Test/JSON.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ basicValueDecoding = sequence_ [ help (JS.String "12") (12 :: Int) True
-- | Test that the correct errors are generated for bad JSON data
errorDecoding :: [TestTree]
errorDecoding = [ help "not enough input" "" (proxy :: Int)
#if MIN_VERSION_aeson(0,10,0)
#if MIN_VERSION_aeson(2,2,0)
[(SyntaxError "Unexpected end-of-input, expecting JSON value", [])]
#elif MIN_VERSION_aeson(0,10,0)
[(SyntaxError "Error in $: not enough input", [])]
#else
[(SyntaxError "not enough input", [])]
Expand Down

0 comments on commit bbf689a

Please sign in to comment.