Skip to content

Commit 61a2dc7

Browse files
authored
Merge pull request #42 from haskellari/noble
Support GHC-8.6.5...9.10.1
2 parents 43cbc1a + ffa73ee commit 61a2dc7

File tree

9 files changed

+62
-170
lines changed

9 files changed

+62
-170
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 39 additions & 88 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.17.20231010
11+
# version: 0.19.20240514
1212
#
13-
# REGENDATA ("0.17.20231010",["github","microstache.cabal"])
13+
# REGENDATA ("0.19.20240514",["github","microstache.cabal"])
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,69 +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
104-
allow-failure: false
105-
- compiler: ghc-7.4.2
106-
compilerKind: ghc
107-
compilerVersion: 7.4.2
108-
setup-method: hvr-ppa
78+
setup-method: ghcup
10979
allow-failure: false
11080
fail-fast: false
11181
steps:
11282
- name: apt
11383
run: |
11484
apt-get update
11585
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
116-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
117-
mkdir -p "$HOME/.ghcup/bin"
118-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
119-
chmod a+x "$HOME/.ghcup/bin/ghcup"
120-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
121-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
122-
else
123-
apt-add-repository -y 'ppa:hvr/ghc'
124-
apt-get update
125-
apt-get install -y "$HCNAME"
126-
mkdir -p "$HOME/.ghcup/bin"
127-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
128-
chmod a+x "$HOME/.ghcup/bin/ghcup"
129-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
130-
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)
13191
env:
13292
HCKIND: ${{ matrix.compilerKind }}
13393
HCNAME: ${{ matrix.compiler }}
@@ -139,22 +99,13 @@ jobs:
13999
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
140100
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
141101
HCDIR=/opt/$HCKIND/$HCVER
142-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
143-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
144-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
145-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
146-
echo "HC=$HC" >> "$GITHUB_ENV"
147-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
148-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
149-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
150-
else
151-
HC=$HCDIR/bin/$HCKIND
152-
echo "HC=$HC" >> "$GITHUB_ENV"
153-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
154-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
155-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
156-
fi
157-
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"
158109
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
159110
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
160111
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
@@ -211,7 +162,7 @@ jobs:
211162
chmod a+x $HOME/.cabal/bin/cabal-plan
212163
cabal-plan --version
213164
- name: checkout
214-
uses: actions/checkout@v3
165+
uses: actions/checkout@v4
215166
with:
216167
path: source
217168
- name: initial cabal.project for sdist
@@ -235,19 +186,19 @@ jobs:
235186
touch cabal.project
236187
touch cabal.project.local
237188
echo "packages: ${PKGDIR_microstache}" >> cabal.project
238-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package microstache" >> cabal.project ; fi
239-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
189+
echo "package microstache" >> cabal.project
190+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
240191
cat >> cabal.project <<EOF
241192
EOF
242-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(microstache)$/; }' >> cabal.project.local
193+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(microstache)$/; }' >> cabal.project.local
243194
cat cabal.project
244195
cat cabal.project.local
245196
- name: dump install plan
246197
run: |
247198
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
248199
cabal-plan
249200
- name: restore cache
250-
uses: actions/cache/restore@v3
201+
uses: actions/cache/restore@v4
251202
with:
252203
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
253204
path: ~/.cabal/store
@@ -288,13 +239,13 @@ jobs:
288239
$CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='parsec >=3.1.16' all
289240
- name: constraint set transformers-0.6
290241
run: |
291-
if [ $((HCNUMVER >= 80600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='transformers ^>=0.6' all --dry-run ; fi
292-
if [ $((HCNUMVER >= 80600)) -ne 0 ] ; then cabal-plan topo | sort ; fi
293-
if [ $((HCNUMVER >= 80600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='transformers ^>=0.6' --dependencies-only -j2 all ; fi
294-
if [ $((HCNUMVER >= 80600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='transformers ^>=0.6' all ; fi
295-
if [ $((HCNUMVER >= 80600)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='transformers ^>=0.6' all ; fi
242+
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='transformers ^>=0.6' all --dry-run
243+
cabal-plan topo | sort
244+
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='transformers ^>=0.6' --dependencies-only -j2 all
245+
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='transformers ^>=0.6' all
246+
$CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='transformers ^>=0.6' all
296247
- name: save cache
297-
uses: actions/cache/save@v3
248+
uses: actions/cache/save@v4
298249
if: always()
299250
with:
300251
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## microstache 1.0.3
2+
3+
- Support GHC-8.6.5...GHC-9.10.1
4+
15
## microstache 1.0.2.3
26

37
- Support `parsec-3.1.16.*`

microstache.cabal

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
cabal-version: 2.2
12
name: microstache
2-
version: 1.0.2.3
3-
x-revision: 3
4-
cabal-version: >=1.10
5-
license: BSD3
3+
version: 1.0.3
4+
license: BSD-3-Clause
65
license-file: LICENSE
76
author:
87
Mark Karpov <[email protected]>, Oleg Grenrus <[email protected]>
@@ -30,45 +29,33 @@ extra-source-files:
3029
specification/sections.json
3130

3231
tested-with:
33-
GHC ==7.4.2
34-
|| ==7.6.3
35-
|| ==7.8.4
36-
|| ==7.10.3
37-
|| ==8.0.2
38-
|| ==8.2.2
39-
|| ==8.4.4
40-
|| ==8.6.5
32+
GHC ==8.6.5
4133
|| ==8.8.4
4234
|| ==8.10.7
4335
|| ==9.0.2
4436
|| ==9.2.8
45-
|| ==9.4.7
46-
|| ==9.6.3
47-
|| ==9.8.1
37+
|| ==9.4.8
38+
|| ==9.6.5
39+
|| ==9.8.2
40+
|| ==9.10.1
4841

4942
source-repository head
5043
type: git
5144
location: https://github.com/haskellari/microstache.git
5245

5346
library
5447
build-depends:
55-
aeson >=0.11 && <1.6 || >=2.0.0.0 && <2.3
56-
, base >=4.5 && <4.20
57-
, containers >=0.4.2.1 && <0.7
58-
, deepseq >=1.3.0.0 && <1.6
59-
, directory >=1.1.0.2 && <1.4
60-
, filepath >=1.3.0.0 && <1.5
61-
, parsec >=3.1.11 && <3.2
62-
, text >=1.2.3.0 && <1.3 || >=2.0 && <2.2
63-
, transformers >=0.3.0.0 && <0.7
64-
, unordered-containers >=0.2.5 && <0.3
65-
, vector >=0.11 && <0.14
66-
67-
if impl(ghc <=7.6)
68-
build-depends: ghc-prim
69-
70-
if !impl(ghc >=8.0)
71-
build-depends: semigroups >=0.18 && <0.21
48+
aeson >=2.2.2.0 && <2.3
49+
, base >=4.12.0.0 && <4.21
50+
, containers >=0.6.0.1 && <0.8
51+
, deepseq >=1.4.4.0 && <1.6
52+
, directory >=1.3.3.0 && <1.4
53+
, filepath >=1.4.2.1 && <1.6
54+
, parsec >=3.1.13.0 && <3.2
55+
, text >=1.2.3.0 && <1.3 || >=2.0 && <2.2
56+
, transformers >=0.5.6.2 && <0.7
57+
, unordered-containers >=0.2.20 && <0.3
58+
, vector >=0.13.1.0 && <0.14
7259

7360
exposed-modules:
7461
Text.Microstache

src/Text/Microstache/Compile.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
-- usually need to import the module, because "Text.Microstache" re-exports
1212
-- everything you may need, import that module instead.
1313

14-
{-# LANGUAGE CPP #-}
15-
1614
module Text.Microstache.Compile
1715
( compileMustacheDir
1816
, getMustacheFilesInDir
@@ -32,10 +30,6 @@ import qualified Data.Text as T
3230
import qualified Data.Text.Lazy.IO as LT
3331
import qualified System.FilePath as F
3432

35-
#if !MIN_VERSION_base(4,8,0)
36-
import Control.Applicative ((<$>))
37-
#endif
38-
3933
import Text.Microstache.Parser
4034
import Text.Microstache.Type
4135

src/Text/Microstache/Parser.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
-- import the module, because "Text.Microstache" re-exports everything you may
1212
-- need, import that module instead.
1313

14-
{-# LANGUAGE CPP #-}
1514
module Text.Microstache.Parser
1615
( parseMustache )
1716
where
@@ -35,10 +34,6 @@ import Text.Microstache.Type
3534

3635
import qualified Data.Text as T
3736

38-
#if !MIN_VERSION_base(4,8,0)
39-
import Control.Applicative (Applicative (..))
40-
#endif
41-
4237
----------------------------------------------------------------------------
4338
-- Parser
4439

src/Text/Microstache/Render.hs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
-- import the module, because "Text.Microstache" re-exports everything you may
1212
-- need, import that module instead.
1313

14-
{-# LANGUAGE CPP #-}
1514
{-# LANGUAGE OverloadedStrings #-}
1615
module Text.Microstache.Render
1716
( renderMustache, renderMustacheW )
@@ -37,32 +36,13 @@ import qualified Data.Text.Lazy.Builder as B
3736
import qualified Data.Text.Lazy.Encoding as LTE
3837
import qualified Data.Vector as V
3938

40-
#if MIN_VERSION_aeson(2,0,0)
4139
import qualified Data.Aeson.KeyMap as KM
4240
import qualified Data.Aeson.Key as Key
43-
#else
44-
import qualified Data.HashMap.Strict as KM
45-
#endif
4641

47-
#if MIN_VERSION_transformers(0,4,0)
4842
import Control.Monad.Trans.State.Strict (State, execState, modify')
49-
#else
50-
import Control.Monad.Trans.State.Strict (State, execState, get, put)
51-
#endif
52-
53-
#if !MIN_VERSION_base(4,8,0)
54-
import Control.Applicative ((<$>))
55-
#endif
5643

5744
import Text.Microstache.Type
5845

59-
#if !(MIN_VERSION_transformers(0,4,0))
60-
modify' :: (s -> s) -> State s ()
61-
modify' f = do
62-
s <- get
63-
put $! f s
64-
#endif
65-
6646
----------------------------------------------------------------------------
6747
-- The rendering monad
6848

@@ -242,11 +222,7 @@ simpleLookup
242222
-> Maybe Value -- ^ Looked-up value
243223
simpleLookup _ (Key []) obj = return obj
244224
simpleLookup c (Key (k:ks)) (Object m) =
245-
#if MIN_VERSION_aeson(2,0,0)
246225
case KM.lookup (Key.fromText k) m of
247-
#else
248-
case KM.lookup k m of
249-
#endif
250226
Nothing -> if c then Just Null else Nothing
251227
Just v -> simpleLookup True (Key ks) v
252228
simpleLookup _ _ _ = Nothing

0 commit comments

Comments
 (0)