Skip to content

Commit b1f3184

Browse files
authored
Support GHC 9.14 (#81)
* Support GHC 9.14 * Remove unused packages * Remove dependency old-locale
1 parent 1587903 commit b1f3184

File tree

14 files changed

+71
-64
lines changed

14 files changed

+71
-64
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 27 additions & 23 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.20250506
11+
# version: 0.19.20260104
1212
#
13-
# REGENDATA ("0.19.20250506",["github","cabal.project"])
13+
# REGENDATA ("0.19.20260104",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -20,6 +20,9 @@ on:
2020
pull_request:
2121
branches:
2222
- master
23+
merge_group:
24+
branches:
25+
- master
2326
jobs:
2427
linux:
2528
name: Haskell-CI - Linux - ${{ matrix.compiler }}
@@ -32,14 +35,19 @@ jobs:
3235
strategy:
3336
matrix:
3437
include:
38+
- compiler: ghc-9.14.1
39+
compilerKind: ghc
40+
compilerVersion: 9.14.1
41+
setup-method: ghcup
42+
allow-failure: false
3543
- compiler: ghc-9.12.2
3644
compilerKind: ghc
3745
compilerVersion: 9.12.2
3846
setup-method: ghcup
3947
allow-failure: false
40-
- compiler: ghc-9.10.2
48+
- compiler: ghc-9.10.3
4149
compilerKind: ghc
42-
compilerVersion: 9.10.2
50+
compilerVersion: 9.10.3
4351
setup-method: ghcup
4452
allow-failure: false
4553
- compiler: ghc-9.8.4
@@ -111,8 +119,8 @@ jobs:
111119
chmod a+x "$HOME/.ghcup/bin/ghcup"
112120
- name: Install cabal-install
113121
run: |
114-
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
115-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
122+
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
123+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
116124
- name: Install GHC (GHCup)
117125
if: matrix.setup-method == 'ghcup'
118126
run: |
@@ -188,7 +196,7 @@ jobs:
188196
chmod a+x $HOME/.cabal/bin/cabal-plan
189197
cabal-plan --version
190198
- name: checkout
191-
uses: actions/checkout@v4
199+
uses: actions/checkout@v5
192200
with:
193201
path: source
194202
- name: initial cabal.project for sdist
@@ -225,18 +233,24 @@ jobs:
225233
echo "packages: ${PKGDIR_test_framework_quickcheck2}" >> cabal.project
226234
echo "packages: ${PKGDIR_test_framework_example}" >> cabal.project
227235
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package test-framework" >> cabal.project ; fi
228-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
236+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project ; fi
229237
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package test-framework-hunit" >> cabal.project ; fi
230-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
238+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project ; fi
231239
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package test-framework-quickcheck2" >> cabal.project ; fi
232-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
240+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project ; fi
233241
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package test-framework-example" >> cabal.project ; fi
234-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
242+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project ; fi
243+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package test-framework" >> cabal.project ; fi
244+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
245+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package test-framework-hunit" >> cabal.project ; fi
246+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
247+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package test-framework-quickcheck2" >> cabal.project ; fi
248+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
249+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package test-framework-example" >> cabal.project ; fi
250+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
235251
cat >> cabal.project <<EOF
236252
package libxml
237253
extra-include-dirs: /usr/include/libxml2
238-
239-
allow-newer: containers
240254
EOF
241255
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(test-framework|test-framework-example|test-framework-hunit|test-framework-quickcheck2)$/; }' >> cabal.project.local
242256
cat cabal.project
@@ -281,16 +295,6 @@ jobs:
281295
run: |
282296
rm -f cabal.project.local
283297
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
284-
- name: prepare for constraint sets
285-
run: |
286-
rm -f cabal.project.local
287-
- name: constraint set containers-0.8
288-
run: |
289-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers ^>=0.8' all --dry-run ; fi
290-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then cabal-plan topo | sort ; fi
291-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers ^>=0.8' --dependencies-only -j2 all ; fi
292-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers ^>=0.8' all ; fi
293-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers ^>=0.8' all ; fi
294298
- name: save cache
295299
if: always()
296300
uses: actions/cache/save@v4

cabal.haskell-ci

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@ branches: master
22

33
apt: libxml2-dev
44

5+
error-incomplete-patterns: False
6+
57
raw-project
68
-- On Debian/Ubuntu you may need the following to workaround an issue in libxml's packaging
79
package libxml
810
extra-include-dirs: /usr/include/libxml2
9-
10-
constraint-set containers-0.8
11-
ghc: >= 8.2
12-
constraints: containers ^>=0.8
13-
tests: True
14-
run-tests: True
15-
16-
raw-project
17-
allow-newer: containers

cabal.project

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ program-options
1717
-Wno-deprecations
1818
-- This package is legacy and won't address deprecation warnings.
1919
-Wno-x-partial
20+
-Wunused-packages
21+
-Wincomplete-patterns
22+
-Wincomplete-uni-patterns

core/ChangeLog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#### 0.8.2.3
2+
3+
_2026-01-05, Andreas Abel_
4+
5+
- Remove obsolete `deriving Typeable`
6+
- Tested building with GHC 8.0 - 9.14.1
7+
18
#### 0.8.2.2
29

310
_2025-04-11, Andreas Abel_

