Skip to content

Commit 5ee6e99

Browse files
committed
v0.2.0.1: drop support for GHC 7
1 parent 1713690 commit 5ee6e99

File tree

4 files changed

+58
-27
lines changed

4 files changed

+58
-27
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 45 additions & 6 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.20250821
1212
#
13-
# REGENDATA ("0.19.20250506",["github","deepseq-generics.cabal"])
13+
# REGENDATA ("0.19.20250821",["github","deepseq-generics.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -32,6 +32,11 @@ jobs:
3232
strategy:
3333
matrix:
3434
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
3540
- compiler: ghc-9.12.2
3641
compilerKind: ghc
3742
compilerVersion: 9.12.2
@@ -110,8 +115,8 @@ jobs:
110115
chmod a+x "$HOME/.ghcup/bin/ghcup"
111116
- name: Install cabal-install
112117
run: |
113-
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
114-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
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"
115120
- name: Install GHC (GHCup)
116121
if: matrix.setup-method == 'ghcup'
117122
run: |
@@ -126,6 +131,21 @@ jobs:
126131
HCKIND: ${{ matrix.compilerKind }}
127132
HCNAME: ${{ matrix.compiler }}
128133
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 }}
129149
- name: Set PATH and environment variables
130150
run: |
131151
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
@@ -136,7 +156,7 @@ jobs:
136156
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
137157
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
138158
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
139-
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
159+
if [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
140160
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
141161
env:
142162
HCKIND: ${{ matrix.compilerKind }}
@@ -164,6 +184,18 @@ jobs:
164184
repository hackage.haskell.org
165185
url: http://hackage.haskell.org/
166186
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
167199
cat >> $CABAL_CONFIG <<EOF
168200
program-default-options
169201
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -212,9 +244,16 @@ jobs:
212244
touch cabal.project.local
213245
echo "packages: ${PKGDIR_deepseq_generics}" >> cabal.project
214246
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package deepseq-generics" >> cabal.project ; fi
215-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> 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 deepseq-generics" >> cabal.project ; fi
249+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
250+
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package deepseq-generics" >> cabal.project ; fi
251+
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
216252
cat >> cabal.project <<EOF
217253
EOF
254+
if $HEADHACKAGE; then
255+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
256+
fi
218257
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(deepseq-generics)$/; }' >> cabal.project.local
219258
cat cabal.project
220259
cat cabal.project.local

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.2.0.1 August 2025
2+
3+
* Drop support for GHC 7
4+
* Tested with GHC 8.0 - 9.14 alpha1
5+
16
## 0.2.0.0 January 2016
27

38
* Add support for GHC 8.0

deepseq-generics.cabal

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
cabal-version: 1.18
12
name: deepseq-generics
2-
version: 0.2.0.0
3-
x-revision: 10
3+
version: 0.2.0.1
44

55
synopsis: GHC.Generics-based Control.DeepSeq.rnf implementation
66
homepage: https://github.com/haskell-hvr/deepseq-generics
@@ -12,9 +12,9 @@ maintainer: https://github.com/haskell-hvr
1212
copyright: 2012, Herbert Valerio Riedel
1313
category: Control
1414
build-type: Simple
15-
cabal-version: >=1.10
1615

1716
tested-with:
17+
GHC == 9.14.1
1818
GHC == 9.12.2
1919
GHC == 9.10.2
2020
GHC == 9.8.4
@@ -50,7 +50,7 @@ description:
5050
for writing code that's also compatible with older @deepseq@
5151
versions not yet providing "GHC.Generics"-support.
5252

53-
extra-source-files: changelog.md
53+
extra-doc-files: changelog.md
5454

5555
source-repository head
5656
type: git
@@ -59,8 +59,7 @@ source-repository head
5959
library
6060
default-language: Haskell2010
6161
exposed-modules: Control.DeepSeq.Generics
62-
build-depends: base >= 4.5 && < 5
63-
, ghc-prim >= 0.2 && < 1
62+
build-depends: base >= 4.9 && < 5
6463
, deepseq >= 1.2.0.1 && < 1.6
6564
other-extensions: BangPatterns, FlexibleContexts, TypeOperators
6665
ghc-options: -Wall
@@ -70,14 +69,13 @@ test-suite deepseq-generics-tests
7069
type: exitcode-stdio-1.0
7170
hs-source-dirs: test
7271
main-is: Suite.hs
73-
other-extensions: CPP, DeriveDataTypeable, DeriveGeneric, TupleSections
72+
other-extensions: CPP, DeriveGeneric, TupleSections
7473
ghc-options: -Wall
7574

7675
build-depends:
7776
base
7877
, deepseq
7978
, deepseq-generics
80-
, ghc-prim
8179
-- end of packages with inherited version constraints
8280
, test-framework >= 0.6.1 && < 0.9
8381
, test-framework-hunit >= 0.2.2 && < 0.9

test/Suite.hs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# LANGUAGE CPP, TupleSections, DeriveDataTypeable, DeriveGeneric #-}
1+
{-# LANGUAGE CPP, TupleSections, DeriveGeneric #-}
22

33
module Main (main) where
44

@@ -8,7 +8,6 @@ import Control.Exception
88
import Control.Monad
99
import Data.Bits
1010
import Data.IORef
11-
import Data.Typeable
1211
import Data.Word
1312
import GHC.Generics
1413
import System.IO.Unsafe (unsafePerformIO)
@@ -21,16 +20,6 @@ import Test.HUnit
2120
-- IUT
2221
import Control.DeepSeq.Generics
2322

24-
-- needed for GHC-7.4 compatibility
25-
#if !MIN_VERSION_base(4,6,0)
26-
atomicModifyIORef' :: IORef a -> (a -> (a,b)) -> IO b
27-
atomicModifyIORef' ref f = do
28-
b <- atomicModifyIORef ref
29-
(\x -> let (a, b) = f x
30-
in (a, a `seq` b))
31-
b `seq` return b
32-
#endif
33-
3423
----------------------------------------------------------------------------
3524
-- simple hacky abstraction for testing forced evaluation via `rnf`-like functions
3625

@@ -72,7 +61,7 @@ instance NFData SeqSet where
7261
{-# NOINLINE rnf #-}
7362

7463
-- |Exception to be thrown for testing 'seq'/'rnf'
75-
data RnfEx = RnfEx deriving (Eq, Show, Typeable)
64+
data RnfEx = RnfEx deriving (Eq, Show)
7665

7766
instance Exception RnfEx
7867

0 commit comments

Comments
 (0)