Skip to content

Commit

Permalink
Drop support for GHC 7, require base >= 4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel committed Jan 9, 2024
1 parent 51cdec3 commit 1a9764c
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 95 deletions.
52 changes: 14 additions & 38 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/andreasabel/haskell-ci
#
# version: 0.17.20231112
# version: 0.17.20240106
#
# REGENDATA ("0.17.20231112",["github","cabal.project"])
# REGENDATA ("0.17.20240106",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand Down Expand Up @@ -87,32 +87,17 @@ jobs:
compilerVersion: 8.0.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-7.10.3
compilerKind: ghc
compilerVersion: 7.10.3
setup-method: hvr-ppa
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 libnuma-dev
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" 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" 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 @@ -124,22 +109,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
3 changes: 1 addition & 2 deletions example-client/example-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ tested-with:
GHC == 8.4.4
GHC == 8.2.2
GHC == 8.0.2
GHC == 7.10.3

flag use-network-uri
description: Are we using network-uri?
Expand All @@ -38,7 +37,7 @@ executable example-client
main-is: Main.hs
other-modules: ExampleClient.Options

build-depends: base >= 4.8 && < 4.20,
build-depends: base >= 4.9 && < 4.20,
bytestring >= 0.9,
directory >= 1.2,
filepath >= 1.2,
Expand Down
4 changes: 4 additions & 0 deletions hackage-repo-tool/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Unreleased
----------
* Drop support for GHC 7.

0.1.1.3
-------
* Compat release for `Cabal-syntax-3.8.1.0`
Expand Down
3 changes: 1 addition & 2 deletions hackage-repo-tool/hackage-repo-tool.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ tested-with:
GHC == 8.4.4
GHC == 8.2.2
GHC == 8.0.2
GHC == 7.10.3

extra-source-files:
ChangeLog.md README.md
Expand Down Expand Up @@ -64,7 +63,7 @@ executable hackage-repo-tool

-- For boot libraries we try to accomodate the versions bundled with
-- the respective GHC release
build-depends: base >= 4.8 && < 4.20,
build-depends: base >= 4.9 && < 4.20,
bytestring >= 0.9 && < 0.13,
directory >= 1.2 && < 1.4,
filepath >= 1.3 && < 1.5,
Expand Down
3 changes: 1 addition & 2 deletions hackage-root-tool/hackage-root-tool.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ tested-with:
GHC == 8.4.4
GHC == 8.2.2
GHC == 8.0.2
GHC == 7.10.3

extra-source-files:
ChangeLog.md
Expand All @@ -39,7 +38,7 @@ source-repository head

executable hackage-root-tool
main-is: Main.hs
build-depends: base >= 4.8 && < 5,
build-depends: base >= 4.9 && < 5,
filepath >= 1.2 && < 1.5,
optparse-applicative >= 0.11 && < 0.18,
hackage-security >= 0.5 && < 0.7
Expand Down
5 changes: 5 additions & 0 deletions hackage-security-HTTP/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Unreleased
----------
* Drop support for GHC 7.


0.1.1.1
-------
* Add support for hackage-security-0.6
Expand Down
3 changes: 1 addition & 2 deletions hackage-security-HTTP/hackage-security-HTTP.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ tested-with:
GHC == 8.4.4
GHC == 8.2.2
GHC == 8.0.2
GHC == 7.10.3

extra-source-files:
ChangeLog.md
Expand All @@ -44,7 +43,7 @@ flag use-network-uri

library
exposed-modules: Hackage.Security.Client.Repository.HttpLib.HTTP
build-depends: base >= 4.8 && < 4.20,
build-depends: base >= 4.9 && < 4.20,
bytestring >= 0.9 && < 0.13,
HTTP >= 4000.2.19 && < 4000.5,
mtl >= 2.1 && < 2.4,
Expand Down
3 changes: 1 addition & 2 deletions hackage-security-curl/hackage-security-curl.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ tested-with:
GHC == 8.4.4
GHC == 8.2.2
GHC == 8.0.2
GHC == 7.10.3

flag use-network-uri
description: Are we using network-uri?
manual: False

library
exposed-modules: Hackage.Security.Client.Repository.HttpLib.Curl
build-depends: base >= 4.8 && < 4.20,
build-depends: base >= 4.9 && < 4.20,
bytestring >= 0.9,
process >= 1.1,
hackage-security
Expand Down
4 changes: 4 additions & 0 deletions hackage-security-http-client/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Unreleased
----------
* Drop support for GHC 7.

0.1.1
-----
* Implement updated HttpLib API from hackage-security 0.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ tested-with:
GHC == 8.4.4
GHC == 8.2.2
GHC == 8.0.2
GHC == 7.10.3

flag use-network-uri
description: Are we using network-uri?
manual: False

library
exposed-modules: Hackage.Security.Client.Repository.HttpLib.HttpClient
build-depends: base >= 4.8 && < 4.20,
build-depends: base >= 4.9 && < 4.20,
bytestring >= 0.9,
http-client >= 0.4 && < 0.8,
http-types >= 0.8,
Expand Down
6 changes: 6 additions & 0 deletions hackage-security/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
See also http://pvp.haskell.org/faq

Unreleased
----------

