Skip to content

Commit e794c8a

Browse files
authored
Merge pull request #29 from haskellari/noble
Support GHC-8.6.5...9.10.1
2 parents f26d4ff + 008d4e5 commit e794c8a

File tree

8 files changed

+71
-164
lines changed

8 files changed

+71
-164
lines changed

.github/workflows/haskell-ci.yml

+34-78
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.17.20231010
11+
# version: 0.19.20240514
1212
#
13-
# REGENDATA ("0.17.20231010",["github","cabal.project"])
13+
# REGENDATA ("0.19.20240514",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -27,24 +27,29 @@ jobs:
2727
timeout-minutes:
2828
60
2929
container:
30-
image: buildpack-deps:bionic
30+
image: buildpack-deps:jammy
3131
continue-on-error: ${{ matrix.allow-failure }}
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.8.1
35+
- compiler: ghc-9.10.1
3636
compilerKind: ghc
37-
compilerVersion: 9.8.1
37+
compilerVersion: 9.10.1
3838
setup-method: ghcup
3939
allow-failure: false
40-
- compiler: ghc-9.6.3
40+
- compiler: ghc-9.8.2
4141
compilerKind: ghc
42-
compilerVersion: 9.6.3
42+
compilerVersion: 9.8.2
4343
setup-method: ghcup
4444
allow-failure: false
45-
- compiler: ghc-9.4.7
45+
- compiler: ghc-9.6.5
4646
compilerKind: ghc
47-
compilerVersion: 9.4.7
47+
compilerVersion: 9.6.5
48+
setup-method: ghcup
49+
allow-failure: false
50+
- compiler: ghc-9.4.8
51+
compilerKind: ghc
52+
compilerVersion: 9.4.8
4853
setup-method: ghcup
4954
allow-failure: false
5055
- compiler: ghc-9.2.8
@@ -65,64 +70,24 @@ jobs:
6570
- compiler: ghc-8.8.4
6671
compilerKind: ghc
6772
compilerVersion: 8.8.4
68-
setup-method: hvr-ppa
73+
setup-method: ghcup
6974
allow-failure: false
7075
- compiler: ghc-8.6.5
7176
compilerKind: ghc
7277
compilerVersion: 8.6.5
73-
setup-method: hvr-ppa
74-
allow-failure: false
75-
- compiler: ghc-8.4.4
76-
compilerKind: ghc
77-
compilerVersion: 8.4.4
78-
setup-method: hvr-ppa
79-
allow-failure: false
80-
- compiler: ghc-8.2.2
81-
compilerKind: ghc
82-
compilerVersion: 8.2.2
83-
setup-method: hvr-ppa
84-
allow-failure: false
85-
- compiler: ghc-8.0.2
86-
compilerKind: ghc
87-
compilerVersion: 8.0.2
88-
setup-method: hvr-ppa
89-
allow-failure: false
90-
- compiler: ghc-7.10.3
91-
compilerKind: ghc
92-
compilerVersion: 7.10.3
93-
setup-method: hvr-ppa
94-
allow-failure: false
95-
- compiler: ghc-7.8.4
96-
compilerKind: ghc
97-
compilerVersion: 7.8.4
98-
setup-method: hvr-ppa
99-
allow-failure: false
100-
- compiler: ghc-7.6.3
101-
compilerKind: ghc
102-
compilerVersion: 7.6.3
103-
setup-method: hvr-ppa
78+
setup-method: ghcup
10479
allow-failure: false
10580
fail-fast: false
10681
steps:
10782
- name: apt
10883
run: |
10984
apt-get update
11085
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
111-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
112-
mkdir -p "$HOME/.ghcup/bin"
113-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
114-
chmod a+x "$HOME/.ghcup/bin/ghcup"
115-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
116-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
117-
else
118-
apt-add-repository -y 'ppa:hvr/ghc'
119-
apt-get update
120-
apt-get install -y "$HCNAME"
121-
mkdir -p "$HOME/.ghcup/bin"
122-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
123-
chmod a+x "$HOME/.ghcup/bin/ghcup"
124-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
125-
fi
86+
mkdir -p "$HOME/.ghcup/bin"
87+
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
88+
chmod a+x "$HOME/.ghcup/bin/ghcup"
89+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
90+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
12691
env:
12792
HCKIND: ${{ matrix.compilerKind }}
12893
HCNAME: ${{ matrix.compiler }}
@@ -134,22 +99,13 @@ jobs:
13499
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
135100
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
136101
HCDIR=/opt/$HCKIND/$HCVER
137-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
138-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
139-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
140-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
141-
echo "HC=$HC" >> "$GITHUB_ENV"
142-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
143-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
144-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
145-
else
146-
HC=$HCDIR/bin/$HCKIND
147-
echo "HC=$HC" >> "$GITHUB_ENV"
148-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
149-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
150-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
151-
fi
152-
102+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
103+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
104+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
105+
echo "HC=$HC" >> "$GITHUB_ENV"
106+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
107+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
108+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
153109
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
154110
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
155111
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
@@ -206,7 +162,7 @@ jobs:
206162
chmod a+x $HOME/.cabal/bin/cabal-plan
207163
cabal-plan --version
208164
- name: checkout
209-
uses: actions/checkout@v3
165+
uses: actions/checkout@v4
210166
with:
211167
path: source
212168
- name: initial cabal.project for sdist
@@ -230,19 +186,19 @@ jobs:
230186
touch cabal.project
231187
touch cabal.project.local
232188
echo "packages: ${PKGDIR_binary_instances}" >> cabal.project
233-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package binary-instances" >> cabal.project ; fi
234-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
189+
echo "package binary-instances" >> cabal.project
190+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
235191
cat >> cabal.project <<EOF
236192
EOF
237-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(binary-instances)$/; }' >> cabal.project.local
193+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(binary-instances)$/; }' >> cabal.project.local
238194
cat cabal.project
239195
cat cabal.project.local
240196
- name: dump install plan
241197
run: |
242198
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
243199
cabal-plan
244200
- name: restore cache
245-
uses: actions/cache/restore@v3
201+
uses: actions/cache/restore@v4
246202
with:
247203
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
248204
path: ~/.cabal/store
@@ -272,7 +228,7 @@ jobs:
272228
rm -f cabal.project.local
273229
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
274230
- name: save cache
275-
uses: actions/cache/save@v3
231+
uses: actions/cache/save@v4
276232
if: always()
277233
with:
278234
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.5
2+
3+
- Support GHC-8.6.5...9.10.1
4+
15
## 1.0.4
26

