Skip to content

Commit 26afd05

Browse files
committed
v0.1.0.2 revision 1: Allow newer containers
1 parent 9c237e0 commit 26afd05

File tree

5 files changed

+151
-91
lines changed

5 files changed

+151
-91
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
#
77
# haskell-ci regenerate
88
#
9-
# For more information, see https://github.com/andreasabel/haskell-ci
9+
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.19.20241021
11+
# version: 0.19.20250216
1212
#
13-
# REGENDATA ("0.19.20241021",["github","microaeson.cabal"])
13+
# REGENDATA ("0.19.20250216",["github","microaeson.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -23,7 +23,7 @@ on:
2323
jobs:
2424
linux:
2525
name: Haskell-CI - Linux - ${{ matrix.compiler }}
26-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-24.04
2727
timeout-minutes:
2828
60
2929
container:
@@ -32,19 +32,19 @@ jobs:
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.12.20241014
35+
- compiler: ghc-9.12.1
3636
compilerKind: ghc
37-
compilerVersion: 9.12.20241014
37+
compilerVersion: 9.12.1
3838
setup-method: ghcup
3939
allow-failure: false
4040
- compiler: ghc-9.10.1
4141
compilerKind: ghc
4242
compilerVersion: 9.10.1
4343
setup-method: ghcup
4444
allow-failure: false
45-
- compiler: ghc-9.8.2
45+
- compiler: ghc-9.8.4
4646
compilerKind: ghc
47-
compilerVersion: 9.8.2
47+
compilerVersion: 9.8.4
4848
setup-method: ghcup
4949
allow-failure: false
5050
- compiler: ghc-9.6.6
@@ -99,16 +99,29 @@ jobs:
9999
allow-failure: false
100100
fail-fast: false
101101
steps:
102-
- name: apt
102+
- name: apt-get install
103103
run: |
104104
apt-get update
105105
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
106+
- name: Install GHCup
107+
run: |
106108
mkdir -p "$HOME/.ghcup/bin"
107109
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
108110
chmod a+x "$HOME/.ghcup/bin/ghcup"
109-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
110-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
111+
- name: Install cabal-install
112+
run: |
111113
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
114+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
115+
- name: Install GHC (GHCup)
116+
if: matrix.setup-method == 'ghcup'
117+
run: |
118+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
119+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
120+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
121+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
122+
echo "HC=$HC" >> "$GITHUB_ENV"
123+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
124+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
112125
env:
113126
HCKIND: ${{ matrix.compilerKind }}
114127
HCNAME: ${{ matrix.compiler }}
@@ -119,21 +132,12 @@ jobs:
119132
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
120133
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
121134
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
122-
HCDIR=/opt/$HCKIND/$HCVER
123-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
124-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
125-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
126-
echo "HC=$HC" >> "$GITHUB_ENV"
127-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
128-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
129-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
130135
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
131136
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
132137
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
133138
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
134-
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
139+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
135140
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
136-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
137141
env:
138142
HCKIND: ${{ matrix.compilerKind }}
139143
HCNAME: ${{ matrix.compiler }}
@@ -160,18 +164,6 @@ jobs:
160164
repository hackage.haskell.org
161165
url: http://hackage.haskell.org/
162166
EOF
163-
if $HEADHACKAGE; then
164-
cat >> $CABAL_CONFIG <<EOF
165-
repository head.hackage.ghc.haskell.org
166-
url: https://ghc.gitlab.haskell.org/head.hackage/
167-
secure: True
168-
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
169-
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
170-
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
171-
key-threshold: 3
172-
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
173-
EOF
174-
fi
175167
cat >> $CABAL_CONFIG <<EOF
176168
program-default-options
177169
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -222,10 +214,8 @@ jobs:
222214
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package microaeson" >> cabal.project ; fi
223215
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
224216
cat >> cabal.project <<EOF
217+
allow-newer: containers
225218
EOF
226-
if $HEADHACKAGE; then
227-
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
228-
fi
229219
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(microaeson)$/; }' >> cabal.project.local
230220
cat cabal.project
231221
cat cabal.project.local
@@ -263,9 +253,19 @@ jobs:
263253
run: |
264254
rm -f cabal.project.local
265255
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
256+
- name: prepare for constraint sets
257+
run: |
258+
rm -f cabal.project.local
259+
- name: constraint set containers-0.8
260+
run: |
261+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers ^>= 0.8' all --dry-run ; fi
262+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then cabal-plan topo | sort ; fi
263+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers ^>= 0.8' --dependencies-only -j2 all ; fi
264+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers ^>= 0.8' all ; fi
265+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers ^>= 0.8' all ; fi
266266
- name: save cache
267-
uses: actions/cache/save@v4
268267
if: always()
268+
uses: actions/cache/save@v4
269269
with:
270270
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
271271
path: ~/.cabal/store

