Skip to content

Commit fc766cd

Browse files
committed
Drop support of GHC < 8
1 parent 44553cb commit fc766cd

File tree

5 files changed

+54
-112
lines changed

5 files changed

+54
-112
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 48 additions & 82 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.18.1
11+
# version: 0.19.20250605
1212
#
13-
# REGENDATA ("0.18.1",["github","bzlib.cabal"])
13+
# REGENDATA ("0.19.20250605",["github","bzlib.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -19,23 +19,33 @@ on:
1919
jobs:
2020
linux:
2121
name: Haskell-CI - Linux - ${{ matrix.compiler }}
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-24.04
2323
timeout-minutes:
2424
60
2525
container:
26-
image: buildpack-deps:bionic
26+
image: buildpack-deps:jammy
2727
continue-on-error: ${{ matrix.allow-failure }}
2828
strategy:
2929
matrix:
3030
include:
31-
- compiler: ghc-9.8.2
31+
- compiler: ghc-9.12.2
3232
compilerKind: ghc
33-
compilerVersion: 9.8.2
33+
compilerVersion: 9.12.2
3434
setup-method: ghcup
3535
allow-failure: false
36-
- compiler: ghc-9.6.4
36+
- compiler: ghc-9.10.2
3737
compilerKind: ghc
38-
compilerVersion: 9.6.4
38+
compilerVersion: 9.10.2
39+
setup-method: ghcup
40+
allow-failure: false
41+
- compiler: ghc-9.8.4
42+
compilerKind: ghc
43+
compilerVersion: 9.8.4
44+
setup-method: ghcup
45+
allow-failure: false
46+
- compiler: ghc-9.6.7
47+
compilerKind: ghc
48+
compilerVersion: 9.6.7
3949
setup-method: ghcup
4050
allow-failure: false
4151
- compiler: ghc-9.4.8
@@ -61,79 +71,53 @@ jobs:
6171
- compiler: ghc-8.8.4
6272
compilerKind: ghc
6373
compilerVersion: 8.8.4
64-
setup-method: hvr-ppa
74+
setup-method: ghcup
6575
allow-failure: false
6676
- compiler: ghc-8.6.5
6777
compilerKind: ghc
6878
compilerVersion: 8.6.5
69-
setup-method: hvr-ppa
79+
setup-method: ghcup
7080
allow-failure: false
7181
- compiler: ghc-8.4.4
7282
compilerKind: ghc
7383
compilerVersion: 8.4.4
74-
setup-method: hvr-ppa
84+
setup-method: ghcup
7585
allow-failure: false
7686
- compiler: ghc-8.2.2
7787
compilerKind: ghc
7888
compilerVersion: 8.2.2
79-
setup-method: hvr-ppa
89+
setup-method: ghcup
8090
allow-failure: false
8191
- compiler: ghc-8.0.2
8292
compilerKind: ghc
8393
compilerVersion: 8.0.2
84-
setup-method: hvr-ppa
85-
allow-failure: false
86-
- compiler: ghc-7.10.3
87-
compilerKind: ghc
88-
compilerVersion: 7.10.3
89-
setup-method: hvr-ppa
90-
allow-failure: false
91-
- compiler: ghc-7.8.4
92-
compilerKind: ghc
93-
compilerVersion: 7.8.4
94-
setup-method: hvr-ppa
95-
allow-failure: false
96-
- compiler: ghc-7.6.3
97-
compilerKind: ghc
98-
compilerVersion: 7.6.3
99-
setup-method: hvr-ppa
100-
allow-failure: false
101-
- compiler: ghc-7.4.2
102-
compilerKind: ghc
103-
compilerVersion: 7.4.2
104-
setup-method: hvr-ppa
105-
allow-failure: false
106-
- compiler: ghc-7.2.2
107-
compilerKind: ghc
108-
compilerVersion: 7.2.2
109-
setup-method: hvr-ppa
110-
allow-failure: false
111-
- compiler: ghc-7.0.4
112-
compilerKind: ghc
113-
compilerVersion: 7.0.4
114-
setup-method: hvr-ppa
94+
setup-method: ghcup
11595
allow-failure: false
11696
fail-fast: false
11797
steps:
118-
- name: apt
98+
- name: apt-get install
11999
run: |
120100
apt-get update
121-
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
122-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
123-
mkdir -p "$HOME/.ghcup/bin"
124-
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
125-
chmod a+x "$HOME/.ghcup/bin/ghcup"
126-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
127-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
128-
else
129-
apt-add-repository -y 'ppa:hvr/ghc'
130-
apt-get update
131-
apt-get install -y "$HCNAME"
132-
mkdir -p "$HOME/.ghcup/bin"
133-
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
134-
chmod a+x "$HOME/.ghcup/bin/ghcup"
135-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
136-
fi
101+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
102+
- name: Install GHCup
103+
run: |
104+
mkdir -p "$HOME/.ghcup/bin"
105+
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
106+
chmod a+x "$HOME/.ghcup/bin/ghcup"
107+
- name: Install cabal-install
108+
run: |
109+
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
110+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
111+
- name: Install GHC (GHCup)
112+
if: matrix.setup-method == 'ghcup'
113+
run: |
114+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
115+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
116+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
117+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
118+
echo "HC=$HC" >> "$GITHUB_ENV"
119+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
120+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
137121
env:
138122
HCKIND: ${{ matrix.compilerKind }}
139123
HCNAME: ${{ matrix.compiler }}
@@ -144,30 +128,12 @@ jobs:
144128
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
145129
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
146130
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
147-
HCDIR=/opt/$HCKIND/$HCVER
148-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
149-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
150-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
151-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
152-
echo "HC=$HC" >> "$GITHUB_ENV"
153-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
154-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
155-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
156-
else
157-
HC=$HCDIR/bin/$HCKIND
158-
echo "HC=$HC" >> "$GITHUB_ENV"
159-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
160-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
161-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
162-
fi
163-
164131
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
165132
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
166133
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
167134
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
168135
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
169136
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
170-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
171137
env:
172138
HCKIND: ${{ matrix.compilerKind }}
173139
HCNAME: ${{ matrix.compiler }}
@@ -217,7 +183,7 @@ jobs:
217183
chmod a+x $HOME/.cabal/bin/cabal-plan
218184
cabal-plan --version
219185
- name: checkout
220-
uses: actions/checkout@v3
186+
uses: actions/checkout@v4
221187
with:
222188
path: source
223189
- name: initial cabal.project for sdist
@@ -245,15 +211,15 @@ jobs:
245211
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
246212
cat >> cabal.project <<EOF
247213
EOF
248-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(bzlib)$/; }' >> cabal.project.local
214+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(bzlib)$/; }' >> cabal.project.local
249215
cat cabal.project
250216
cat cabal.project.local
251217
- name: dump install plan
252218
run: |
253219
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
254220
cabal-plan
255221
- name: restore cache
256-
uses: actions/cache/restore@v3
222+
uses: actions/cache/restore@v4
257223
with:
258224
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
259225
path: ~/.cabal/store
@@ -283,8 +249,8 @@ jobs:
283249
rm -f cabal.project.local
284250
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
285251
- name: save cache
286-
uses: actions/cache/save@v3
287252
if: always()
253+
uses: actions/cache/save@v4
288254
with:
289255
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
290256
path: ~/.cabal/store

