Skip to content

Commit

Permalink
Merge pull request #156 from well-typed/edsko/ghc-9.6
Browse files Browse the repository at this point in the history
Support ghc 9.6
  • Loading branch information
edsko authored Jul 2, 2024
2 parents 6323af1 + 21bf268 commit 0ffd1fc
Show file tree
Hide file tree
Showing 97 changed files with 336 additions and 2,972 deletions.
94 changes: 36 additions & 58 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.5
# version: 0.19.20240514
#
# REGENDATA ("0.16.5",["github","cabal.project"])
# REGENDATA ("0.19.20240514",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -27,57 +27,42 @@ 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.5
- compiler: ghc-9.6.4
compilerKind: ghc
compilerVersion: 9.4.5
compilerVersion: 9.6.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.8
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.2.8
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.0.2
- compiler: ghc-9.2.8
compilerKind: ghc
compilerVersion: 9.0.2
compilerVersion: 9.2.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.10.7
compilerKind: ghc
compilerVersion: 8.10.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.8.4
compilerKind: ghc
compilerVersion: 8.8.4
setup-method: hvr-ppa
allow-failure: false
fail-fast: false
steps:
- name: apt
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
mkdir -p "$HOME/.ghcup/bin"
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.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -89,20 +74,13 @@ jobs:
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
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.10.2.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 @@ -161,22 +139,22 @@ jobs:
- name: install cabal-docspec
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20230517/cabal-docspec-0.0.0.20230517-x86_64-linux.xz > cabal-docspec.xz
echo '3b31bbe463ad4d671abbc103db49628562ec48a6604cab278207b5b6acd21ed7 cabal-docspec.xz' | sha256sum -c -
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20240414/cabal-docspec-0.0.0.20240414-x86_64-linux.xz > cabal-docspec.xz
echo '2d18a3f79619e8ec5f11870f926f6dc2616e02a6c889315b7f82044b95a1adb9 cabal-docspec.xz' | sha256sum -c -
xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
rm -f cabal-docspec.xz
chmod a+x $HOME/.cabal/bin/cabal-docspec
cabal-docspec --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/large-generics" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/large-records" >> cabal.project
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/large-records-benchmarks" >> cabal.project ; fi
if [ $((HCNUMVER < 90200)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/large-records-benchmarks" >> cabal.project ; fi
echo "packages: $GITHUB_WORKSPACE/source/large-anon" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/beam-large-records" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/typelet" >> cabal.project
Expand Down Expand Up @@ -208,16 +186,16 @@ jobs:
touch cabal.project.local
echo "packages: ${PKGDIR_large_generics}" >> cabal.project
echo "packages: ${PKGDIR_large_records}" >> cabal.project
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then echo "packages: ${PKGDIR_large_records_benchmarks}" >> cabal.project ; fi
if [ $((HCNUMVER < 90200)) -ne 0 ] ; then echo "packages: ${PKGDIR_large_records_benchmarks}" >> cabal.project ; fi
echo "packages: ${PKGDIR_large_anon}" >> cabal.project
echo "packages: ${PKGDIR_beam_large_records}" >> cabal.project
echo "packages: ${PKGDIR_typelet}" >> cabal.project
echo "package large-generics" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package large-records" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then echo "package large-records-benchmarks" >> cabal.project ; fi
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER < 90200)) -ne 0 ] ; then echo "package large-records-benchmarks" >> cabal.project ; fi
if [ $((HCNUMVER < 90200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
echo "package large-anon" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package beam-large-records" >> cabal.project
Expand All @@ -228,19 +206,19 @@ jobs:
source-repository-package
type: git
location: https://github.com/well-typed/beam
tag: f13fedc299727b2706f26cdfeff3913923cb1a79
tag: 57a12e68727c027f0f1c25752f8c5704ddbe1516
subdir: beam-core
source-repository-package
type: git
location: https://github.com/well-typed/beam
tag: f13fedc299727b2706f26cdfeff3913923cb1a79
tag: 57a12e68727c027f0f1c25752f8c5704ddbe1516
subdir: beam-migrate
source-repository-package
type: git
location: https://github.com/well-typed/beam
tag: f13fedc299727b2706f26cdfeff3913923cb1a79
tag: 57a12e68727c027f0f1c25752f8c5704ddbe1516
subdir: beam-sqlite
package large-generics
Expand All @@ -261,15 +239,15 @@ jobs:
package typelet
ghc-options: -Werror
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(beam-large-records|large-anon|large-generics|large-records|large-records-benchmarks|typelet)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(beam-large-records|large-anon|large-generics|large-records|large-records-benchmarks|typelet)$/; }' >> 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 @@ -289,8 +267,8 @@ jobs:
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
- name: docspec
run: |
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then cabal-docspec $ARG_COMPILER ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then cabal-docspec $ARG_COMPILER ; fi
- name: haddock
run: |
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
Expand All @@ -299,7 +277,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
4 changes: 2 additions & 2 deletions beam-large-records/beam-large-records.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ author: Edsko de Vries
maintainer: edsko@well-typed.com
category: Database
extra-source-files: CHANGELOG.md
tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.5
tested-with: GHC ==8.10.7 || ==9.2.8 || ==9.4.8 || ==9.6.4

source-repository head
type: git
Expand All @@ -31,7 +31,7 @@ library
Data.Record.Beam.ZipDatabase
Data.Record.Beam.ZipTables
build-depends:
base >= 4.13 && < 4.18
base >= 4.14 && < 4.19
, beam-core >= 0.9
, large-generics
, microlens
Expand Down
3 changes: 1 addition & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ packages: large-generics
source-repository-package
type: git
location: https://github.com/well-typed/beam
tag: f13fedc299727b2706f26cdfeff3913923cb1a79
tag: 57a12e68727c027f0f1c25752f8c5704ddbe1516
subdir: beam-core beam-migrate beam-sqlite

-- enable for GHC head
Expand All @@ -33,7 +33,6 @@ package large-records-benchmarks

package large-anon
tests: True
ghc-options: -dcore-lint

package beam-large-records
tests: True
Expand Down
5 changes: 5 additions & 0 deletions large-anon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Revision history for large-anon

## 0.3.1 -- 2024-05-30

* Support ghc 9.6 (and drop ghc <= 8.8)
[together with Gabriele Sales]

## 0.3 -- 2023-07-04

* Critical bugfix (#146): incremental record construction was fundamentally
Expand Down
19 changes: 10 additions & 9 deletions large-anon/large-anon.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: large-anon
version: 0.3.0
version: 0.3.1
synopsis: Scalable anonymous records
description: The @large-anon@ package provides support for anonymous
records in Haskell, with a focus on compile-time (and
Expand All @@ -12,7 +12,7 @@ maintainer: edsko@well-typed.com
category: Records
extra-source-files: CHANGELOG.md
test/Test/Sanity/RebindableSyntax/Tests.hs
tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.5
tested-with: GHC ==8.10.7 || ==9.2.8 || ==9.4.8 || ==9.6.4

library
exposed-modules:
Expand Down Expand Up @@ -70,15 +70,15 @@ library
Data.Record.Anon.Internal.Plugin.Source.Options

build-depends:
base >= 4.13 && < 4.18
, aeson >= 1.4.4 && < 2.2
, containers >= 0.6.2 && < 0.7
, deepseq >= 1.4.4 && < 1.5
, ghc-tcplugin-api >= 0.10 && < 0.11
base >= 4.14 && < 4.19
, aeson >= 1.4.4 && < 2.3
, containers >= 0.6.2 && < 0.8
, deepseq >= 1.4.4 && < 1.6
, ghc-tcplugin-api >= 0.11 && < 0.12
, hashable >= 1.3 && < 1.5
, mtl >= 2.2.1 && < 2.3
, mtl >= 2.2.1 && < 2.4
, optics-core >= 0.3 && < 0.5
, primitive >= 0.8 && < 0.9
, primitive >= 0.8 && < 0.10
, record-hasfield >= 1.0 && < 1.1
, sop-core >= 0.5 && < 0.6
, syb >= 0.7 && < 0.8
Expand Down Expand Up @@ -184,6 +184,7 @@ test-suite test-large-anon
-Wredundant-constraints
-Wno-unticked-promoted-constructors
-fno-show-valid-hole-fits
-dcore-lint

-- Not sure why, but ghc warns about record-hasfield being unused,
-- despite it actually being required. So for now we just disable this check.
Expand Down
8 changes: 4 additions & 4 deletions large-anon/src/Data/Record/Anon/Advanced.hs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ applyPending = A.applyPending
-- absentField r = get #c r
-- :}
-- ...
-- ...No instance for (RowHasField "c"...
-- ...No instance for...RowHasField "c"...
-- ...
--
-- Type mismatches will result in regular type errors:
Expand All @@ -226,7 +226,7 @@ applyPending = A.applyPending
-- unknownField r = get #b r
-- :}
-- ...
-- ...No instance for (RowHasField "b"...
-- ...No instance for...RowHasField "b"...
-- ...
--
-- (Note that @x@ here is a variable, not a string.) It is important that the
Expand Down Expand Up @@ -280,7 +280,7 @@ set = A.set
-- example = project
-- :}
-- ...
-- ...No instance for (SubRow...
-- ...No instance for...SubRow...
-- ...
--
-- Type inference will work through projections: field types are unified based
Expand Down Expand Up @@ -347,7 +347,7 @@ lens = A.lens
-- example r = get #b r
-- :}
-- ...
-- ...No instance for (RowHasField "b"...
-- ...No instance for...RowHasField "b"...
-- ...
merge :: Record f r -> Record f r' -> Record f (Merge r r')
merge = A.merge
Expand Down
2 changes: 1 addition & 1 deletion large-anon/src/Data/Record/Anon/Internal/Core/FieldName.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ instance Show FieldName where
showString "fromString " . showsPrec 11 (fieldNameLabel n)

instance Outputable FieldName where
ppr = ppr . fieldNameLabel
ppr = pprString . fieldNameLabel


Loading

0 comments on commit 0ffd1fc

Please sign in to comment.