Skip to content

Commit 204cf4d

Browse files
committed
Drop support for pre-8.0 GHCs
1 parent c2e4802 commit 204cf4d

28 files changed

+115
-896
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 40 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.19.20240316
11+
# version: 0.19.20241202
1212
#
13-
# REGENDATA ("0.19.20240316",["github","--config=cabal.haskell-ci","cabal.project"])
13+
# REGENDATA ("0.19.20241202",["github","--config=cabal.haskell-ci","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -23,24 +23,24 @@ jobs:
2323
timeout-minutes:
2424
60
2525
container:
26-
image: buildpack-deps:bionic
26+
image: buildpack-deps:jammy
2727
continue-on-error: ${{ matrix.allow-failure }}
2828
strategy:
2929
matrix:
3030
include:
31-
- compiler: ghc-9.10.0.20240313
31+
- compiler: ghc-9.10.1
3232
compilerKind: ghc
33-
compilerVersion: 9.10.0.20240313
33+
compilerVersion: 9.10.1
3434
setup-method: ghcup
3535
allow-failure: false
36-
- compiler: ghc-9.8.2
36+
- compiler: ghc-9.8.4
3737
compilerKind: ghc
38-
compilerVersion: 9.8.2
38+
compilerVersion: 9.8.4
3939
setup-method: ghcup
4040
allow-failure: false
41-
- compiler: ghc-9.6.4
41+
- compiler: ghc-9.6.6
4242
compilerKind: ghc
43-
compilerVersion: 9.6.4
43+
compilerVersion: 9.6.6
4444
setup-method: ghcup
4545
allow-failure: false
4646
- compiler: ghc-9.4.8
@@ -66,81 +66,53 @@ jobs:
6666
- compiler: ghc-8.8.4
6767
compilerKind: ghc
6868
compilerVersion: 8.8.4
69-
setup-method: hvr-ppa
69+
setup-method: ghcup
7070
allow-failure: false
7171
- compiler: ghc-8.6.5
7272
compilerKind: ghc
7373
compilerVersion: 8.6.5
74-
setup-method: hvr-ppa
74+
setup-method: ghcup
7575
allow-failure: false
7676
- compiler: ghc-8.4.4
7777
compilerKind: ghc
7878
compilerVersion: 8.4.4
79-
setup-method: hvr-ppa
79+
setup-method: ghcup
8080
allow-failure: false
8181
- compiler: ghc-8.2.2
8282
compilerKind: ghc
8383
compilerVersion: 8.2.2
84-
setup-method: hvr-ppa
84+
setup-method: ghcup
8585
allow-failure: false
8686
- compiler: ghc-8.0.2
8787
compilerKind: ghc
8888
compilerVersion: 8.0.2
89-
setup-method: hvr-ppa
90-
allow-failure: false
91-
- compiler: ghc-7.10.3
92-
compilerKind: ghc
93-
compilerVersion: 7.10.3
94-
setup-method: hvr-ppa
95-
allow-failure: false
96-
- compiler: ghc-7.8.4
97-
compilerKind: ghc
98-
compilerVersion: 7.8.4
99-
setup-method: hvr-ppa
100-
allow-failure: false
101-
- compiler: ghc-7.6.3
102-
compilerKind: ghc
103-
compilerVersion: 7.6.3
104-
setup-method: hvr-ppa
105-
allow-failure: false
106-
- compiler: ghc-7.4.2
107-
compilerKind: ghc
108-
compilerVersion: 7.4.2
109-
setup-method: hvr-ppa
110-
allow-failure: false
111-
- compiler: ghc-7.2.2
112-
compilerKind: ghc
113-
compilerVersion: 7.2.2
114-
setup-method: hvr-ppa
115-
allow-failure: false
116-
- compiler: ghc-7.0.4
117-
compilerKind: ghc
118-
compilerVersion: 7.0.4
119-
setup-method: hvr-ppa
89+
setup-method: ghcup
12090
allow-failure: false
12191
fail-fast: false
12292
steps:
123-
- name: apt
93+
- name: apt-get install
12494
run: |
12595
apt-get update
126-
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
127-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
128-
mkdir -p "$HOME/.ghcup/bin"
129-
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
130-
chmod a+x "$HOME/.ghcup/bin/ghcup"
131-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
132-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
133-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
134-
else
135-
apt-add-repository -y 'ppa:hvr/ghc'
136-
apt-get update
137-
apt-get install -y "$HCNAME"
138-
mkdir -p "$HOME/.ghcup/bin"
139-
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
140-
chmod a+x "$HOME/.ghcup/bin/ghcup"
141-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
142-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
143-
fi
96+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
97+
- name: Install GHCup
98+
run: |
99+
mkdir -p "$HOME/.ghcup/bin"
100+
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
101+
chmod a+x "$HOME/.ghcup/bin/ghcup"
102+
- name: Install cabal-install
103+
run: |
104+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
105+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
106+
- name: Install GHC (GHCup)
107+
if: matrix.setup-method == 'ghcup'
108+
run: |
109+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
110+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
111+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
112+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
113+
echo "HC=$HC" >> "$GITHUB_ENV"
114+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
115+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
144116
env:
145117
HCKIND: ${{ matrix.compilerKind }}
146118
HCNAME: ${{ matrix.compiler }}
@@ -151,30 +123,12 @@ jobs:
151123
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
152124
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
153125
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
154-
HCDIR=/opt/$HCKIND/$HCVER
155-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
156-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
157-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
158-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
159-
echo "HC=$HC" >> "$GITHUB_ENV"
160-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
161-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
162-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
163-
else
164-
HC=$HCDIR/bin/$HCKIND
165-
echo "HC=$HC" >> "$GITHUB_ENV"
166-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
167-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
168-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
169-
fi
170-
171126
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
172127
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
173128
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
174129
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
175-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
130+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
176131
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
177-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
178132
env:
179133
HCKIND: ${{ matrix.compilerKind }}
180134
HCNAME: ${{ matrix.compiler }}
@@ -201,18 +155,6 @@ jobs:
201155
repository hackage.haskell.org
202156
url: http://hackage.haskell.org/
203157
EOF
204-
if $HEADHACKAGE; then
205-
cat >> $CABAL_CONFIG <<EOF
206-
repository head.hackage.ghc.haskell.org
207-
url: https://ghc.gitlab.haskell.org/head.hackage/
208-
secure: True
209-
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
210-
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
211-
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
212-
key-threshold: 3
213-
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
214-
EOF
215-
fi
216158
cat >> $CABAL_CONFIG <<EOF
217159
program-default-options
218160
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -236,7 +178,7 @@ jobs:
236178
chmod a+x $HOME/.cabal/bin/cabal-plan
237179
cabal-plan --version
238180
- name: checkout
239-
uses: actions/checkout@v3
181+
uses: actions/checkout@v4
240182
with:
241183
path: source
242184
- name: initial cabal.project for sdist
@@ -266,18 +208,15 @@ jobs:
266208
package deriving-compat
267209
ghc-options: -Werror
268210
EOF
269-
if $HEADHACKAGE; then
270-
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
271-
fi
272-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(deriving-compat)$/; }' >> cabal.project.local
211+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(deriving-compat)$/; }' >> cabal.project.local
273212
cat cabal.project
274213
cat cabal.project.local
275214
- name: dump install plan
276215
run: |
277216
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
278217
cabal-plan
279218
- name: restore cache
280-
uses: actions/cache/restore@v3
219+
uses: actions/cache/restore@v4
281220
with:
282221
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
283222
path: ~/.cabal/store
@@ -300,8 +239,8 @@ jobs:
300239
run: |
301240
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
302241
- name: save cache
303-
uses: actions/cache/save@v3
304242
if: always()
243+
uses: actions/cache/save@v4
305244
with:
306245
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
307246
path: ~/.cabal/store

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### next [????.??.??]
2+
* Drop support for pre-8.0 versions of GHC.
3+
14
### 0.6.6 [2024.03.19]
25
* Support building with `template-haskell-2.22.*` (GHC 9.10).
36