* Drop support for GHC 7.
* Drop flag `use-old-time` and support for `old-time`, require `time ≥ 1.5`.

0.6.2.4
-------

Expand Down
11 changes: 2 additions & 9 deletions hackage-security/hackage-security.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ tested-with:
GHC == 8.4.4
GHC == 8.2.2
GHC == 8.0.2
GHC == 7.10.3

extra-source-files:
ChangeLog.md
Expand Down Expand Up @@ -111,8 +110,7 @@ library
Hackage.Security.Util.Stack
Hackage.Security.Util.TypedEmbedded

build-depends: base >= 4.8 && < 4.20,
-- PatternSynonyms are only available since GHC 7.8 (base 4.7)
build-depends: base >= 4.9 && < 4.20,
base16-bytestring >= 0.1.1 && < 1.1,
base64-bytestring >= 1.0 && < 1.3,
bytestring >= 0.9 && < 0.13,
Expand Down Expand Up @@ -174,18 +172,13 @@ library
AllowAmbiguousTypes
BangPatterns
CPP
DeriveLift
OverlappingInstances
PackageImports
RoleAnnotations
StaticPointers
UndecidableInstances

-- use the new stage1/cross-compile-friendly DeriveLift extension for GHC 8.0+
if impl(ghc >= 8.0)
other-extensions: DeriveLift
else
other-extensions: TemplateHaskell

ghc-options: -Wall

-- The URI type got split out off the network package after version 2.5, and
Expand Down
7 changes: 0 additions & 7 deletions hackage-security/src/Hackage/Security/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,7 @@ cachedVersion CachedInfo{..} remoteFile =

-- | Get all cached info (if any)
getCachedInfo ::
#if __GLASGOW_HASKELL__ < 800
(Applicative m, MonadIO m)
#else
MonadIO m
#endif
=> Repository down -> m CachedInfo
getCachedInfo rep = do
(cachedRoot, cachedKeyEnv) <- readLocalRoot rep
Expand All @@ -359,9 +355,6 @@ readLocalRoot rep = do
return (trustLocalFile signedRoot, rootKeys (signed signedRoot))

readLocalFile :: ( FromJSON ReadJSON_Keys_Layout (Signed a), MonadIO m
#if __GLASGOW_HASKELL__ < 800
, Applicative m
#endif
)
=> Repository down -> KeyEnv -> CachedFile -> m (Maybe (Trusted a))
readLocalFile rep cachedKeyEnv file = do
Expand Down
24 changes: 1 addition & 23 deletions hackage-security/src/Hackage/Security/TUF/Patterns.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
-- NOTE: This module was developed to prepare for proper delegation (#39).
-- It is currently unused.
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 800
{-# LANGUAGE DeriveLift #-}
{-# LANGUAGE StandaloneDeriving #-}
#else
{-# LANGUAGE TemplateHaskell #-}
#endif

module Hackage.Security.TUF.Patterns (
-- * Patterns and replacements
FileName
Expand Down Expand Up @@ -274,28 +271,9 @@ qqd pat repl =
Left err -> fail $ "Invalid delegation: " ++ err
Right del -> TH.lift del

#if __GLASGOW_HASKELL__ >= 800
deriving instance TH.Lift (Pattern a)
deriving instance TH.Lift (Replacement a)
deriving instance TH.Lift Delegation
#else
instance TH.Lift (Pattern a) where
lift (PatFileConst fn) = [| PatFileConst fn |]
lift (PatFileExt e) = [| PatFileExt e |]
lift PatFileAny = [| PatFileAny |]
lift (PatDirConst d p) = [| PatDirConst d p |]
lift (PatDirAny p) = [| PatDirAny p |]

instance TH.Lift (Replacement a) where
lift (RepFileConst fn) = [| RepFileConst fn |]
lift (RepFileExt e ) = [| RepFileExt e |]
lift RepFileAny = [| RepFileAny |]
lift (RepDirConst d r) = [| RepDirConst d r |]
lift (RepDirAny r) = [| RepDirAny r |]

instance TH.Lift Delegation where
lift (Delegation pat repl) = [| Delegation pat repl |]
#endif

{-------------------------------------------------------------------------------
JSON
Expand Down
4 changes: 1 addition & 3 deletions hackage-security/src/Hackage/Security/Util/Checked.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
{-# LANGUAGE IncoherentInstances #-}
{-# LANGUAGE RoleAnnotations #-}

{-# OPTIONS_GHC -fno-warn-unused-binds #-}
#if __GLASGOW_HASKELL__ >= 800
{-# OPTIONS_GHC -Wno-unused-binds #-}
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
#endif

-- | Checked exceptions
module Hackage.Security.Util.Checked (
Expand Down
5 changes: 2 additions & 3 deletions precompute-fileinfo/precompute-fileinfo.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ cabal-version: >=1.10

tested-with:
GHC==9.6.3, GHC==9.4.5, GHC==9.2.8, GHC==9.0.2,
GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2,
GHC==7.10.3
GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2

executable precompute-fileinfo
main-is: Main.hs
build-depends: base >= 4.8,
build-depends: base >= 4.9,
bytestring >= 0.9,
containers >= 0.4,
deepseq >= 1.3,
Expand Down

0 comments on commit 1a9764c

Please sign in to comment.