Skip to content

Commit

Permalink
Drop support for pre-8.0 versions of GHC
Browse files Browse the repository at this point in the history
Unfortunately, it is no longer possible to reasonably test versions of GHC
prior to 8.0 on modern versions of Linux, macOS, or Windows, as these versions
of GHC all run into subtle OS incompatibility issues. While we could leave all
of the old, pre-8.0 code paths around in `base-compat`, this runs the risk of
bitrotting very quickly. As such, I have opted to remove these code paths here.
Given that GHC 7.10.3 was released nearly a decade ago, I believe that the risk
of breaking anyone's workflows by doing this is very minimal.

(It's somewhat unfortunate that we have to drop compatibility like this in an
explicitly compatibility-oriented library like `base-compat`, but so be it.)
  • Loading branch information
RyanGlScott committed Oct 26, 2024
1 parent ef5cf63 commit f7ccdb7
Show file tree
Hide file tree
Showing 217 changed files with 271 additions and 2,112 deletions.
126 changes: 30 additions & 96 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.20240416
# version: 0.19.20240708
#
# REGENDATA ("0.19.20240416",["github","cabal.project"])
# REGENDATA ("0.19.20240708",["github","cabal.project"])
#
# This file is patched to install the typediff utility from its repository
# (see github.yml.patch).
Expand All @@ -26,24 +26,24 @@ 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.20240413
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.10.0.20240413
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.5
- compiler: ghc-9.6.6
compilerKind: ghc
compilerVersion: 9.6.5
compilerVersion: 9.6.6
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
Expand All @@ -69,81 +69,39 @@ 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
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
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
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"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -157,27 +115,18 @@ 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.12.1.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"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
Expand Down Expand Up @@ -206,18 +155,6 @@ jobs:
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
if $HEADHACKAGE; then
cat >> $CABAL_CONFIG <<EOF
repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
secure: True
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
key-threshold: 3
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
EOF
fi
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
Expand Down Expand Up @@ -246,7 +183,7 @@ jobs:
curl -L https://github.com/haskell-compat/base-compat/releases/download/typediff-0.1.6/typediff > $HOME/.local/bin/typediff
chmod a+x $HOME/.local/bin/typediff
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: source
- name: initial cabal.project for sdist
Expand Down Expand Up @@ -286,18 +223,15 @@ jobs:
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
if $HEADHACKAGE; then
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
fi
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(base-compat|base-compat-batteries|type-check)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(base-compat|base-compat-batteries|type-check)$/; }' >> 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 Down Expand Up @@ -331,7 +265,7 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks 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
6 changes: 6 additions & 0 deletions base-compat-batteries/CHANGES.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Changes in next [????.??.??]
- This coincides with the `base-compat-batteries-?.??.?` release. Refer to the
[`base-compat-batteries` changelog](https://github.com/haskell-compat/base-compat/blob/master/base-compat-batteries/CHANGES.markdown#changes-in-????-????????)
for more details.
- Drop support for pre-8.0 versions of GHC.

## Changes in 0.14.0 [2024.04.30]
- This coincides with the `base-compat-batteries-0.14.0` release. Refer to the
[`base-compat-batteries` changelog](https://github.com/haskell-compat/base-compat/blob/master/base-compat-batteries/CHANGES.markdown#changes-in-0140-20240430)
Expand Down
31 changes: 5 additions & 26 deletions base-compat-batteries/base-compat-batteries.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,7 @@ description: Provides functions available in later versions of @base@ to
for a more comprehensive list of differences between
@base-compat@ and @base-compat-batteries@.
extra-source-files: CHANGES.markdown, README.markdown
tested-with: GHC == 7.0.4
, GHC == 7.2.2
, GHC == 7.4.2
, GHC == 7.6.3
, GHC == 7.8.4
, GHC == 7.10.3
, GHC == 8.0.2
tested-with: GHC == 8.0.2
, GHC == 8.2.2
, GHC == 8.4.4
, GHC == 8.6.5
Expand All @@ -50,7 +44,7 @@ tested-with: GHC == 7.0.4
, GHC == 9.0.2
, GHC == 9.2.8
, GHC == 9.4.8
, GHC == 9.6.5
, GHC == 9.6.6
, GHC == 9.8.2
, GHC == 9.10.1

Expand All @@ -65,22 +59,9 @@ library
default-language:
Haskell2010
build-depends:
base >= 4.3 && < 5,
base >= 4.9 && < 5,
base-compat == 0.14.0,
ghc-prim
if !impl(ghc >= 7.8)
build-depends:
tagged >= 0.8.5 && < 0.9
if !impl(ghc >= 7.10)
build-depends:
nats >= 1.1.2 && < 1.2,
void >= 0.7.2 && < 0.8
if !impl(ghc >= 8.0)
build-depends:
fail >= 4.9.0.0 && < 4.10,
semigroups >= 0.18.4 && < 0.21,
transformers >= 0.2 && < 0.7,
transformers-compat >= 0.6 && < 0.8
if !impl(ghc >= 8.2)
build-depends:
bifunctor-classes-compat >= 0.1 && < 0.2,
Expand All @@ -93,9 +74,7 @@ library
foldable1-classes-compat >= 0.1 && < 0.2,
OneTuple >= 0.4 && < 0.5
ghc-options:
-fno-warn-duplicate-exports
if impl(ghc >= 7.10)
ghc-options: -fno-warn-trustworthy-safe
-Wno-duplicate-exports -Wno-trustworthy-safe

hs-source-dirs:
src
Expand Down Expand Up @@ -268,7 +247,7 @@ test-suite spec
SafeHaskellSpec
TestHspecTrustworthy
build-depends:
base >= 4.3 && < 5
base >= 4.9 && < 5
, base-compat-batteries
, hspec >= 1.8
, QuickCheck
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -Wno-dodgy-exports -Wno-unused-imports #-}
-- | Reexports "Control.Concurrent.Compat"
-- from a globally unique namespace.
module Control.Concurrent.Compat.Repl.Batteries (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -Wno-dodgy-exports -Wno-unused-imports #-}
-- | Reexports "Control.Concurrent.MVar.Compat"
-- from a globally unique namespace.
module Control.Concurrent.MVar.Compat.Repl.Batteries (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -Wno-dodgy-exports -Wno-unused-imports #-}
-- | Reexports "Control.Exception.Compat"
-- from a globally unique namespace.
module Control.Exception.Compat.Repl.Batteries (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -Wno-dodgy-exports -Wno-unused-imports #-}
-- | Reexports "Control.Monad.Compat"
-- from a globally unique namespace.
module Control.Monad.Compat.Repl.Batteries (
Expand Down
6 changes: 1 addition & 5 deletions base-compat-batteries/src/Control/Monad/Fail/Compat.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{-# LANGUAGE CPP, NoImplicitPrelude, PackageImports #-}
{-# LANGUAGE NoImplicitPrelude, PackageImports #-}
module Control.Monad.Fail.Compat (
module Base
) where

#if MIN_VERSION_base(4,9,0)
import "base-compat" Control.Monad.Fail.Compat as Base
#else
import "fail" Control.Monad.Fail as Base
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -Wno-dodgy-exports -Wno-unused-imports #-}
-- | Reexports "Control.Monad.Fail.Compat"
-- from a globally unique namespace.
module Control.Monad.Fail.Compat.Repl.Batteries (
Expand Down
6 changes: 1 addition & 5 deletions base-compat-batteries/src/Control/Monad/IO/Class/Compat.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{-# LANGUAGE CPP, NoImplicitPrelude, PackageImports #-}
{-# LANGUAGE NoImplicitPrelude, PackageImports #-}
module Control.Monad.IO.Class.Compat (
module Base
) where

#if MIN_VERSION_base(4,9,0)
import "base-compat" Control.Monad.IO.Class.Compat as Base
#else
import Control.Monad.IO.Class as Base
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -Wno-dodgy-exports -Wno-unused-imports #-}
-- | Reexports "Control.Monad.IO.Class.Compat"
-- from a globally unique namespace.
module Control.Monad.IO.Class.Compat.Repl.Batteries (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -Wno-dodgy-exports -Wno-unused-imports #-}
-- | Reexports "Control.Monad.ST.Lazy.Unsafe.Compat"
-- from a globally unique namespace.
module Control.Monad.ST.Lazy.Unsafe.Compat.Repl.Batteries (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -Wno-dodgy-exports -Wno-unused-imports #-}
-- | Reexports "Control.Monad.ST.Unsafe.Compat"
-- from a globally unique namespace.
module Control.Monad.ST.Unsafe.Compat.Repl.Batteries (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -Wno-dodgy-exports -Wno-unused-imports #-}
-- | Reexports "Data.Bifoldable.Compat"
-- from a globally unique namespace.
module Data.Bifoldable.Compat.Repl.Batteries (
Expand Down
Loading

0 comments on commit f7ccdb7

Please sign in to comment.