cabal.haskell-ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
distribution: bionic
1+
distribution: jammy
22
no-tests-no-benchmarks: False
33
unconstrained: False
44
local-ghc-options: -Werror

deriving-compat.cabal

Lines changed: 13 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,7 @@ copyright: (C) 2015-2017 Ryan Scott
7878
category: Compatibility
7979
build-type: Simple
8080
extra-source-files: CHANGELOG.md, README.md
81-
tested-with: GHC == 7.0.4
82-
, GHC == 7.2.2
83-
, GHC == 7.4.2
84-
, GHC == 7.6.3
85-
, GHC == 7.8.4
86-
, GHC == 7.10.3
87-
, GHC == 8.0.2
81+
tested-with: GHC == 8.0.2
8882
, GHC == 8.2.2
8983
, GHC == 8.4.4
9084
, GHC == 8.6.5
@@ -93,30 +87,15 @@ tested-with: GHC == 7.0.4
9387
, GHC == 9.0.2
9488
, GHC == 9.2.8
9589
, GHC == 9.4.8
96-
, GHC == 9.6.4
97-
, GHC == 9.8.2
90+
, GHC == 9.6.6
91+
, GHC == 9.8.4
9892
, GHC == 9.10.1
9993
cabal-version: >=1.10
10094

10195
source-repository head
10296
type: git
10397
location: https://github.com/haskell-compat/deriving-compat
10498