core/src/Test/Framework/Core.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{-# LANGUAGE UndecidableInstances, DeriveDataTypeable #-}
1+
{-# LANGUAGE UndecidableInstances #-}
2+
23
module Test.Framework.Core where
34

45
import Test.Framework.Improving
@@ -59,9 +60,7 @@ buildTest mx = BuildTestBracketed (fmap (flip (,) (return ())) mx)
5960
buildTestBracketed :: IO (Test, IO ()) -> Test
6061
buildTestBracketed = BuildTestBracketed
6162

62-
6363
data MutuallyExcluded t = ME (MVar ()) t
64-
deriving Typeable
6564

6665
-- This requires UndecidableInstances, but I think it can't be made inconsistent?
6766
instance Testlike i r t => Testlike i r (MutuallyExcluded t) where

core/test-framework.cabal

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Cabal-Version: 1.18
22
Name: test-framework
3-
Version: 0.8.2.2
4-
x-revision: 1
3+
Version: 0.8.2.3
54

65
Category: Testing
76
Synopsis: Framework for running and organising tests, with HUnit and QuickCheck support
@@ -17,8 +16,9 @@ Bug-Reports: https://github.com/haskell/test-framework/issues
1716
Build-Type: Simple
1817

1918
Tested-With:
19+
GHC == 9.14.1
2020
GHC == 9.12.2
21-
GHC == 9.10.2
21+
GHC == 9.10.3
2222
GHC == 9.8.4
2323
GHC == 9.6.7
2424
GHC == 9.4.8
@@ -68,8 +68,7 @@ Library
6868
, random >= 1.1 && < 1.4
6969
, containers >= 0.5.7 && < 1
7070
, regex-posix >= 0.95.2 && < 0.97
71-
, old-locale >= 1.0 && < 1.1
72-
, time >= 1.6 && < 1.15
71+
, time >= 1.6 && < 2
7372
, xml >= 1.3.14 && < 1.4
7473
, hostname >= 1.0 && < 1.1
7574

@@ -117,15 +116,8 @@ Test-Suite test-framework-tests
117116
, base >= 4.9 && < 5
118117
, random >= 1.1
119118
, containers >= 0.5.7
120-
, ansi-terminal >= 0.6.3
121-
, ansi-wl-pprint >= 0.6.7
122119
, regex-posix >= 0.95.2
123-
, old-locale >= 1.0
124-
, time >= 1.6
125120
, xml >= 1.3.14
126-
, hostname >= 1.0
127-
, bytestring >= 0.10.8
128-
, semigroups >= 0.18
129121

130122
Default-Language: Haskell2010
131123
Default-Extensions: CPP

example/test-framework-example.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ Homepage: https://github.com/haskell/test-framework#readme
1212
Build-Type: Simple
1313

1414
Tested-With:
15+
GHC == 9.14.1
1516
GHC == 9.12.2
16-
GHC == 9.10.2
17+
GHC == 9.10.3
1718
GHC == 9.8.4
1819
GHC == 9.6.7
1920
GHC == 9.4.8

hunit/ChangeLog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## 0.3.0.3
2+
3+
_2026-01-05, Andreas Abel_
4+
5+
- Drop support for GHC 7
6+
- Remove obsolete `deriving Typeable`
7+
- Tested building with GHC 8.0 - 9.14.1

hunit/Test/Framework/Providers/HUnit.hs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE DeriveDataTypeable #-}
2+
33
-- | Allows HUnit test cases to be used with the test-framework package.
44
--
55
-- For an example of how to use test-framework, please see <http://github.com/batterseapower/test-framework/raw/master/example/Test/Framework/Example.lhs>
@@ -13,8 +13,6 @@ import Test.Framework.Providers.API
1313
import qualified Test.HUnit.Base
1414
import Test.HUnit.Lang
1515

16-
import Data.Typeable (Typeable)
17-
1816
-- | Create a 'Test' for a HUnit 'Assertion'
1917
testCase :: TestName -> Assertion -> Test
2018
testCase name = Test name . TestCase
@@ -57,9 +55,7 @@ testCaseSucceeded :: TestCaseResult -> Bool
5755
testCaseSucceeded TestCasePassed = True
5856
testCaseSucceeded _ = False
5957

60-
6158
newtype TestCase = TestCase Assertion
62-
deriving Typeable
6359

6460
instance Testlike TestCaseRunning TestCaseResult TestCase where
6561
runTest topts (TestCase assertion) = runTestCase topts assertion

hunit/test-framework-hunit.cabal

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Cabal-Version: 1.18
22
Name: test-framework-hunit
3-
Version: 0.3.0.2
3+
Version: 0.3.0.3
44
Category: Testing
55
Synopsis: HUnit support for the test-framework package.
66
License: BSD3
@@ -12,9 +12,13 @@ Bug-Reports: https://github.com/haskell/test-framework/issues
1212
Build-Type: Simple
1313
Description: @HUnit@ support for the @test-framework@ package.
1414

15+
extra-doc-files:
16+
ChangeLog.md
17+
1518
Tested-With:
19+
GHC == 9.14.1
1620
GHC == 9.12.2
17-
GHC == 9.10.2
21+
GHC == 9.10.3
1822
GHC == 9.8.4
1923
GHC == 9.6.7
2024
GHC == 9.4.8

0 commit comments

Comments
 (0)