Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Drop build and CI support for GHC < 8.0 #7534

Closed
wants to merge 11 commits into from
184 changes: 0 additions & 184 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,187 +328,3 @@ jobs:
run: sh validate.sh -j 2 -w ghc-8.0.2 -v --lib-only -s lib-tests
- name: Validate lib-suite
run: sh validate.sh -j 2 -w ghc-8.0.2 -v --lib-only -s lib-suite
validate-7_10_3:
name: validate.sh ghc-7.10.3
runs-on: ubuntu-18.04
needs: validate-8_8_4
container:
image: phadej/ghc:7.10.3-bionic
steps:
- name: System info
run: |
uname -a
- name: Set PATH
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: Install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c -
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
- name: Update Hackage index
run: cabal v2-update
# https://github.com/actions/checkout/issues/170
# - uses: actions/checkout@v2
- name: Checkout
run: |
echo $GITHUB_REF $GITHUB_SHA
git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git .
git fetch origin $GITHUB_SHA:temporary-ci-branch
git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA)
- name: Validate print-config
run: sh validate.sh -j 2 -w ghc-7.10.3 -v --lib-only -s print-config
- name: Validate print-tool-versions
run: sh validate.sh -j 2 -w ghc-7.10.3 -v --lib-only -s print-tool-versions
- name: Validate build
run: sh validate.sh -j 2 -w ghc-7.10.3 -v --lib-only -s build
- name: Validate lib-tests
run: sh validate.sh -j 2 -w ghc-7.10.3 -v --lib-only -s lib-tests
- name: Validate lib-suite
run: sh validate.sh -j 2 -w ghc-7.10.3 -v --lib-only -s lib-suite
validate-7_8_4:
name: validate.sh ghc-7.8.4
runs-on: ubuntu-18.04
needs: validate-8_8_4
container:
image: phadej/ghc:7.8.4-bionic
steps:
- name: System info
run: |
uname -a
- name: Set PATH
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: Install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c -
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
- name: Update Hackage index
run: cabal v2-update
# https://github.com/actions/checkout/issues/170
# - uses: actions/checkout@v2
- name: Checkout
run: |
echo $GITHUB_REF $GITHUB_SHA
git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git .
git fetch origin $GITHUB_SHA:temporary-ci-branch
git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA)
- name: Validate print-config
run: sh validate.sh -j 2 -w ghc-7.8.4 -v --lib-only -s print-config
- name: Validate print-tool-versions
run: sh validate.sh -j 2 -w ghc-7.8.4 -v --lib-only -s print-tool-versions
- name: Validate build
run: sh validate.sh -j 2 -w ghc-7.8.4 -v --lib-only -s build
- name: Validate lib-tests
run: sh validate.sh -j 2 -w ghc-7.8.4 -v --lib-only -s lib-tests
- name: Validate lib-suite
run: sh validate.sh -j 2 -w ghc-7.8.4 -v --lib-only -s lib-suite
validate-7_6_3:
name: validate.sh ghc-7.6.3
runs-on: ubuntu-18.04
needs: validate-8_8_4
container:
image: phadej/ghc:7.6.3-xenial
steps:
- name: System info
run: |
uname -a
- name: Set PATH
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: Install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c -
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
- name: apt-get update
run: apt-get update
- name: Install dynamic libraries
run: apt-get install -y ghc-7.6.3-dyn
- name: Update Hackage index
run: cabal v2-update
# https://github.com/actions/checkout/issues/170
# - uses: actions/checkout@v2
- name: Checkout
run: |
echo $GITHUB_REF $GITHUB_SHA
git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git .
git fetch origin $GITHUB_SHA:temporary-ci-branch
git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA)
- name: Validate print-config
run: sh validate.sh -j 2 -w ghc-7.6.3 -v --lib-only -s print-config
- name: Validate print-tool-versions
run: sh validate.sh -j 2 -w ghc-7.6.3 -v --lib-only -s print-tool-versions
- name: Validate build
run: sh validate.sh -j 2 -w ghc-7.6.3 -v --lib-only -s build
- name: Validate lib-tests
run: sh validate.sh -j 2 -w ghc-7.6.3 -v --lib-only -s lib-tests
- name: Validate lib-suite
run: sh validate.sh -j 2 -w ghc-7.6.3 -v --lib-only -s lib-suite
validate-8_8_4-old:
name: validate.sh old GHCs
runs-on: ubuntu-18.04
needs: validate-8_8_4
container:
image: phadej/ghc:8.8.4-xenial
steps:
- name: System info
run: |
uname -a
- name: Set PATH
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: Install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c -
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
- name: apt-get update
run: apt-get update
- name: Install dynamic libraries
run: apt-get install -y ghc-8.8.4-dyn
- name: Install extra compilers
run: apt-get install -y ghc-7.0.4-dyn ghc-7.2.2-dyn ghc-7.4.2-dyn
- name: Update Hackage index
run: cabal v2-update
# https://github.com/actions/checkout/issues/170
# - uses: actions/checkout@v2
- name: Checkout
run: |
echo $GITHUB_REF $GITHUB_SHA
git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git .
git fetch origin $GITHUB_SHA:temporary-ci-branch
git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA)
- name: Validate print-config
run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s print-config
- name: Validate print-tool-versions
run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s print-tool-versions
- name: Validate build
run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s build
- name: Validate lib-tests
run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s lib-tests
- name: Validate lib-suite
run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s lib-suite
- name: Validate lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.0.4
run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.0.4
- name: Validate lib-suite-extras --extra-hc /opt/ghc/7.2.2/bin/ghc-7.2.2
run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s lib-suite-extras --extra-hc /opt/ghc/7.2.2/bin/ghc-7.2.2
- name: Validate lib-suite-extras --extra-hc /opt/ghc/7.4.2/bin/ghc-7.4.2
run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s lib-suite-extras --extra-hc /opt/ghc/7.4.2/bin/ghc-7.4.2
75 changes: 29 additions & 46 deletions Cabal/Cabal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -22,60 +22,49 @@ build-type: Simple
-- we can bootstrap.

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