.github/workflows/stack.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Stack build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
defaults:
12+
run:
13+
shell: bash
14+
15+
jobs:
16+
stack:
17+
name: ${{ matrix.os }} Stack ${{ matrix.plan.resolver }} / ${{ matrix.plan.ghc }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-latest]
22+
plan:
23+
- ghc: '9.10.1'
24+
resolver: 'nightly-2025-03-11'
25+
- ghc: '9.8.4'
26+
resolver: 'lts-23.14'
27+
- ghc: '9.6.6'
28+
resolver: 'lts-22.43'
29+
- ghc: '9.4.8'
30+
resolver: 'lts-21.25'
31+
- ghc: '9.2.8'
32+
resolver: 'lts-20.26'
33+
- ghc: '9.0.2'
34+
resolver: 'lts-19.33'
35+
- ghc: '8.10.7'
36+
resolver: 'lts-18.28'
37+
- ghc: '8.8.4'
38+
resolver: 'lts-16.31'
39+
- ghc: '8.6.5'
40+
resolver: 'lts-14.27'
41+
- ghc: '8.4.4'
42+
resolver: 'lts-12.26'
43+
44+
include:
45+
- os: windows-latest
46+
plan:
47+
ghc: '9.10.1'
48+
resolver: 'nightly-2025-03-11'
49+
50+
- os: macos-latest
51+
plan:
52+
ghc: '9.10.1'
53+
resolver: 'nightly-2025-03-11'
54+
55+
runs-on: ${{ matrix.os }}
56+
env:
57+
STACK: stack --system-ghc --no-terminal --resolver ${{ matrix.plan.resolver }}
58+
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- uses: haskell-actions/setup@latest
63+
id: setup
64+
with:
65+
ghc-version: ${{ matrix.plan.ghc }}
66+
enable-stack: true
67+
cabal-update: false
68+
69+
- uses: actions/cache/restore@v4
70+
id: cache
71+
env:
72+
key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}
73+
with:
74+
path: ${{ steps.setup.outputs.stack-root }}
75+
key: ${{ env.key }}-${{ github.sha }}
76+
restore-keys: ${{ env.key }}-
77+
78+
- name: Configure
79+
run: $STACK init
80+
81+
- name: Install dependencies
82+
run: $STACK test --only-dependencies
83+
84+
- name: Build
85+
run: $STACK test --haddock --no-haddock-deps --no-run-tests
86+
87+
- name: Test
88+
run: $STACK -j 1 test --haddock --no-haddock-deps
89+
90+
- uses: actions/cache/save@v4
91+
if: always() && steps.cache.outputs.cache-hit != 'true'
92+
with:
93+
path: ${{ steps.setup.outputs.stack-root }}
94+
key: ${{ steps.cache.outputs.cache-primary-key }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
/dist-newstyle/
22
/.stack-work/
3+
stack*.yaml.lock
4+
.ghc.environment.*
5+
*~

cabal.haskell-ci

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,10 @@
11
branches: master
22

3-
-- constraint-set containers-0.7
4-
-- ghc: >= 8.2 && < 9.8
5-
-- constraints: containers ^>= 0.7
6-
-- tests: True
7-
-- run-tests: True
3+
constraint-set containers-0.8
4+
ghc: >= 8.2
5+
constraints: containers ^>= 0.8
6+
tests: True
7+
run-tests: True
88

9-
-- raw-project
10-
-- allow-newer: containers
11-
12-
-- -- `allow-newer: text` breaks aeson in the GHC-8.2 build
13-
-- enabled: < 8.2 || > 8.3
14-
--
15-
-- constraint-set bytestring-0.12
16-
-- ghc: >= 8.2
17-
-- constraints: bytestring ^>= 0.12
18-
-- constraints: text < 2.1
19-
-- -- otherwise aeson fails to build
20-
-- tests: True
21-
-- run-tests: True
22-
--
23-
-- constraint-set text-2.1
24-
-- ghc: >= 8.2 && < 9.8
25-
-- constraints: text ^>= 2.1
26-
-- -- Cannot build aeson with text-2.1 atm (2023-08-31)
27-
-- tests: False
28-
--
29-
-- constraint-set text-2.1-tests
30-
-- ghc: >= 9.8
31-
-- constraints: text ^>= 2.1
32-
-- tests: True
33-
-- run-tests: True
34-
--
35-
-- -- For constraint-sets
36-
-- raw-project
37-
-- allow-newer: bytestring
38-
-- allow-newer: text
9+
raw-project
10+
allow-newer: containers

microaeson.cabal

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cabal-version: 2.0
22
name: microaeson
33
version: 0.1.0.2
4+
x-revision: 1
45

56
synopsis: A tiny JSON library with light dependency footprint
67
license: GPL-3
@@ -20,9 +21,9 @@ The API is designed in such a way to allow to easily convert client code written
2021
}
2122

