Skip to content

Commit 02f9df5

Browse files
committed
v1.0.4.1: allow happy-2, pacify -Wx-partial
1 parent dafa949 commit 02f9df5

File tree

4 files changed

+63
-95
lines changed

4 files changed

+63
-95
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 44 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
#
77
# haskell-ci regenerate
88
#
9-
# For more information, see https://github.com/haskell-CI/haskell-ci
9+
# For more information, see https://github.com/andreasabel/haskell-ci
1010
#
11-
# version: 0.15.20230312
11+
# version: 0.19.20240703
1212
#
13-
# REGENDATA ("0.15.20230312",["github","haskell-src.cabal"])
13+
# REGENDATA ("0.19.20240703",["github","haskell-src.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -27,24 +27,34 @@ jobs:
2727
timeout-minutes:
2828
60
2929
container:
30-
image: buildpack-deps:bionic
30+
image: buildpack-deps:jammy
3131
continue-on-error: ${{ matrix.allow-failure }}
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.6.1
35+
- compiler: ghc-9.10.1
3636
compilerKind: ghc
37-
compilerVersion: 9.6.1
37+
compilerVersion: 9.10.1
3838
setup-method: ghcup
3939
allow-failure: false
40-
- compiler: ghc-9.4.4
40+
- compiler: ghc-9.8.2
4141
compilerKind: ghc
42-
compilerVersion: 9.4.4
42+
compilerVersion: 9.8.2
4343
setup-method: ghcup
4444
allow-failure: false
45-
- compiler: ghc-9.2.7
45+
- compiler: ghc-9.6.6
4646
compilerKind: ghc
47-
compilerVersion: 9.2.7
47+
compilerVersion: 9.6.6
48+
setup-method: ghcup
49+
allow-failure: false
50+
- compiler: ghc-9.4.8
51+
compilerKind: ghc
52+
compilerVersion: 9.4.8
53+
setup-method: ghcup
54+
allow-failure: false
55+
- compiler: ghc-9.2.8
56+
compilerKind: ghc
57+
compilerVersion: 9.2.8
4858
setup-method: ghcup
4959
allow-failure: false
5060
- compiler: ghc-9.0.2
@@ -60,79 +70,39 @@ jobs:
6070
- compiler: ghc-8.8.4
6171
compilerKind: ghc
6272
compilerVersion: 8.8.4
63-
setup-method: hvr-ppa
73+
setup-method: ghcup
6474
allow-failure: false
6575
- compiler: ghc-8.6.5
6676
compilerKind: ghc
6777
compilerVersion: 8.6.5
68-
setup-method: hvr-ppa
78+
setup-method: ghcup
6979
allow-failure: false
7080
- compiler: ghc-8.4.4
7181
compilerKind: ghc
7282
compilerVersion: 8.4.4
73-
setup-method: hvr-ppa
83+
setup-method: ghcup
7484
allow-failure: false
7585
- compiler: ghc-8.2.2
7686
compilerKind: ghc
7787
compilerVersion: 8.2.2
78-
setup-method: hvr-ppa
88+
setup-method: ghcup
7989
allow-failure: false
8090
- compiler: ghc-8.0.2
8191
compilerKind: ghc
8292
compilerVersion: 8.0.2
83-
setup-method: hvr-ppa
84-
allow-failure: false
85-
- compiler: ghc-7.10.3
86-
compilerKind: ghc
87-
compilerVersion: 7.10.3
88-
setup-method: hvr-ppa
89-
allow-failure: false
90-
- compiler: ghc-7.8.4
91-
compilerKind: ghc
92-
compilerVersion: 7.8.4
93-
setup-method: hvr-ppa
94-
allow-failure: false
95-
- compiler: ghc-7.6.3
96-
compilerKind: ghc
97-
compilerVersion: 7.6.3
98-
setup-method: hvr-ppa
99-
allow-failure: false
100-
- compiler: ghc-7.4.2
101-
compilerKind: ghc
102-
compilerVersion: 7.4.2
103-
setup-method: hvr-ppa
104-
allow-failure: false
105-
- compiler: ghc-7.2.2
106-
compilerKind: ghc
107-
compilerVersion: 7.2.2
108-
setup-method: hvr-ppa
109-
allow-failure: false
110-
- compiler: ghc-7.0.4
111-
compilerKind: ghc
112-
compilerVersion: 7.0.4
113-
setup-method: hvr-ppa
93+
setup-method: ghcup
11494
allow-failure: false
11595
fail-fast: false
11696
steps:
11797
- name: apt
11898
run: |
11999
apt-get update
120-
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
121-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
122-
mkdir -p "$HOME/.ghcup/bin"
123-
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
124-
chmod a+x "$HOME/.ghcup/bin/ghcup"
125-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
126-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
127-
else
128-
apt-add-repository -y 'ppa:hvr/ghc'
129-
apt-get update
130-
apt-get install -y "$HCNAME"
131-
mkdir -p "$HOME/.ghcup/bin"
132-
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
133-
chmod a+x "$HOME/.ghcup/bin/ghcup"
134-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
135-
fi
100+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
101+
mkdir -p "$HOME/.ghcup/bin"
102+
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
103+
chmod a+x "$HOME/.ghcup/bin/ghcup"
104+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
105+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
136106
env:
137107
HCKIND: ${{ matrix.compilerKind }}
138108
HCNAME: ${{ matrix.compiler }}
@@ -144,20 +114,13 @@ jobs:
144114
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
145115
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
146116
HCDIR=/opt/$HCKIND/$HCVER
147-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
148-
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
149-
echo "HC=$HC" >> "$GITHUB_ENV"
150-
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
151-
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
152-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
153-
else
154-
HC=$HCDIR/bin/$HCKIND
155-
echo "HC=$HC" >> "$GITHUB_ENV"
156-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
157-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
158-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
159-
fi
160-
117+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
118+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
119+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
120+
echo "HC=$HC" >> "$GITHUB_ENV"
121+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
122+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
123+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
161124
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
162125
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
163126
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
@@ -207,14 +170,14 @@ jobs:
207170
- name: install cabal-plan
208171
run: |
209172
mkdir -p $HOME/.cabal/bin
210-
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
211-
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
173+
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
174+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
212175
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
213176
rm -f cabal-plan.xz
214177
chmod a+x $HOME/.cabal/bin/cabal-plan
215178
cabal-plan --version
216179
- name: checkout
217-
uses: actions/checkout@v3
180+
uses: actions/checkout@v4
218181
with:
219182
path: source
220183
- name: initial cabal.project for sdist
@@ -242,15 +205,15 @@ jobs:
242205
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
243206
cat >> cabal.project <<EOF
244207
EOF
245-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(haskell-src)$/; }' >> cabal.project.local
208+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(haskell-src)$/; }' >> cabal.project.local
246209
cat cabal.project
247210
cat cabal.project.local
248211
- name: dump install plan
249212
run: |
250213
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
251214
cabal-plan
252215
- name: restore cache
253-
uses: actions/cache/restore@v3
216+
uses: actions/cache/restore@v4
254217
with:
255218
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
256219
path: ~/.cabal/store
@@ -277,7 +240,7 @@ jobs:
277240
rm -f cabal.project.local
278241
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
279242
- name: save cache
280-
uses: actions/cache/save@v3
243+
uses: actions/cache/save@v4
281244
if: always()
282245
with:
283246
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}