source-repository head
type: git
location: https://github.com/haskell/cabal/
subdir: Cabal

flag bundled-binary-generic
default: False

library
default-language: Haskell2010
hs-source-dirs: src

build-depends:
array >= 0.4.0.1 && < 0.6,
base >= 4.6 && < 5,
bytestring >= 0.10.0.0 && < 0.12,
containers >= 0.5.0.0 && < 0.7,
deepseq >= 1.3.0.1 && < 1.5,
directory >= 1.2 && < 1.4,
filepath >= 1.3.0.1 && < 1.5,
pretty >= 1.1.1 && < 1.2,
process >= 1.1.0.2 && < 1.7,
time >= 1.4.0.1 && < 1.12
array >= 0.5.2 && < 0.6,
base >= 4.9 && < 5,
binary >= 0.7.2.2 && < 0.9,
bytestring >= 0.11.1.0 && < 0.12,
containers >= 0.6.5.1 && < 0.7,
deepseq >= 1.4.3.0 && < 1.5,
directory >= 1.3.6 && < 1.4,
filepath >= 1.4.2.1 && < 1.5,
pretty >= 1.1.3 && < 1.2,
process >= 1.6.11 && < 1.7,
time >= 1.9 && < 1.13,
void >= 0.7.3 && < 0.8

if flag(bundled-binary-generic)
build-depends: binary >= 0.5.1.1 && < 0.7
else
build-depends: binary >= 0.7 && < 0.9

if os(windows)
build-depends: Win32 >= 2.3.0.0 && < 2.13
else
build-depends: unix >= 2.6.0.0 && < 2.8

ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates
if impl(ghc >= 8.0)
ghc-options: -Wcompat -Wnoncanonical-monad-instances

if impl(ghc <8.8)
ghc-options: -Wnoncanonical-monadfail-instances

