Skip to content

Commit 5b7e57f

Browse files
committed
singletons-{th,base}: Require building with GHC 9.12
The most notable change is that because GHC 9.12 includes a fix for https://gitlab.haskell.org/ghc/ghc/-/issues/24911, the test suite output now includes explicit namespaces for its fixity declarations. Aside from that, the changes here are mostly bumping upper version bounds. Checks off one box in #619.
1 parent 2eff0cb commit 5b7e57f

21 files changed

+210
-172
lines changed

.github/workflows/haskell-ci.yml

+56-21
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
@@ -38,9 +43,9 @@ jobs:
3843
compilerVersion: 9.8.2
3944
setup-method: ghcup
4045
allow-failure: false
41-
- compiler: ghc-9.6.5
46+
- compiler: ghc-9.6.6
4247
compilerKind: ghc
43-
compilerVersion: 9.6.5
48+
compilerVersion: 9.6.6
4449
setup-method: ghcup
4550
allow-failure: false
4651
- compiler: ghc-9.4.8
@@ -117,6 +122,21 @@ jobs:
117122
HCKIND: ${{ matrix.compilerKind }}
118123
HCNAME: ${{ matrix.compiler }}
119124
HCVER: ${{ matrix.compilerVersion }}
125+
- name: Install GHC (GHCup prerelease)
126+
if: matrix.setup-method == 'ghcup-prerelease'
127+
run: |
128+
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
129+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
130+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
131+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
132+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
133+
echo "HC=$HC" >> "$GITHUB_ENV"
134+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
135+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
136+
env:
137+
HCKIND: ${{ matrix.compilerKind }}
138+
HCNAME: ${{ matrix.compiler }}
139+
HCVER: ${{ matrix.compilerVersion }}
120140
- name: Set PATH and environment variables
121141
run: |
122142
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
@@ -127,7 +147,7 @@ jobs:
127147
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
128148
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
129149
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
130-
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
150+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
131151
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
132152
env:
133153
HCKIND: ${{ matrix.compilerKind }}
@@ -155,6 +175,18 @@ jobs:
155175
repository hackage.haskell.org
156176
url: http://hackage.haskell.org/
157177
EOF
178+
if $HEADHACKAGE; then
179+
cat >> $CABAL_CONFIG <<EOF
180+
repository head.hackage.ghc.haskell.org
181+
url: https://ghc.gitlab.haskell.org/head.hackage/
182+
secure: True
183+
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
184+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
185+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
186+
key-threshold: 3
187+
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
188+
EOF
189+
fi
158190
cat >> $CABAL_CONFIG <<EOF
159191
program-default-options
160192
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -185,9 +217,9 @@ jobs:
185217
run: |
186218
touch cabal.project
187219
echo "packages: $GITHUB_WORKSPACE/source/./singletons" >> cabal.project
188-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-th" >> cabal.project ; fi
189-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-base" >> cabal.project ; fi
190-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-base-code-generator" >> cabal.project ; fi
220+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-th" >> cabal.project ; fi
221+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-base" >> cabal.project ; fi
222+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-base-code-generator" >> cabal.project ; fi
191223
cat cabal.project
192224
- name: sdist
193225
run: |
@@ -211,23 +243,26 @@ jobs:
211243
touch cabal.project
212244
touch cabal.project.local
213245
echo "packages: ${PKGDIR_singletons}" >> cabal.project
214-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_th}" >> cabal.project ; fi
215-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_base}" >> cabal.project ; fi
216-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_base_code_generator}" >> cabal.project ; fi
246+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_th}" >> cabal.project ; fi
247+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_base}" >> cabal.project ; fi
248+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_base_code_generator}" >> cabal.project ; fi
217249
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package singletons" >> cabal.project ; fi
218250
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
219-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "package singletons-th" >> cabal.project ; fi
220-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
221-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "package singletons-base" >> cabal.project ; fi
222-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
223-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "package singletons-base-code-generator" >> cabal.project ; fi
224-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
251+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "package singletons-th" >> cabal.project ; fi
252+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
253+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "package singletons-base" >> cabal.project ; fi
254+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
255+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "package singletons-base-code-generator" >> cabal.project ; fi
256+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
225257
cat >> cabal.project <<EOF
226258
source-repository-package
227259
type: git
228260
location: https://github.com/goldfirere/th-desugar
229261
tag: 730a0ed799c91324d42b70d3780d6b3215cafc3c
230262
EOF
263+
if $HEADHACKAGE; then
264+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
265+
fi
231266
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(Cabal|Cabal-syntax|singletons|singletons-base|singletons-base-code-generator|singletons-th)$/; }' >> cabal.project.local
232267
cat cabal.project
233268
cat cabal.project.local
@@ -255,12 +290,12 @@ jobs:
255290
run: |
256291
cd ${PKGDIR_singletons} || false
257292
${CABAL} -vnormal check
258-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then cd ${PKGDIR_singletons_th} || false ; fi
259-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
260-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then cd ${PKGDIR_singletons_base} || false ; fi
261-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
262-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then cd ${PKGDIR_singletons_base_code_generator} || false ; fi
263-
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
293+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then cd ${PKGDIR_singletons_th} || false ; fi
294+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
295+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then cd ${PKGDIR_singletons_base} || false ; fi
296+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
297+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then cd ${PKGDIR_singletons_base_code_generator} || false ; fi
298+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
264299
- name: haddock
265300
run: |
266301
$CABAL v2-haddock --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ windows for requirements on the compiler version needed to build each library:
6363
GHC language extensions, even more so than `singletons` itself. As such, it
6464
is difficult to maintain support for multiple GHC versions in any given
6565
release of either library, so they only support the latest major GHC version
66-
(currently GHC 9.10).
66+
(currently GHC 9.12).
6767

