Skip to content

Commit 1b2f632

Browse files
committed
v1.20.10: drop support for GHC 7 and old-locale, compatibility with RecordDotSyntax
1 parent 0d61f13 commit 1b2f632

File tree

8 files changed

+408
-91
lines changed

8 files changed

+408
-91
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 294 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,294 @@
1+
# This GitHub workflow config has been generated by a script via
2+
#
3+
# haskell-ci 'github' 'cpphs.cabal'
4+
#
5+
# To regenerate the script (for example after adjusting tested-with) run
6+
#
7+
# haskell-ci regenerate
8+
#
9+
# For more information, see https://github.com/haskell-CI/haskell-ci
10+
#
11+
# version: 0.19.20250908
12+
#
13+
# REGENDATA ("0.19.20250908",["github","cpphs.cabal"])
14+
#
15+
name: Haskell-CI
16+
on:
17+
push:
18+
branches:
19+
- master
20+
pull_request:
21+
branches:
22+
- master
23+
jobs:
24+
linux:
25+
name: Haskell-CI - Linux - ${{ matrix.compiler }}
26+
runs-on: ubuntu-24.04
27+
timeout-minutes:
28+
60
29+
container:
30+
image: buildpack-deps:jammy
31+
continue-on-error: ${{ matrix.allow-failure }}
32+
strategy:
33+
matrix:
34+
include:
35+
- compiler: ghc-9.14.0.20250819
36+
compilerKind: ghc
37+
compilerVersion: 9.14.0.20250819
38+
setup-method: ghcup-prerelease
39+
allow-failure: false
40+
- compiler: ghc-9.12.2
41+
compilerKind: ghc
42+
compilerVersion: 9.12.2
43+
setup-method: ghcup
44+
allow-failure: false
45+
- compiler: ghc-9.10.2
46+
compilerKind: ghc
47+
compilerVersion: 9.10.2
48+
setup-method: ghcup
49+
allow-failure: false
50+
- compiler: ghc-9.8.4
51+
compilerKind: ghc
52+
compilerVersion: 9.8.4
53+
setup-method: ghcup
54+
allow-failure: false
55+
- compiler: ghc-9.6.7
56+
compilerKind: ghc
57+
compilerVersion: 9.6.7
58+
setup-method: ghcup
59+
allow-failure: false
60+
- compiler: ghc-9.4.8
61+
compilerKind: ghc
62+
compilerVersion: 9.4.8
63+
setup-method: ghcup
64+
allow-failure: false
65+
- compiler: ghc-9.2.8
66+
compilerKind: ghc
67+
compilerVersion: 9.2.8
68+
setup-method: ghcup
69+
allow-failure: false
70+
- compiler: ghc-9.0.2
71+
compilerKind: ghc
72+
compilerVersion: 9.0.2
73+
setup-method: ghcup
74+
allow-failure: false
75+
- compiler: ghc-8.10.7
76+
compilerKind: ghc
77+
compilerVersion: 8.10.7
78+
setup-method: ghcup
79+
allow-failure: false
80+
- compiler: ghc-8.8.4
81+
compilerKind: ghc
82+
compilerVersion: 8.8.4
83+
setup-method: ghcup
84+
allow-failure: false
85+
- compiler: ghc-8.6.5
86+
compilerKind: ghc
87+
compilerVersion: 8.6.5
88+
setup-method: ghcup
89+
allow-failure: false
90+
- compiler: ghc-8.4.4
91+
compilerKind: ghc
92+
compilerVersion: 8.4.4
93+
setup-method: ghcup
94+
allow-failure: false
95+
- compiler: ghc-8.2.2
96+
compilerKind: ghc
97+
compilerVersion: 8.2.2
98+
setup-method: ghcup
99+
allow-failure: false
100+
- compiler: ghc-8.0.2
101+
compilerKind: ghc
102+
compilerVersion: 8.0.2
103+
setup-method: ghcup
104+
allow-failure: false
105+
fail-fast: false
106+
steps:
107+
- name: apt-get install
108+
run: |
109+
apt-get update
110+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
111+
- name: Install GHCup
112+
run: |
113+
mkdir -p "$HOME/.ghcup/bin"
114+
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
115+
chmod a+x "$HOME/.ghcup/bin/ghcup"
116+
- name: Install cabal-install
117+
run: |
118+
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
119+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
120+
- name: Install GHC (GHCup)
121+
if: matrix.setup-method == 'ghcup'
122+
run: |
123+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
124+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
125+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
126+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
127+
echo "HC=$HC" >> "$GITHUB_ENV"
128+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
129+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
130+
env:
131+
HCKIND: ${{ matrix.compilerKind }}
132+
HCNAME: ${{ matrix.compiler }}
133+
HCVER: ${{ matrix.compilerVersion }}
134+
- name: Install GHC (GHCup prerelease)
135+
if: matrix.setup-method == 'ghcup-prerelease'
136+
run: |
137+
"$HOME/.ghcup/bin/ghcup" config add-release-channel prereleases
138+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
139+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
140+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
141+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
142+
echo "HC=$HC" >> "$GITHUB_ENV"
143+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
144+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
145+
env:
146+
HCKIND: ${{ matrix.compilerKind }}
147+
HCNAME: ${{ matrix.compiler }}
148+
HCVER: ${{ matrix.compilerVersion }}
149+
- name: Set PATH and environment variables
150+
run: |
151+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
152+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
153+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
154+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
155+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
156+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
157+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
158+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
159+
if [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
160+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
161+
env:
162+
HCKIND: ${{ matrix.compilerKind }}
163+
HCNAME: ${{ matrix.compiler }}
164+
HCVER: ${{ matrix.compilerVersion }}
165+
- name: env
166+
run: |
167+
env
168+
- name: write cabal config
169+
run: |
170+
mkdir -p $CABAL_DIR
171+
cat >> $CABAL_CONFIG <<EOF
172+
remote-build-reporting: anonymous
173+
write-ghc-environment-files: never
174+
remote-repo-cache: $CABAL_DIR/packages
175+
logs-dir: $CABAL_DIR/logs
176+
world-file: $CABAL_DIR/world
177+
extra-prog-path: $CABAL_DIR/bin
178+
symlink-bindir: $CABAL_DIR/bin
179+
installdir: $CABAL_DIR/bin
180+
build-summary: $CABAL_DIR/logs/build.log
181+
store-dir: $CABAL_DIR/store
182+
install-dirs user
183+
prefix: $CABAL_DIR
184+
repository hackage.haskell.org
185+
url: http://hackage.haskell.org/
186+
EOF
187+
if $HEADHACKAGE; then
188+
cat >> $CABAL_CONFIG <<EOF
189+
repository head.hackage.ghc.haskell.org
190+
url: https://ghc.gitlab.haskell.org/head.hackage/
191+
secure: True
192+
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
193+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
194+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
195+
key-threshold: 3
196+
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
197+
EOF
198+
fi
199+
cat >> $CABAL_CONFIG <<EOF
200+
program-default-options
201+
ghc-options: $GHCJOBS +RTS -M3G -RTS
202+
EOF
203+
cat $CABAL_CONFIG
204+
- name: versions
205+
run: |
206+
$HC --version || true
207+
$HC --print-project-git-commit-id || true
208+
$CABAL --version || true
209+
- name: update cabal index
210+
run: |
211+
$CABAL v2-update -v
212+
- name: install cabal-plan
213+
run: |
214+
mkdir -p $HOME/.cabal/bin
215+
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
216+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
217+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
218+
rm -f cabal-plan.xz
219+
chmod a+x $HOME/.cabal/bin/cabal-plan
220+
cabal-plan --version
221+
- name: checkout
222+
uses: actions/checkout@v5
223+
with:
224+
path: source
225+
- name: initial cabal.project for sdist
226+
run: |
227+
touch cabal.project
228+
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
229+
cat cabal.project
230+
- name: sdist
231+
run: |
232+
mkdir -p sdist
233+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
234+
- name: unpack
235+
run: |
236+
mkdir -p unpacked
237+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
238+
- name: generate cabal.project
239+
run: |
240+
PKGDIR_cpphs="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/cpphs-[0-9.]*')"
241+
echo "PKGDIR_cpphs=${PKGDIR_cpphs}" >> "$GITHUB_ENV"
242+
rm -f cabal.project cabal.project.local
243+
touch cabal.project
244+
touch cabal.project.local
245+
echo "packages: ${PKGDIR_cpphs}" >> cabal.project
246+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package cpphs" >> cabal.project ; fi
247+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project ; fi
248+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package cpphs" >> cabal.project ; fi
249+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
250+
cat >> cabal.project <<EOF
251+
EOF
252+
if $HEADHACKAGE; then
253+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
254+
fi
255+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(cpphs)$/; }' >> cabal.project.local
256+
cat cabal.project
257+
cat cabal.project.local
258+
- name: dump install plan
259+
run: |
260+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
261+
cabal-plan
262+
- name: restore cache
263+
uses: actions/cache/restore@v4
264+
with:
265+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
266+
path: ~/.cabal/store
267+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
268+
- name: install dependencies
269+
run: |
270+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
271+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
272+
- name: build w/o tests
273+
run: |
274+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
275+
- name: build
276+
run: |
277+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
278+
- name: cabal check
279+
run: |
280+
cd ${PKGDIR_cpphs} || false
281+
${CABAL} -vnormal check
282+
- name: haddock
283+
run: |
284+
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
285+
- name: unconstrained build
286+
run: |
287+
rm -f cabal.project.local
288+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
289+
- name: save cache
290+
if: always()
291+
uses: actions/cache/save@v4
292+
with:
293+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
294+
path: ~/.cabal/store

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*~
2+
dist-newstyle/
3+
.stack-work/

CHANGELOG renamed to CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
Version 1.20.10
2+
---------------
3+
4+
_Andreas Abel, 2025-09-14_
5+
6+
* Drop support for GHC 7.
7+
* Remove cabal flag `old-locale`.
8+
* Compatibility with `{-# LANGUAGE RecordDotSyntax #-}` (Lennart Augustsson).
9+
* Build tested with GHC 8.0 - 9.14 alpha1.
10+
111
Version 1.20
212
------------
3-
* bugfixes for #if defined(FOO) && FOO(a,b)
13+
* bugfixes for `#if defined(FOO) && FOO(a,b)`
414
* (1.20.1): fix version number
515
* (1.20.2): ensure all input/output is UTF8, regardless of locale
616
* (1.20.3): detect an absolute windows path with a drive letter in a #include

README

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)