Skip to content

Commit

Permalink
GHC-8.6.5+ and proper GHC-9.10.1 on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed May 12, 2024
1 parent 9c071b0 commit d94d8d8
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 134 deletions.
124 changes: 34 additions & 90 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20240402
# version: 0.19.20240512
#
# REGENDATA ("0.19.20240402",["github","cabal.project"])
# REGENDATA ("0.19.20240512",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -27,14 +27,14 @@ jobs:
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.10.0.20240328
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.10.0.20240328
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.2
Expand Down Expand Up @@ -70,71 +70,24 @@ jobs:
- compiler: ghc-8.8.4
compilerKind: ghc
compilerVersion: 8.8.4
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.6.5
compilerKind: ghc
compilerVersion: 8.6.5
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-8.4.4
compilerKind: ghc
compilerVersion: 8.4.4
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-8.2.2
compilerKind: ghc
compilerVersion: 8.2.2
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-8.0.2
compilerKind: ghc
compilerVersion: 8.0.2
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.10.3
compilerKind: ghc
compilerVersion: 7.10.3
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.8.4
compilerKind: ghc
compilerVersion: 7.8.4
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.6.3
compilerKind: ghc
compilerVersion: 7.6.3
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.4.2
compilerKind: ghc
compilerVersion: 7.4.2
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: apt
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
if [ "${{ matrix.setup-method }}" = ghcup ]; then
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
else
apt-add-repository -y 'ppa:hvr/ghc'
apt-get update
apt-get install -y "$HCNAME"
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -146,22 +99,13 @@ jobs:
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
if [ "${{ matrix.setup-method }}" = ghcup ]; then
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
else
HC=$HCDIR/bin/$HCKIND
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
fi
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -230,7 +174,7 @@ jobs:
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: source
- name: initial cabal.project for sdist
Expand All @@ -254,8 +198,8 @@ jobs:
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_parsec}" >> cabal.project
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package parsec" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
echo "package parsec" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
if $HEADHACKAGE; then
Expand All @@ -269,7 +213,7 @@ jobs:
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: restore cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand Down Expand Up @@ -303,20 +247,20 @@ jobs:
rm -f cabal.project.local
- name: constraint set bytestring-0.12
run: |
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all --dry-run ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then cabal-plan topo | sort ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' --dependencies-only -j2 all ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all ; fi
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all --dry-run
cabal-plan topo | sort
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all
$CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all
- name: constraint set mtl-2.3
run: |
if [ $((HCNUMVER >= 80600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='mtl ^>=2.3' all --dry-run ; fi
if [ $((HCNUMVER >= 80600)) -ne 0 ] ; then cabal-plan topo | sort ; fi
if [ $((HCNUMVER >= 80600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='mtl ^>=2.3' --dependencies-only -j2 all ; fi
if [ $((HCNUMVER >= 80600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='mtl ^>=2.3' all ; fi
if [ $((HCNUMVER >= 80600)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='mtl ^>=2.3' all ; fi
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='mtl ^>=2.3' all --dry-run
cabal-plan topo | sort
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='mtl ^>=2.3' --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='mtl ^>=2.3' all
$CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='mtl ^>=2.3' all
- name: save cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
Expand Down
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 3.1.18.0

- Drop support for GHCs prior 8.6.5

### 3.1.17.0

- Move `many1 :: ParsecT s u m a -> ParsecT s u m [a]` to `Text.Parsec.Prim`.
Expand Down
11 changes: 5 additions & 6 deletions parsec.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cabal-version: 1.12
name: parsec
version: 3.1.17.0
x-revision: 1
version: 3.1.18.0

synopsis: Monadic parser combinators
description: Parsec is designed from scratch as an industrial-strength parser
Expand All @@ -27,7 +26,7 @@ bug-reports: https://github.com/haskell/parsec/issues
category: Parsing

build-type: Simple
tested-with: GHC ==9.10.1 || ==9.8.2 || ==9.6.4 || ==9.4.8 || ==9.2.8 || ==9.0.2 || ==8.10.7 || ==8.8.4 || ==8.6.5 || ==8.4.4 || ==8.2.2 || ==8.0.2 || ==7.10.3 || ==7.8.4 || ==7.6.3 || ==7.4.2
tested-with: GHC ==9.10.1 || ==9.8.2 || ==9.6.4 || ==9.4.8 || ==9.2.8 || ==9.0.2 || ==8.10.7 || ==8.8.4 || ==8.6.5

extra-source-files: ChangeLog.md, README.md

Expand Down Expand Up @@ -65,9 +64,9 @@ library
Text.ParserCombinators.Parsec.Token

build-depends:
base >= 4.5.1.0 && < 4.21,
mtl >= 2.1.3.1 && < 2.4,
bytestring >= 0.9.2.1 && < 0.13,
base >= 4.12.0.0 && < 4.21,
mtl >= 2.2.2 && < 2.4,
bytestring >= 0.10.8.2 && < 0.13,
text (>= 1.2.3.0 && < 1.3)
|| (>= 2.0 && < 2.2)

Expand Down
5 changes: 1 addition & 4 deletions src/Text/Parsec/Char.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# LANGUAGE CPP, FlexibleContexts, Safe #-}
{-# LANGUAGE FlexibleContexts, Safe #-}

-----------------------------------------------------------------------------
-- |
Expand All @@ -17,9 +17,6 @@
module Text.Parsec.Char where

import Data.Char (isSpace, isUpper, isLower, isAlphaNum, isAlpha, isDigit, isHexDigit, isOctDigit)
#if !(MIN_VERSION_base(4,8,0))
import Control.Applicative ((*>))
#endif

import Text.Parsec.Pos
import Text.Parsec.Prim
Expand Down
3 changes: 0 additions & 3 deletions src/Text/Parsec/Expr.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE Safe #-}

Expand Down Expand Up @@ -46,9 +45,7 @@ data Assoc = AssocNone
data Operator s u m a = Infix (ParsecT s u m (a -> a -> a)) Assoc
| Prefix (ParsecT s u m (a -> a))
| Postfix (ParsecT s u m (a -> a))
#if MIN_VERSION_base(4,7,0)
deriving ( Typeable )
#endif

-- | An @OperatorTable s u m a@ is a list of @Operator s u m a@
-- lists. The list is ordered in descending
Expand Down
15 changes: 0 additions & 15 deletions src/Text/Parsec/Perm.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
Expand Down Expand Up @@ -42,13 +41,7 @@ module Text.Parsec.Perm
) where

import Control.Monad.Identity ( Identity )
#if MIN_VERSION_base(4,7,0)
import Data.Typeable ( Typeable )
#else
-- For GHC 7.6
import Data.Typeable ( Typeable3 )
#endif

import Text.Parsec

infixl 1 <||>, <|?>
Expand Down Expand Up @@ -137,20 +130,12 @@ type PermParser tok st a = StreamPermParser String st a
-- using 'permute'.

data StreamPermParser s st a = Perm (Maybe a) [StreamBranch s st a]
#if MIN_VERSION_base(4,7,0)
deriving ( Typeable )
#else
deriving instance Typeable3 StreamPermParser
#endif

-- type Branch st a = StreamBranch String st a

data StreamBranch s st a = forall b. Branch (StreamPermParser s st (b -> a)) (Parsec s st b)
#if MIN_VERSION_base(4,7,0)
deriving ( Typeable )
#else
deriving instance Typeable3 StreamBranch
#endif

-- | The parser @permute perm@ parses a permutation of parser described
-- by @perm@. For example, suppose we want to parse a permutation of:
Expand Down
8 changes: 0 additions & 8 deletions src/Text/Parsec/Prim.hs
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,7 @@ newtype ParsecT s u m a
-> (ParseError -> m b) -- empty err
-> m b
}
#if MIN_VERSION_base(4,7,0)
deriving ( Typeable )
-- GHC 7.6 doesn't like deriving instances of Typeable for types with
-- non-* type-arguments.
#endif

-- | Low-level unpacking of the ParsecT type. To run your parser, please look to
-- runPT, runP, runParserT, runParser and other such functions.
Expand Down Expand Up @@ -222,11 +218,7 @@ instance Semigroup.Semigroup a => Semigroup.Semigroup (ParsecT s u m a) where
-- discarding the first.
(<>) = Applicative.liftA2 (Semigroup.<>)

#if MIN_VERSION_base(4,8,0)
sconcat = fmap Semigroup.sconcat . sequence
#else
sconcat = fmap (Semigroup.sconcat . NE.fromList) . sequence . NE.toList
#endif
stimes b = Semigroup.sconcat . NE.fromList . genericReplicate b

-- | The 'Monoid' instance for 'ParsecT' is used for the same purposes as
Expand Down
8 changes: 0 additions & 8 deletions src/Text/Parsec/Token.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE PolymorphicComponents #-}
{-# LANGUAGE Safe #-}
Expand Down Expand Up @@ -30,9 +28,7 @@ module Text.Parsec.Token
) where

import Data.Char ( isAlpha, toLower, toUpper, isSpace, digitToInt )
#if MIN_VERSION_base(4,7,0)
import Data.Typeable ( Typeable )
#endif
import Data.List ( nub, sort )
import Control.Monad.Identity (Identity)

Expand Down Expand Up @@ -107,9 +103,7 @@ data GenLanguageDef s u m
caseSensitive :: Bool

}
#if MIN_VERSION_base(4,7,0)
deriving ( Typeable )
#endif

-----------------------------------------------------------
-- A first class module: TokenParser
Expand Down Expand Up @@ -317,9 +311,7 @@ data GenTokenParser s u m

commaSep1 :: forall a . ParsecT s u m a -> ParsecT s u m [a]
}
#if MIN_VERSION_base(4,7,0)
deriving ( Typeable )
#endif

-----------------------------------------------------------
-- Given a LanguageDef, create a token parser.
Expand Down

0 comments on commit d94d8d8

Please sign in to comment.