.github/workflows/other.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ jobs:
1313
strategy:
1414
fail-fast: true
1515
matrix:
16-
os: [windows-latest, macOS-latest]
16+
os: [windows-latest, macOS-14]
1717
ghc: ['8.4', '9.2', 'latest']
1818
include:
19-
- os: macOS-latest
20-
ghc: '7.10'
21-
- os: macOS-latest
19+
- os: macOS-14
2220
ghc: '8.0'
23-
- os: macOS-latest
21+
- os: macOS-14
2422
ghc: '8.2'
2523
steps:
2624
- uses: actions/checkout@v4
@@ -47,7 +45,7 @@ jobs:
4745
cd bzlib-*/
4846
cabal test
4947
- name: Haddock
50-
if: matrix.ghc != '7.10' && matrix.ghc != '8.0'
48+
if: matrix.ghc != '8.0'
5149
run: |
5250
cd bzlib-*/
5351
cabal haddock

Codec/Compression/BZip/Internal.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ import Control.Monad (when)
4646
import Control.Exception (Exception, throw, assert)
4747
import Control.Monad.ST.Lazy hiding (stToIO)
4848
import Control.Monad.ST.Strict (stToIO)
49-
#if __GLASGOW_HASKELL__ >= 702
5049
import qualified Control.Monad.ST.Unsafe as Unsafe (unsafeIOToST)
51-
#else
52-
import qualified Control.Monad.ST.Strict as Unsafe (unsafeIOToST)
53-
#endif
5450
import qualified Data.ByteString.Lazy as L
5551
import qualified Data.ByteString.Lazy.Internal as L
5652
import qualified Data.ByteString as S