6868
Any code that uses the singleton-generation functionality from `singletons-th`
6969
or `singletons-base` needs to enable a long list of GHC extensions. This list

singletons-base-code-generator/singletons-base-code-generator.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: Ryan Scott <[email protected]>
88
maintainer: Ryan Scott <[email protected]>
99
bug-reports: https://github.com/goldfirere/singletons/issues
1010
stability: experimental
11-
tested-with: GHC == 9.10.1
11+
tested-with: GHC == 9.12.1
1212
extra-doc-files: CHANGES.md
1313
extra-source-files: README.md
1414
license: BSD-3-Clause

singletons-base/CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Changelog for the `singletons-base` project
33

44
3.5 [????.??.??]
55
-----------------
6+
* Require building with GHC 9.12.
67
* Remove the use of a custom `Setup.hs` script. This script has now been
78
replaced with a [`cabal` code
89
generator](https://cabal.readthedocs.io/en/stable/cabal-package-description-file.html#pkg-field-test-suite-code-generators)

singletons-base/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ that code with `singletons-base`.
1818

1919
`singletons-base` uses code that relies on bleeding-edge GHC language
2020
extensions. As such, `singletons-base` only supports the latest major version
21-
of GHC (currently GHC 9.10). For more information,
21+
of GHC (currently GHC 9.12). For more information,
2222
consult the `singletons`
2323
[`README`](https://github.com/goldfirere/singletons/blob/master/README.md).
2424

singletons-base/singletons-base.cabal

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: Richard Eisenberg <[email protected]>, Jan Stolarek <jan.stola
88
maintainer: Ryan Scott <[email protected]>
99
bug-reports: https://github.com/goldfirere/singletons/issues
1010
stability: experimental
11-
tested-with: GHC == 9.10.1
11+
tested-with: GHC == 9.12.1
1212
extra-doc-files: CHANGES.md
1313
extra-source-files: README.md
1414
tests/README.md
@@ -40,7 +40,7 @@ description:
4040
.
4141
@singletons-base@ uses code that relies on bleeding-edge GHC language
4242
extensions. As such, @singletons-base@ only supports the latest major version
43-
of GHC (currently GHC 9.10). For more information,
43+
of GHC (currently GHC 9.12). For more information,
4444
consult the @singletons@
4545
@<https://github.com/goldfirere/singletons/blob/master/README.md README>@.
4646
.
@@ -67,11 +67,11 @@ source-repository head
6767

6868
library
6969
hs-source-dirs: src
70-
build-depends: base >= 4.20 && < 4.21,
70+
build-depends: base >= 4.21 && < 4.22,
7171
pretty,
7272
singletons == 3.0.*,
7373
singletons-th >= 3.5 && < 3.6,
74-
template-haskell >= 2.22.1 && < 2.23,
74+
template-haskell >= 2.23 && < 2.24,
7575
text >= 1.2,
7676
th-desugar >= 1.18 && < 1.19
7777
default-language: GHC2021
@@ -150,7 +150,7 @@ test-suite singletons-base-test-suite
150150
main-is: SingletonsBaseTestSuite.hs
151151
other-modules: SingletonsBaseTestSuiteUtils
152152

153-
build-depends: base >= 4.20 && < 4.21,
153+
build-depends: base >= 4.21 && < 4.22,
154154
bytestring >= 0.10.9,
155155
deepseq >= 1.4.4,
156156
filepath >= 1.3,

singletons-base/tests/compile-and-dump/Singletons/Classes.golden

+4-4
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations
145145
type instance Apply @a @((~>) a Ordering) (<=>@#@$) a0123456789876543210 = (<=>@#@$$) a0123456789876543210
146146
instance SuppressUnusedWarnings (<=>@#@$) where
147147
suppressUnusedWarnings = snd ((,) (:<=>@#@$###) ())
148-
infix 4 <=>@#@$
148+
infix 4 type <=>@#@$
149149
type (<=>@#@$$) :: forall a. a -> (~>) a Ordering
150150
data (<=>@#@$$) (a0123456789876543210 :: a) :: (~>) a Ordering
151151
where
@@ -154,11 +154,11 @@ Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations
154154
type instance Apply @a @Ordering ((<=>@#@$$) a0123456789876543210) a0123456789876543210 = (<=>) a0123456789876543210 a0123456789876543210
155155
instance SuppressUnusedWarnings ((<=>@#@$$) a0123456789876543210) where
156156
suppressUnusedWarnings = snd ((,) (:<=>@#@$$###) ())
157-
infix 4 <=>@#@$$
157+
infix 4 type <=>@#@$$
158158
type (<=>@#@$$$) :: forall a. a -> a -> Ordering
159159
type family (<=>@#@$$$) @a (a0123456789876543210 :: a) (a0123456789876543210 :: a) :: Ordering where
160160
(<=>@#@$$$) a0123456789876543210 a0123456789876543210 = (<=>) a0123456789876543210 a0123456789876543210
161-
infix 4 <=>@#@$$$
161+
infix 4 type <=>@#@$$$
162162
type TFHelper_0123456789876543210 :: forall a. a -> a -> Ordering
163163
type family TFHelper_0123456789876543210 @a (a :: a) (a :: a) :: Ordering where
164164
TFHelper_0123456789876543210 @a (a_0123456789876543210 :: a) (a_0123456789876543210 :: a) = Apply (Apply MycompareSym0 a_0123456789876543210) a_0123456789876543210
@@ -248,7 +248,7 @@ Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations
248248
(%<=>) ::
249249
(forall (t :: a) (t :: a).
250250
Sing t -> Sing t -> Sing ((<=>) t t :: Ordering) :: Type)
251-
infix 4 %<=>
251+
infix 4 data %<=>
252252
default (%<=>) ::
253253
(forall (t :: a) (t :: a).
254254
(((<=>) t t :: Ordering) ~ TFHelper_0123456789876543210 t t) =>

singletons-base/tests/compile-and-dump/Singletons/Fixity.golden

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Singletons/Fixity.hs:(0,0)-(0,0): Splicing declarations
2323
type instance Apply @a @((~>) a a) (====@#@$) a0123456789876543210 = (====@#@$$) a0123456789876543210
2424
instance SuppressUnusedWarnings (====@#@$) where
2525
suppressUnusedWarnings = snd ((,) (:====@#@$###) ())
26-
infix 4 ====@#@$
26+
infix 4 type ====@#@$
2727
type (====@#@$$) :: a -> (~>) a a
2828
data (====@#@$$) (a0123456789876543210 :: a) :: (~>) a a
2929
where
@@ -32,11 +32,11 @@ Singletons/Fixity.hs:(0,0)-(0,0): Splicing declarations
3232
type instance Apply @a @a ((====@#@$$) a0123456789876543210) a0123456789876543210 = (====) a0123456789876543210 a0123456789876543210
3333
instance SuppressUnusedWarnings ((====@#@$$) a0123456789876543210) where
3434
suppressUnusedWarnings = snd ((,) (:====@#@$$###) ())
35-
infix 4 ====@#@$$
35+
infix 4 type ====@#@$$
3636
type (====@#@$$$) :: a -> a -> a
3737
type family (====@#@$$$) @a (a0123456789876543210 :: a) (a0123456789876543210 :: a) :: a where
3838
(====@#@$$$) a0123456789876543210 a0123456789876543210 = (====) a0123456789876543210 a0123456789876543210
39-
infix 4 ====@#@$$$
39+
infix 4 type ====@#@$$$
4040
type (====) :: a -> a -> a
4141
type family (====) @a (a :: a) (a :: a) :: a where
4242
(====) a _ = a
@@ -48,7 +48,7 @@ Singletons/Fixity.hs:(0,0)-(0,0): Splicing declarations
4848
type instance Apply @a @((~>) a Ordering) (<=>@#@$) a0123456789876543210 = (<=>@#@$$) a0123456789876543210
4949
instance SuppressUnusedWarnings (<=>@#@$) where
5050
suppressUnusedWarnings = snd ((,) (:<=>@#@$###) ())
51-
infix 4 <=>@#@$
51+
infix 4 type <=>@#@$
5252
type (<=>@#@$$) :: forall a. a -> (~>) a Ordering
5353
data (<=>@#@$$) (a0123456789876543210 :: a) :: (~>) a Ordering
5454
where
@@ -57,14 +57,14 @@ Singletons/Fixity.hs:(0,0)-(0,0): Splicing declarations
5757
type instance Apply @a @Ordering ((<=>@#@$$) a0123456789876543210) a0123456789876543210 = (<=>) a0123456789876543210 a0123456789876543210
5858
instance SuppressUnusedWarnings ((<=>@#@$$) a0123456789876543210) where
5959
suppressUnusedWarnings = snd ((,) (:<=>@#@$$###) ())
60-
infix 4 <=>@#@$$
60+
infix 4 type <=>@#@$$
6161
type (<=>@#@$$$) :: forall a. a -> a -> Ordering
6262
type family (<=>@#@$$$) @a (a0123456789876543210 :: a) (a0123456789876543210 :: a) :: Ordering where
6363
(<=>@#@$$$) a0123456789876543210 a0123456789876543210 = (<=>) a0123456789876543210 a0123456789876543210
64-
infix 4 <=>@#@$$$
64+
infix 4 type <=>@#@$$$
6565
class PMyOrd a where
6666
type family (<=>) (arg :: a) (arg :: a) :: Ordering
67-
infix 4 %====
67+
infix 4 data %====
6868
(%====) ::
6969
(forall (t :: a) (t :: a).
7070
Sing t -> Sing t -> Sing ((====) t t :: a) :: Type)
@@ -80,7 +80,7 @@ Singletons/Fixity.hs:(0,0)-(0,0): Splicing declarations
8080
(%<=>) ::
8181
(forall (t :: a) (t :: a).
8282
Sing t -> Sing t -> Sing ((<=>) t t :: Ordering) :: Type)
83-
infix 4 %<=>
83+
infix 4 data %<=>
8484
instance SMyOrd a =>
8585
SingI ((<=>@#@$) :: (~>) a ((~>) a Ordering)) where
8686
sing = singFun2 @(<=>@#@$) (%<=>)

0 commit comments

Comments
 (0)