Skip to content

Commit 211a66f

Browse files
committed
v0.0.1.4: drop support for GHC 8.0 and 8.2
1 parent a68b967 commit 211a66f

File tree

4 files changed

+68
-52
lines changed

4 files changed

+68
-52
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 52 additions & 20 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.20251211
1212
#
13-
# REGENDATA ("0.19.20250506",["github","xor.cabal"])
13+
# REGENDATA ("0.19.20251211",["github","xor.cabal"])
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.0.20251128
39+
compilerKind: ghc
40+
compilerVersion: 9.14.0.20251128
41+
setup-method: ghcup-prerelease
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
@@ -87,16 +95,6 @@ jobs:
8795
compilerVersion: 8.4.4
8896
setup-method: ghcup
8997
allow-failure: false
90-
- compiler: ghc-8.2.2
91-
compilerKind: ghc
92-
compilerVersion: 8.2.2
93-
setup-method: ghcup
94-
allow-failure: false
95-
- compiler: ghc-8.0.2
96-
compilerKind: ghc
97-
compilerVersion: 8.0.2
98-
setup-method: ghcup
99-
allow-failure: false
10098
fail-fast: false
10199
steps:
102100
- name: apt-get install
@@ -110,8 +108,8 @@ jobs:
110108
chmod a+x "$HOME/.ghcup/bin/ghcup"
111109
- name: Install cabal-install
112110
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"
111+
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
112+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
115113
- name: Install GHC (GHCup)
116114
if: matrix.setup-method == 'ghcup'
117115
run: |
@@ -126,6 +124,21 @@ jobs:
126124
HCKIND: ${{ matrix.compilerKind }}
127125
HCNAME: ${{ matrix.compiler }}
128126
HCVER: ${{ matrix.compilerVersion }}
127+
- name: Install GHC (GHCup prerelease)
128+
if: matrix.setup-method == 'ghcup-prerelease'
129+
run: |
130+
"$HOME/.ghcup/bin/ghcup" config add-release-channel prereleases
131+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
132+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
133+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
134+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
135+
echo "HC=$HC" >> "$GITHUB_ENV"
136+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
137+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
138+
env:
139+
HCKIND: ${{ matrix.compilerKind }}
140+
HCNAME: ${{ matrix.compiler }}
141+
HCVER: ${{ matrix.compilerVersion }}
129142
- name: Set PATH and environment variables
130143
run: |
131144
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
@@ -136,7 +149,7 @@ jobs:
136149
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
137150
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
138151
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
139-
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
152+
if [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
140153
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
141154
env:
142155
HCKIND: ${{ matrix.compilerKind }}
@@ -164,6 +177,18 @@ jobs:
164177
repository hackage.haskell.org
165178
url: http://hackage.haskell.org/
166179
EOF
180+
if $HEADHACKAGE; then
181+
cat >> $CABAL_CONFIG <<EOF
182+
repository head.hackage.ghc.haskell.org
183+
url: https://ghc.gitlab.haskell.org/head.hackage/
184+
secure: True
185+
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
186+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
187+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
188+
key-threshold: 3
189+
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
190+
EOF
191+
fi
167192
cat >> $CABAL_CONFIG <<EOF
168193
program-default-options
169194
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -187,7 +212,7 @@ jobs:
187212
chmod a+x $HOME/.cabal/bin/cabal-plan
188213
cabal-plan --version
189214
- name: checkout
190-
uses: actions/checkout@v4
215+
uses: actions/checkout@v5
191216
with:
192217
path: source
193218
- name: initial cabal.project for sdist
@@ -211,10 +236,17 @@ jobs:
211236
touch cabal.project
212237
touch cabal.project.local
213238
echo "packages: ${PKGDIR_xor}" >> cabal.project
214-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package xor" >> cabal.project ; fi
215-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
239+
echo "package xor" >> cabal.project
240+
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
241+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package xor" >> cabal.project ; fi
242+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
243+
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package xor" >> cabal.project ; fi
244+
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
216245
cat >> cabal.project <<EOF
217246
EOF
247+
if $HEADHACKAGE; then
248+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
249+
fi
218250
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(xor)$/; }' >> cabal.project.local
219251
cat cabal.project
220252
cat cabal.project.local

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11