Language/Haskell/Lexer.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ isSymbol c = c `elem` ":!#%&*./?@\\-" || (Data.Char.isSymbol c && not (c `elem`
171171

172172
matchChar :: Char -> String -> Lex a ()
173173
matchChar c msg = do
174-
s <- getInput
175-
if null s || head s /= c then fail msg else discard 1
174+
s <- getInput
175+
case s of
176+
c':_ | c == c' -> discard 1
177+
_ -> fail msg
176178

177179
-- The top-level lexer.
178180
-- We need to know whether we are at the beginning of the line to decide

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 1.0.4.1
2+
3+
_Andreas Abel, 2024-09-22_
4+
5+
- Replace use of `head` to pacify `-Wx-partial`.
6+
- Remove upper bound on `happy`.
7+
- Tested with GHC 8.0 - 9.10.1.
8+
19
## 1.0.4 Revision 1
210

311
_Andreas Abel, 2022-05-25_

haskell-src.cabal

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
cabal-version: >=1.10
22
name: haskell-src
33
-- don't forget to update the changelog.md!
4-
version: 1.0.4
5-
x-revision: 1
4+
version: 1.0.4.1
65
build-type: Simple
76

87
license: BSD3
@@ -21,22 +20,18 @@ description:
2120
<http://www.haskell.org/onlinereport/ Haskell 98> code.
2221

2322
tested-with:
24-
GHC == 9.6.1
25-
GHC == 9.4.4
26-
GHC == 9.2.7
23+
GHC == 9.10.1
24+
GHC == 9.8.2
25+
GHC == 9.6.6
26+
GHC == 9.4.8
27+
GHC == 9.2.8
2728
GHC == 9.0.2
2829
GHC == 8.10.7
2930
GHC == 8.8.4
3031
GHC == 8.6.5
3132
GHC == 8.4.4
3233
GHC == 8.2.2
3334
GHC == 8.0.2
34-
GHC == 7.10.3
35-
GHC == 7.8.4
36-
GHC == 7.6.3
37-
GHC == 7.4.2
38-
GHC == 7.2.2
39-
GHC == 7.0.4
4035

4136
extra-source-files: changelog.md
4237

@@ -66,7 +61,7 @@ library
6661
else
6762
ghc-options: -Wcompat -Wnoncanonical-monad-instances
6863

69-
build-tools: happy >= 1.19 && < 1.22
64+
build-tools: happy >= 1.19
7065

7166
default-language: Haskell98
7267

0 commit comments

Comments
 (0)