37
- Add instances for `ByteArray` from `data-array-byte` or `base`

binary-instances.cabal

+31-34
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
cabal-version: 2.2
12
name: binary-instances
2-
version: 1.0.4
3-
x-revision: 3
3+
version: 1.0.5
44
synopsis: Orphan instances for binary
55
description:
66
`binary-instances` defines orphan instances for types in some popular packages.
@@ -10,25 +10,19 @@ homepage: https://github.com/haskellari/binary-instances#readme
1010
bug-reports: https://github.com/haskellari/binary-instances/issues
1111
author: Oleg Grenrus <[email protected]>
1212
maintainer: Oleg Grenrus <[email protected]>
13-
license: BSD3
13+
license: BSD-3-Clause
1414
license-file: LICENSE
1515
build-type: Simple
16-
cabal-version: >=1.10
1716
tested-with:
18-
GHC ==7.6.3
19-
|| ==7.8.4
20-
|| ==7.10.3
21-
|| ==8.0.2
22-
|| ==8.2.2
23-
|| ==8.4.4
24-
|| ==8.6.5
17+
GHC ==8.6.5
2518
|| ==8.8.4
2619
|| ==8.10.7
2720
|| ==9.0.2
2821
|| ==9.2.8
29-
|| ==9.4.7
30-
|| ==9.6.3
31-
|| ==9.8.1
22+
|| ==9.4.8
23+
|| ==9.6.5
24+
|| ==9.8.2
25+
|| ==9.10.1
3226

3327
extra-source-files: CHANGELOG.md
3428

@@ -40,21 +34,24 @@ library
4034
default-language: Haskell2010
4135
hs-source-dirs: src
4236
build-depends:
43-
aeson >=0.7.0.6 && <1.6 || >=2.0.0.0 && <2.3
44-
, base >=4.6.0.1 && <4.20
45-
, binary >=0.5.1.1 && <0.8.10
46-
, binary-orphans >=1.0.4 && <1.1
47-
, case-insensitive >=1.2.0.4 && <1.2.2
48-
, hashable >=1.2.3.3 && <1.5
49-
, primitive >=0.7.2.0 && <0.10
50-
, scientific >=0.3.3.8 && <0.4
51-
, tagged >=0.7.3 && <0.8.9
52-
, text >=1.2.0.6 && <1.3 || >=2.0 && <2.2
53-
, text-binary >=0.2.1.1 && <0.3
54-
, time-compat >=1.9.4 && <1.10
55-
, unordered-containers >=0.2.5.1 && <0.3
56-
, vector >=0.10.12.3 && <0.14
57-
, vector-binary-instances >=0.2.1.0 && <0.3
37+
, base >=4.6.0.1 && <4.21
38+
, binary >=0.5.1.1 && <0.8.10
39+
, text >=1.2.3.0 && <1.3 || >=2.0 && <2.2
40+
41+
build-depends:
42+
, case-insensitive >=1.2.1.0 && <1.2.2
43+
, tagged >=0.8.8 && <0.8.9
44+
45+
build-depends:
46+
, aeson ^>=2.2.2.0
47+
, binary-orphans ^>=1.0.5
48+
, hashable ^>=1.4.4.0
49+
, primitive ^>=0.9.0.0
50+
, scientific ^>=0.3.8.0
51+
, time-compat ^>=1.9.7
52+
, unordered-containers ^>=0.2.20
53+
, vector ^>=0.13.1.0
54+
, vector-binary-instances ^>=0.2.5.2
5855