2+
## 0.0.1.4
3+
4+
_Andreas Abel, 2025-12-26_
5+
6+
- Drop support for GHC 8.0 and 8.2.
7+
- Drop thus obsolete dependency `ghc-byteorder`.
8+
- Tested with GHC 8.4 - 9.14.
9+
210
## 0.0.1.3
311

412
_Andreas Abel, 2024-06-25_

src/Endianness.hs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,11 @@ module Endianness
2323
) where
2424

2525
import Data.Word (Word16, Word32, Word64, Word8)
26+
import Data.Word (byteSwap16, byteSwap32, byteSwap64)
2627
import Foreign.Ptr
2728
import Foreign.Storable
2829
import GHC.ByteOrder (ByteOrder (..), targetByteOrder)
2930

30-
#if MIN_VERSION_base(4,7,0)
31-
import Data.Word (byteSwap16, byteSwap32, byteSwap64)
32-
#else
33-
import Data.Bits
34-
35-
-- supply missing byteSwap operations
36-
37-
byteSwap16 :: Word16 -> Word16
38-
byteSwap16 = (`rotateL` 8)
39-
40-
byteSwap32 :: Word32 -> Word32
41-
byteSwap32 x
42-
= (x `shiftR` 24) .|.
43-
((x .&. 0x00ff0000) `shiftR` 8) .|.
44-
((x .&. 0x0000ff00) `shiftL` 8) .|.
45-
(x `shiftL` 24)
46-
47-
byteSwap64 :: Word64 -> Word64
48-
byteSwap64 x = xh .|. (xl `shiftL` 32)
49-
where
50-
xl = fromIntegral (byteSwap32 (fromIntegral x))
51-
xh = fromIntegral (byteSwap32 (fromIntegral (x `shiftR` 32)))
52-
#endif
53-
5431
pokeWord16be :: Ptr Word16 -> Word16 -> IO ()
5532
pokeWord16be = case targetByteOrder of
5633
BigEndian -> poke

xor.cabal

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
cabal-version: 2.2
22
name: xor
3-
version: 0.0.1.3
4-
x-revision: 1
3+
version: 0.0.1.4
54

65
category: Data, Codec
76
author: Herbert Valerio Riedel
@@ -31,8 +30,9 @@ description:
3130
The performance is comparable to portable ISO C99 implementations but this library is implemented as pure Haskell and is thereby compatible with compile targets such as <https://github.com/ghcjs/ghcjs GHCJS>.
3231

3332
tested-with:
33+
GHC == 9.14.1
3434
GHC == 9.12.2
35-
GHC == 9.10.2
35+
GHC == 9.10.3
3636
GHC == 9.8.4
3737
GHC == 9.6.7
3838
GHC == 9.4.8
@@ -42,8 +42,6 @@ tested-with:
4242
GHC == 8.8.4
4343
GHC == 8.6.5
4444
GHC == 8.4.4
45-
GHC == 8.2.2
46-
GHC == 8.0.2
4745

4846
extra-doc-files:
4947
CHANGELOG.md
@@ -60,9 +58,10 @@ common defaults
6058
MagicHash
6159

6260
build-depends:
63-
, base >= 4.9 && < 5
64-
, bytestring >= 0.10.4 && < 0.13
65-
, ghc-byteorder ^>= 4.11.0.0
61+
, base >= 4.11 && < 5
62+
-- GHC.ByteOrder ships with base-4.11 and up
63+
, bytestring >= 0.10.8.2 && < 0.13
64+
-- bytestring-0.10.8.2 ships with GHC 8.4
6665

6766
ghc-options:
6867
-Wall

0 commit comments

Comments
 (0)