if !impl(ghc >= 8.0)
-- at least one of lib:Cabal's dependency (i.e. `parsec`)
-- already depends on `fail` and `semigroups` transitively
build-depends: fail == 4.9.*, semigroups >= 0.18.3 && < 0.20
ghc-options:
-Wall
-fno-ignore-asserts
-fwarn-tabs
-fwarn-incomplete-uni-patterns
-fwarn-incomplete-record-updates
-Wcompat
-Wnoncanonical-monad-instances

if !impl(ghc >= 7.10)
build-depends: void >= 0.7.3 && < 0.8

if !impl(ghc >= 7.8)
-- semigroups depends on tagged.
build-depends: tagged >=0.8.6 && <0.9
if impl(ghc <8.8)
ghc-options: -Wnoncanonical-monadfail-instances

exposed-modules:
Distribution.Backpack
Expand Down Expand Up @@ -267,10 +256,11 @@ library
build-depends:
-- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity
-- See also https://github.com/ekmett/transformers-compat/issues/35
transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.6),
mtl >= 2.1 && < 2.3,
transformers >= 0.5 && < 0.7,
mtl >= 2.2 && < 2.3,
text >= 1.2.3.0 && < 1.3,
parsec >= 3.1.13.0 && < 3.2
parsec >= 3.1.14.0 && < 3.2

exposed-modules:
Distribution.Compat.Parsing
Distribution.Compat.CharParsing
Expand Down Expand Up @@ -341,11 +331,6 @@ library
Distribution.ZinzaPrelude
Paths_Cabal

if flag(bundled-binary-generic)
other-modules:
Distribution.Compat.Binary.Class
Distribution.Compat.Binary.Generic

emilypi marked this conversation as resolved.
Show resolved Hide resolved
other-extensions:
BangPatterns
CPP
Expand All @@ -372,6 +357,4 @@ library
TypeOperators
TypeSynonymInstances
UndecidableInstances

if impl(ghc >= 7.11)
other-extensions: PatternSynonyms
PatternSynonyms
42 changes: 0 additions & 42 deletions Cabal/src/Distribution/Compat/Binary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,62 +10,20 @@
module Distribution.Compat.Binary
( decodeOrFailIO
, decodeFileOrFail'
#if __GLASGOW_HASKELL__ >= 708 || MIN_VERSION_binary(0,7,0)
, module Data.Binary
#else
, Binary(..)
, decode, encode, encodeFile
#endif
) where

import Control.Exception (ErrorCall (..), catch, evaluate)
import Data.ByteString.Lazy (ByteString)

#if __GLASGOW_HASKELL__ >= 708 || MIN_VERSION_binary(0,7,0)

import Data.Binary

-- | Lazily reconstruct a value previously written to a file.
decodeFileOrFail' :: Binary a => FilePath -> IO (Either String a)
decodeFileOrFail' f = either (Left . snd) Right `fmap` decodeFileOrFail f

#else

import Data.Binary.Get
import Data.Binary.Put
import qualified Data.ByteString.Lazy as BSL

import Distribution.Compat.Binary.Class
import Distribution.Compat.Binary.Generic ()

-- | Decode a value from a lazy ByteString, reconstructing the
-- original structure.
--
decode :: Binary a => ByteString -> a
decode = runGet get

-- | Encode a value using binary serialisation to a lazy ByteString.
--
encode :: Binary a => a -> ByteString
encode = runPut . put
{-# INLINE encode #-}

-- | Lazily reconstruct a value previously written to a file.
decodeFileOrFail' :: Binary a => FilePath -> IO (Either String a)
decodeFileOrFail' f = decodeOrFailIO =<< BSL.readFile f

-- | Lazily serialise a value to a file
encodeFile :: Binary a => FilePath -> a -> IO ()
encodeFile f = BSL.writeFile f . encode

#endif

decodeOrFailIO :: Binary a => ByteString -> IO (Either String a)
decodeOrFailIO bs =
catch (evaluate (decode bs) >>= return . Right) handler
where
#if MIN_VERSION_base(4,9,0)
handler (ErrorCallWithLocation str _) = return $ Left str
#else
handler (ErrorCall str) = return $ Left str
#endif
Loading