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

Drop support for GHC 7 and ancient versions of directory and time #304

Merged
merged 5 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 4 additions & 5 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 @@ -36,14 +35,14 @@ flag Cabal-syntax

executable example-client
main-is: Main.hs
other-modules: Prelude ExampleClient.Options
other-modules: ExampleClient.Options

build-depends: base >= 4.5 && < 4.20,
build-depends: base >= 4.9 && < 4.20,
bytestring >= 0.9,
directory >= 1.1,
directory >= 1.2,
filepath >= 1.2,
optparse-applicative >= 0.11,
time >= 1.2,
time >= 1.5,
hackage-security >= 0.5,
hackage-security-HTTP,
hackage-security-curl,
Expand Down
27 changes: 0 additions & 27 deletions example-client/src/Prelude.hs

This file was deleted.

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
18 changes: 3 additions & 15 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 All @@ -48,10 +47,6 @@ flag use-network-uri
description: Are we using @network-uri@?
manual: False

flag use-old-time
description: Are we using @old-time@?
manual: False

flag Cabal-syntax
description: Are we using Cabal-syntax?
manual: False
Expand All @@ -65,24 +60,17 @@ executable hackage-repo-tool
Hackage.Security.RepoTool.Layout.Keys
Hackage.Security.RepoTool.Paths
Hackage.Security.RepoTool.Util.IO
Prelude

-- For boot libraries we try to accomodate the versions bundled with
-- the respective GHC release
build-depends: base >= 4.5 && < 4.20,
build-depends: base >= 4.9 && < 4.20,
bytestring >= 0.9 && < 0.13,
directory >= 1.1 && < 1.4,
directory >= 1.2 && < 1.4,
filepath >= 1.3 && < 1.5,
time >= 1.4 && < 1.13
time >= 1.5 && < 1.13
if !os(windows)
build-depends: unix >= 2.5 && < 2.9

if flag(use-old-time)
build-depends: directory < 1.2
, old-time == 1.1.*
else
build-depends: directory >= 1.2

-- For non-boot libraries we try to support single major versions
-- to reduce the risk of semantic differences
build-depends: microlens >= 0.4.11.2 && < 0.5,
Expand Down
14 changes: 0 additions & 14 deletions hackage-repo-tool/src/Hackage/Security/RepoTool/Util/IO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ import System.Posix.Types (EpochTime)
import qualified System.Posix.Files as Posix
#endif

#if MIN_VERSION_directory(1,2,0)
import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds)
#else
import System.Time (ClockTime (TOD))
#endif

-- | Get the modification time of the specified file
--
Expand All @@ -50,13 +46,8 @@ getFileModTime opts repoLoc targetPath =
-- from POSIX seconds, so there shouldn't be loss of precision.
-- NB: Apparently, this has low clock resolution on GHC < 7.8.
-- I don't think we care.
#if MIN_VERSION_directory(1,2,0)
fromInteger . floor . utcTimeToPOSIXSeconds
<$> Directory.getModificationTime (toFilePath fp)
#else
Directory.getModificationTime (toFilePath fp) >>= \(TOD s _) ->
return (fromInteger s)
#endif
where
fp :: Path Absolute
fp = anchorTargetPath' opts repoLoc targetPath
Expand Down Expand Up @@ -123,11 +114,6 @@ data TarGzError = TarGzError FilePath SomeException
deriving (Typeable)

instance Exception TarGzError where
#if MIN_VERSION_base(4,8,0)
displayException (TarGzError path e) = path ++ ": " ++ displayException e

deriving instance Show TarGzError
#else
instance Show TarGzError where
show (TarGzError path e) = path ++ ": " ++ show e
#endif
5 changes: 0 additions & 5 deletions hackage-repo-tool/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ topLevelExceptionHandler e = do
putStrLn $ displayException e
exitFailure

#if !MIN_VERSION_base(4,8,0)
displayException :: Exception e => e -> String
displayException = show
#endif

{-------------------------------------------------------------------------------
Creating keys
-------------------------------------------------------------------------------}
Expand Down
27 changes: 0 additions & 27 deletions hackage-repo-tool/src/Prelude.hs

This file was deleted.

5 changes: 0 additions & 5 deletions hackage-root-tool/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ topLevelExceptionHandler e = do
putStrLn $ displayException e
exitFailure

#if !MIN_VERSION_base(4,8,0)
displayException :: Exception e => e -> String
displayException = show
#endif

{-------------------------------------------------------------------------------
Creating keys
-------------------------------------------------------------------------------}
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.4 && < 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.5 && < 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
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,10 @@ instance Pretty UnexpectedResponse where
instance Pretty InvalidProxy where
pretty (InvalidProxy p) = "Invalid proxy " ++ show p

#if MIN_VERSION_base(4,8,0)
deriving instance Show UnexpectedResponse
deriving instance Show InvalidProxy
instance Exception UnexpectedResponse where displayException = pretty
instance Exception InvalidProxy where displayException = pretty
#else
instance Show UnexpectedResponse where show = pretty
instance Show InvalidProxy where show = pretty
instance Exception UnexpectedResponse
instance Exception InvalidProxy
#endif

{-------------------------------------------------------------------------------
Additional operations
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.5 && < 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.5 && < 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
Loading
Loading