105-
flag base-4-9
106-
description: Use base-4.9 or later.
107-
default: True
108-
109-
flag template-haskell-2-11
110-
description: Use template-haskell-2.11.0.0 or later.
111-
default: True
112-
113-
flag new-functor-classes
114-
description: Use a version of transformers or transformers-compat with a
115-
modern-style Data.Functor.Classes module. This flag cannot be
116-
used when building with transformers-0.4, since it comes with
117-
a different version of Data.Functor.Classes.
118-
default: True
119-
12099
library
121100
exposed-modules: Data.Deriving
122101
Data.Deriving.Internal
@@ -141,29 +120,14 @@ library
141120
Text.Read.Deriving.Internal
142121
Text.Show.Deriving
143122
Text.Show.Deriving.Internal
144-
build-depends: containers >= 0.1 && < 0.8
145-
, ghc-prim
146-
, th-abstraction >= 0.4 && < 0.8
147-
148-
if flag(base-4-9)
149-
build-depends: base >= 4.9 && < 5
150-
cpp-options: "-DNEW_FUNCTOR_CLASSES"
151-
else
152-
build-depends: base >= 4.3 && < 4.9
153-
, semigroups >= 0.6 && < 0.21
154-
155-
if flag(template-haskell-2-11)
156-
build-depends: template-haskell >= 2.11 && < 2.23
123+
build-depends: base >= 4.9 && < 5
124+
, containers >= 0.1 && < 0.8
157125
, ghc-boot-th
158-
else
159-
build-depends: template-haskell >= 2.5 && < 2.11
160-
161-
if flag(new-functor-classes)
162-
build-depends: transformers (>= 0.2 && < 0.4) || (>= 0.5 && < 0.7)
126+
, ghc-prim
127+
, template-haskell >= 2.11 && < 2.23
128+
, th-abstraction >= 0.5 && < 0.8
129+
, transformers >= 0.5 && < 0.7
163130
, transformers-compat >= 0.5
164-
cpp-options: "-DNEW_FUNCTOR_CLASSES"
165-
else
166-
build-depends: transformers == 0.4.*
167131

168132
hs-source-dirs: src
169133
default-language: Haskell2010
@@ -186,29 +150,18 @@ test-suite spec
186150

187151
Types.EqOrd
188152
Types.ReadShow
189-
build-depends: base-compat >= 0.8.1 && < 1
153+
build-depends: base >= 4.9 && < 5
190154
, base-orphans >= 0.5 && < 1
191155
, deriving-compat
192156
, hspec >= 1.8
193157
, QuickCheck >= 2 && < 3
194158
, tagged >= 0.7 && < 1
195-
, template-haskell >= 2.5 && < 2.23
159+
, template-haskell >= 2.11 && < 2.23
160+
, transformers >= 0.5 && < 0.7
161+
, transformers-compat >= 0.5
196162
, void >= 0.5.10 && < 1
197163
build-tool-depends: hspec-discover:hspec-discover >= 1.8
198164

199-
if flag(base-4-9)
200-
build-depends: base >= 4.9 && < 5
201-
cpp-options: "-DNEW_FUNCTOR_CLASSES"
202-
else
203-
build-depends: base >= 4.3 && < 4.9
204-
205-
if flag(new-functor-classes)
206-
build-depends: transformers (>= 0.2 && < 0.4) || (>= 0.5 && < 0.7)
207-
, transformers-compat >= 0.5
208-
cpp-options: "-DNEW_FUNCTOR_CLASSES"
209-
else
210-
build-depends: transformers == 0.4.*
211-
212165
hs-source-dirs: tests
213166
default-language: Haskell2010
214167
ghc-options: -Wall -threaded -rtsopts

0 commit comments

Comments
 (0)