2223
tested-with:
23-
GHC == 9.12.0
24+
GHC == 9.12.1
2425
GHC == 9.10.1
25-
GHC == 9.8.2
26+
GHC == 9.8.4
2627
GHC == 9.6.6
2728
GHC == 9.4.8
2829
GHC == 9.2.8
@@ -58,18 +59,13 @@ library
5859
other-modules: Data.Aeson.Micro.Parser
5960
Data.Aeson.Micro.Scanner
6061

61-
build-depends: array ^>= 0.5.1.0
62-
, base >= 4.8.0.0 && < 5
63-
, bytestring >= 0.10.6.0 && < 0.13
64-
, containers ^>= 0.5.6.2
65-
|| ^>= 0.6.0.1
66-
|| ^>= 0.7
67-
, deepseq ^>= 1.4.1.1
68-
|| ^>= 1.5.0.0
62+
build-depends: array ^>= 0.5.1.1
63+
, base >= 4.9.0.0 && < 5
64+
, bytestring >= 0.10.8.0 && < 0.13
65+
, containers >= 0.5.7.1 && < 1
66+
, deepseq >= 1.4.2.0 && < 1.6
6967
, fail ^>= 4.9.0.0
70-
, text ^>= 1.2.2.2
71-
|| ^>= 2.0
72-
|| ^>= 2.1
68+
, text >= 1.2.2.2 && < 1.3 || >= 2.0 && < 3
7369

7470
build-tool-depends: alex:alex >= 3.2.0
7571

@@ -100,12 +96,7 @@ test-suite microaeson
10096
, text
10197

10298
-- dependencies requiring constraints
103-
build-depends: aeson ^>= 1.3.1.0
104-
|| ^>= 1.4.7.1
105-
|| ^>= 1.5.6.0
106-
|| ^>= 2.0.3.0
107-
|| ^>= 2.1.0.0
108-
|| ^>= 2.2.0.0
99+
build-depends: aeson >= 1.3.1.0 && < 2.3
109100
, QuickCheck >= 2.11.3 && < 2.16
110101
, quickcheck-instances ^>= 0.3.16
111102
, tasty >= 1.0.1.1 && < 1.6

0 commit comments

Comments
 (0)