Codec/Compression/BZip/Stream.hsc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,15 @@ import Foreign
6262
( Word8, Ptr, nullPtr, plusPtr, peekByteOff, pokeByteOff
6363
, ForeignPtr, FinalizerPtr, mallocForeignPtrBytes, addForeignPtrFinalizer
6464
, finalizeForeignPtr, withForeignPtr, touchForeignPtr, minusPtr )
65-
#if __GLASGOW_HASKELL__ >= 702
6665
import Foreign.ForeignPtr.Unsafe ( unsafeForeignPtrToPtr )
67-
#else
68-
import Foreign ( unsafeForeignPtrToPtr )
69-
#endif
7066
import Foreign.C
7167
import Data.ByteString.Internal (nullForeignPtr)
7268
import System.IO (hPutStrLn, stderr)
7369
import Control.Applicative (Applicative(..))
7470
import Control.Monad (liftM, ap)
7571
import qualified Control.Monad.Fail as Fail
76-
#if __GLASGOW_HASKELL__ >= 702
77-
#if __GLASGOW_HASKELL__ >= 708
7872
import Control.Monad.ST.Strict
79-
#else
80-
import Control.Monad.ST.Strict hiding (unsafeIOToST)
81-
#endif
8273
import Control.Monad.ST.Unsafe
83-
#else
84-
import Control.Monad.ST.Strict
85-
#endif
8674
import Control.Exception (assert)
8775

8876
import Prelude (Int, IO, Bool, String, Functor, Monad(..), Show(..), return, (>>), (>>=), fmap, (.), ($), fromIntegral, error, otherwise, (<=), (&&), (>=), show, (++), (+), (==), (-), (>))
@@ -257,12 +245,8 @@ instance Applicative Stream where
257245

258246
instance Monad Stream where
259247
(>>=) = thenZ
260-
-- m >>= f = (m `thenZ` \a -> consistencyCheck `thenZ_` returnZ a) `thenZ` f
261248
(>>) = (*>)
262249
return = pure
263-
#if !MIN_VERSION_base(4,13,0)
264-
fail = Fail.fail
265-
#endif
266250

267251
instance Fail.MonadFail Stream where
268252
fail = (finalise >>) . failZ

bzlib.cabal

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cabal-version: 2.0
2121
extra-doc-files: README.md CHANGELOG.md
2222
extra-source-files: cbits-extra/hs-bzlib.h
2323

24-
tested-with: GHC==9.8.2, GHC==9.6.4, GHC==9.4.8, GHC==9.2.8, GHC==9.0.2, GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4
24+
tested-with: GHC==9.12.2, GHC==9.10.2, GHC==9.8.4, GHC==9.6.7, GHC==9.4.8, GHC==9.2.8, GHC==9.0.2, GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2
2525

2626
source-repository head
2727
type: git
@@ -32,10 +32,8 @@ library
3232
exposed-modules: Codec.Compression.BZip,
3333
Codec.Compression.BZip.Internal
3434
other-modules: Codec.Compression.BZip.Stream
35-
build-depends: base >= 3 && < 5,
35+
build-depends: base >= 4.9 && < 5,
3636
bytestring >= 0.9 && < 0.13
37-
if impl(ghc < 8.0)
38-
build-depends: fail < 5
3937
if os(windows)
4038
build-depends: base >= 4.11
4139
includes: bzlib.h

0 commit comments

Comments
 (0)