5956
exposed-modules:
6057
Data.Binary.Instances
@@ -76,20 +73,20 @@ test-suite binary-instances-test
7673
hs-source-dirs: test
7774
ghc-options: -Wall -fno-warn-orphans
7875
build-depends:
79-
aeson
76+
, aeson
8077
, base
8178
, binary
8279
, binary-instances
8380
, bytestring
8481
, case-insensitive
8582
, hashable
8683
, primitive
87-
, QuickCheck >=2.13.1 && <2.15
88-
, quickcheck-instances >=0.3.29 && <0.4
84+
, QuickCheck ^>=2.14.3 || ^>=2.15.0.1
85+
, quickcheck-instances ^>=0.3.31
8986
, scientific
9087
, tagged
91-
, tasty >=0.10.1.2 && <1.6
92-
, tasty-quickcheck >=0.8.3.2 && <0.11
88+
, tasty ^>=1.5
89+
, tasty-quickcheck ^>=0.10.3
9390
, text
9491
, time-compat
9592
, unordered-containers

src/Data/Binary/Instances/Aeson.hs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE CPP #-}
21
{-# OPTIONS_GHC -fno-warn-orphans #-}
32
module Data.Binary.Instances.Aeson where
43

@@ -10,12 +9,9 @@ import Data.Binary.Instances.Text ()
109
import Data.Binary.Instances.UnorderedContainers ()
1110
import Data.Binary.Instances.Vector ()
1211

13-
import qualified Data.Aeson as A
14-
15-
#if MIN_VERSION_aeson(2,0,0)
16-
import qualified Data.Aeson.Key as Key
12+
import qualified Data.Aeson as A
13+
import qualified Data.Aeson.Key as Key
1714
import qualified Data.Aeson.KeyMap as KM
18-
#endif
1915

2016
instance Binary A.Value where
2117
get = do
@@ -36,12 +32,10 @@ instance Binary A.Value where
3632
put (A.Bool v) = put (4 :: Int) >> put v
3733
put A.Null = put (5 :: Int)
3834

39-
#if MIN_VERSION_aeson(2,0,0)
4035
instance Binary Key.Key where
4136
get = Key.fromText <$> get
4237
put = put . Key.toText
4338

4439
instance Binary v => Binary (KM.KeyMap v) where
4540
get = fmap KM.fromList get
4641
put = put . KM.toList
47-
#endif

src/Data/Binary/Instances/Hashable.hs

-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
{-# LANGUAGE CPP #-}
21
{-# OPTIONS_GHC -fno-warn-orphans #-}
32
module Data.Binary.Instances.Hashable where
43

54
import Data.Binary.Orphans ()
65

7-
#if MIN_VERSION_hashable(1,2,5)
86
import Data.Binary (Binary, get, put)
97
import qualified Data.Hashable as Hashable
108

119
instance (Hashable.Hashable a, Binary a) => Binary (Hashable.Hashed a) where
1210
get = fmap Hashable.hashed get
1311
put = put . Hashable.unhashed
14-
#endif
-25
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,4 @@
1-
{-# LANGUAGE CPP #-}
21
{-# OPTIONS_GHC -fno-warn-orphans #-}
32
module Data.Binary.Instances.Primitive where
43

54
import Data.Binary.Orphans ()
6-
7-
#if !MIN_VERSION_primitive(0,8,0)
8-
import Control.Monad (replicateM)
9-
import Data.Binary (Binary, Get, Put, get, put)
10-
import Data.Word (Word8)
11-
12-
import qualified Data.Primitive as Prim
13-
14-
-- | @since 1.0.3
15-
instance Binary Prim.ByteArray where
16-
put ba = put maxI >> go 0
17-
where
18-
maxI :: Int
19-
maxI = Prim.sizeofByteArray ba
20-
21-
go :: Int -> Put
22-
go i | i < maxI = put (Prim.indexByteArray ba i :: Word8) >> go (i + 1)
23-
| otherwise = return ()
24-
25-
get = do
26-
len <- get
27-
xs <- replicateM len get
28-
return (Prim.byteArrayFromListN len (xs :: [Word8]))
29-
#endif

0 commit comments

Comments
 (0)