Skip to content

Commit 364bdb2

Browse files
committed
Allow building with GHC 9.12
1 parent b5e0a43 commit 364bdb2

File tree

3 files changed

+45
-8
lines changed

3 files changed

+45
-8
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ jobs:
2828
strategy:
2929
matrix:
3030
include:
31+
- compiler: ghc-9.12.0.20241128
32+
compilerKind: ghc
33+
compilerVersion: 9.12.0.20241128
34+
setup-method: ghcup-prerelease
35+
allow-failure: false
3136
- compiler: ghc-9.10.1
3237
compilerKind: ghc
3338
compilerVersion: 9.10.1
@@ -107,6 +112,21 @@ jobs:
107112
HCKIND: ${{ matrix.compilerKind }}
108113
HCNAME: ${{ matrix.compiler }}
109114
HCVER: ${{ matrix.compilerVersion }}
115+
- name: Install GHC (GHCup prerelease)
116+
if: matrix.setup-method == 'ghcup-prerelease'
117+
run: |
118+
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
119+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
120+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
121+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
122+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
123+
echo "HC=$HC" >> "$GITHUB_ENV"
124+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
125+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
126+
env:
127+
HCKIND: ${{ matrix.compilerKind }}
128+
HCNAME: ${{ matrix.compiler }}
129+
HCVER: ${{ matrix.compilerVersion }}
110130
- name: Set PATH and environment variables
111131
run: |
112132
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
@@ -117,7 +137,7 @@ jobs:
117137
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
118138
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
119139
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
120-
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
140+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
121141
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
122142
env:
123143
HCKIND: ${{ matrix.compilerKind }}
@@ -145,6 +165,18 @@ jobs:
145165
repository hackage.haskell.org
146166
url: http://hackage.haskell.org/
147167
EOF
168+
if $HEADHACKAGE; then
169+
cat >> $CABAL_CONFIG <<EOF
170+
repository head.hackage.ghc.haskell.org
171+
url: https://ghc.gitlab.haskell.org/head.hackage/
172+
secure: True
173+
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
174+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
175+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
176+
key-threshold: 3
177+
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
178+
EOF
179+
fi
148180
cat >> $CABAL_CONFIG <<EOF
149181
program-default-options
150182
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -203,6 +235,9 @@ jobs:
203235
cat >> cabal.project <<EOF
204236
allow-newer: websockets:containers
205237
EOF
238+
if $HEADHACKAGE; then
239+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
240+
fi
206241
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(javascript-bridge|javascript-bridge-benchmarks)$/; }' >> cabal.project.local
207242
cat cabal.project
208243
cat cabal.project.local

benchmarks/javascript-bridge-benchmarks.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ tested-with: GHC == 8.4.4
2020
, GHC == 9.6.6
2121
, GHC == 9.8.4
2222
, GHC == 9.10.1
23+
, GHC == 9.12.1
2324

2425
executable javascript-bridge-benchmarks
2526
ghc-options: -Wall -O2 -rtsopts
26-
build-depends: base >= 4.11 && < 4.21
27+
build-depends: base >= 4.11 && < 4.22
2728
, javascript-bridge
2829
, binary >= 0.8 && < 0.9
2930
, aeson >= 1.0 && < 2.3

javascript-bridge.cabal

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ tested-with: GHC == 8.4.4
2121
, GHC == 9.6.6
2222
, GHC == 9.8.4
2323
, GHC == 9.10.1
24+
, GHC == 9.12.1
2425

2526
data-files:
2627
examples/Main.html
@@ -33,13 +34,13 @@ library
3334
exposed-modules: Network.JavaScript,
3435
Network.JavaScript.Internal,
3536
Network.JavaScript.Services
36-
build-depends: base >= 4.11 && < 4.21
37+
build-depends: base >= 4.11 && < 4.22
3738
, binary >= 0.8 && < 0.9
3839
, aeson >= 1.4 && < 2.3
3940
, containers >= 0.5 && < 0.8
4041
, stm >= 2.4 && < 2.6
4142
, text >= 1.2 && < 2.2
42-
, time >= 1.6 && < 1.13
43+
, time >= 1.6 && < 1.15
4344
, transformers >= 0.4 && < 0.7
4445
, wai >= 3.2 && < 3.3
4546
, wai-websockets >= 3.0.1 && < 3.1
@@ -51,22 +52,22 @@ library
5152
test-suite javascript-bridge-test
5253
type: exitcode-stdio-1.0
5354
main-is: Main.hs
54-
build-depends: base >= 4.11 && < 4.21
55+
build-depends: base >= 4.11 && < 4.22
5556
, aeson >= 1.0 && < 2.3
5657
, javascript-bridge
5758
, scotty >= 0.11 && < 0.23
5859
, wai-extra >= 3.0 && < 3.2
5960
, stm >= 2.4 && < 2.6
6061
, text >= 1.2 && < 2.2
61-
, time >= 1.6 && < 1.13
62+
, time >= 1.6 && < 1.15
6263
hs-source-dirs: test
6364
default-language: Haskell2010
6465
ghc-options: -threaded -Wall
6566

6667
executable javascript-bridge-simple
6768
main-is: Main.hs
6869
other-modules: Paths_javascript_bridge
69-
build-depends: base >= 4.11 && < 4.21
70+
build-depends: base >= 4.11 && < 4.22
7071
, javascript-bridge
7172
, scotty >= 0.11 && < 0.23
7273
hs-source-dirs: examples
@@ -76,7 +77,7 @@ executable javascript-bridge-simple
7677
executable javascript-bridge-examples
7778
main-is: Multi.hs
7879
other-modules: Paths_javascript_bridge
79-
build-depends: base >= 4.11 && < 4.21
80+
build-depends: base >= 4.11 && < 4.22
8081
, javascript-bridge
8182
, scotty >= 0.11 && < 0.23
8283
, text >= 1.2 && < 2.2

0 commit comments

Comments
 (0)