Skip to content

Commit

Permalink
Drop support for pre-8.0 GHCs
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGlScott committed Dec 5, 2024
1 parent 415a164 commit e2c9bcc
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 192 deletions.
150 changes: 59 additions & 91 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.16.6
# version: 0.19.20241202
#
# REGENDATA ("0.16.6",["github","cabal.project"])
# REGENDATA ("0.19.20241202",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -27,19 +27,29 @@ 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.6.2
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.6.2
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.5
- compiler: ghc-9.8.4
compilerKind: ghc
compilerVersion: 9.4.5
compilerVersion: 9.8.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.6
compilerKind: ghc
compilerVersion: 9.6.6
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.8
Expand All @@ -60,79 +70,53 @@ 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
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.4.4
compilerKind: ghc
compilerVersion: 8.4.4
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.2.2
compilerKind: ghc
compilerVersion: 8.2.2
setup-method: hvr-ppa
setup-method: ghcup
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
allow-failure: false
- compiler: ghc-7.2.2
compilerKind: ghc
compilerVersion: 7.2.2
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.0.4
compilerKind: ghc
compilerVersion: 7.0.4
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: apt
- name: apt-get install
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.19.2/x86_64-linux-ghcup-0.1.19.2 > "$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.1.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.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
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"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -143,28 +127,12 @@ jobs:
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
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/$HCKIND-$HCVER
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.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.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
fi
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"
if [ $((HCNUMVER >= 70400)) -ne 0 ] ; then echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" ; else echo "ARG_TESTS=--disable-tests" >> "$GITHUB_ENV" ; fi
if [ $((HCNUMVER >= 70800)) -ne 0 ] ; then echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" ; else echo "ARG_BENCH=--disable-benchmarks" >> "$GITHUB_ENV" ; fi
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand Down Expand Up @@ -205,9 +173,9 @@ jobs:
run: |
$CABAL v2-update -v
- name: cache (tools)
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-d4542226
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-32bc8c22
path: ~/.haskell-ci-tools
- name: install cabal-plan
run: |
Expand All @@ -220,16 +188,16 @@ jobs:
cabal-plan --version
- name: install doctest
run: |
if [ $((HCNUMVER >= 80000 && HCNUMVER < 90000)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.20' ; fi
if [ $((HCNUMVER >= 80000 && HCNUMVER < 90000)) -ne 0 ] ; then doctest --version ; fi
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.22.0' ; fi
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then doctest --version ; fi
- name: save cache (tools)
uses: actions/cache/save@v3
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-d4542226
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-32bc8c22
path: ~/.haskell-ci-tools
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: source
- name: initial cabal.project for sdist
Expand Down Expand Up @@ -257,15 +225,15 @@ jobs:
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(foldable1-classes-compat)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(foldable1-classes-compat)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
run: |
$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 All @@ -282,18 +250,18 @@ jobs:
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
- name: tests
run: |
if [ $((HCNUMVER >= 70400)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct ; fi
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
- name: doctest
run: |
if [ $((HCNUMVER >= 80000 && HCNUMVER < 90000)) -ne 0 ] ; then cd ${PKGDIR_foldable1_classes_compat} || false ; fi
if [ $((HCNUMVER >= 80000 && HCNUMVER < 90000)) -ne 0 ] ; then doctest -XHaskell2010 src ; fi
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then cd ${PKGDIR_foldable1_classes_compat} || false ; fi
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then doctest -XHaskell2010 src ; fi
- name: cabal check
run: |
cd ${PKGDIR_foldable1_classes_compat} || false
${CABAL} -vnormal check
- name: haddock
run: |
if [ $((HCNUMVER >= 70400)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: unconstrained build
run: |
rm -f cabal.project.local
Expand All @@ -308,8 +276,8 @@ jobs:
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='foldable1 -tagged' --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='foldable1 -tagged' all
- name: save cache
uses: actions/cache/save@v3
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
4 changes: 4 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision history for foldable1-classes-compat

## next -- ????-??-??

* Drop support for pre-8.0 versions of GHC.

## 0.1 -- 2023-02-24

* Backport the `Foldable1` and `Bifoldable1` type classes that were introduced
Expand Down
6 changes: 2 additions & 4 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
branches: master
doctest: >=8.0.2 && <9
haddock: >= 7.4
tests: >= 7.4
benchmarks: >= 7.8 && (<7.8.1 || >7.8.1) && (<8.2.1 || >8.2.1)
doctest: <9
benchmarks: <8.2.1 || >8.2.1

constraint-set no-tagged
constraints: foldable1 -tagged
52 changes: 8 additions & 44 deletions foldable1-classes-compat.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,18 @@ extra-source-files:
CHANGELOG.markdown
README.markdown
tested-with:
GHC ==7.0.4
|| ==7.2.2
|| ==7.4.2
|| ==7.6.3
|| ==7.8.4
|| ==7.10.3
|| ==8.0.2
GHC ==8.0.2
|| ==8.2.2
|| ==8.4.4
|| ==8.6.5
|| ==8.8.4
|| ==8.10.7
|| ==9.0.2
|| ==9.2.8
|| ==9.4.5
|| ==9.6.2
|| ==9.4.8
|| ==9.6.6
|| ==9.8.4
|| ==9.10.1

-- , GHCJS ==8.4

Expand All @@ -60,7 +56,7 @@ flag tagged
library
default-language: Haskell2010
ghc-options: -Wall
build-depends: base >=4.3 && <4.21
build-depends: base >=4.9 && <4.21

if !impl(ghc >= 9.6)
hs-source-dirs: src
Expand All @@ -77,22 +73,11 @@ library
if !impl(ghc >=8.2)
build-depends: bifunctor-classes-compat >=0.1 && <0.2

if !impl(ghc >=8.0)
build-depends:
semigroups >=0.18.5 && <0.21
, transformers-compat >=0.6 && <0.8

if !impl(ghc >= 7.2)
build-depends: generic-deriving >=1.14 && <1.15

if flag(tagged)
build-depends: tagged >=0.4.4 && <1

if impl(ghc >= 9.0)
build-depends: ghc-prim >= 0.7 && <0.12
else
if !impl(ghc >=7.6)
build-depends: ghc-prim

test-suite test
default-language: Haskell2010
Expand All @@ -101,23 +86,12 @@ test-suite test
hs-source-dirs: test
main-is: Tests.hs

-- because of quickcheck-instances
if !impl(ghc >=7.4)
buildable: False

build-depends:
base
, containers
, foldable1-classes-compat
, transformers

if !impl(ghc >=8.0)
build-depends:
semigroups
, transformers-compat

build-depends:
QuickCheck >=2.13.2 && <2.16
, QuickCheck >=2.13.2 && <2.16
, quickcheck-instances >=0.3.27 && <0.4
, test-framework >=0.8.2.0 && <0.9
, test-framework-quickcheck2 >=0.3.0.5 && <0.4
Expand All @@ -129,20 +103,10 @@ benchmark bench
hs-source-dirs: bench
main-is: Bench.hs

if !impl(ghc >=7.6)
buildable: False

build-depends:
base
, containers
, foldable1-classes-compat
, transformers

if !impl(ghc >=8.0)
build-depends:
semigroups
, transformers-compat

build-depends:
tasty-bench >=0.3.5 && < 0.4
, tasty-bench >=0.3.5 && < 0.4
, deepseq >=1.3 && <1.6
Loading

0 comments on commit e2c9bcc

Please sign in to comment.