Skip to content

Commit

Permalink
Allow tar-0.6, bump CI to GHC 9.4.8
Browse files Browse the repository at this point in the history
hackage-security: import from tar-0.6 in a way compatible with tar-0.5

This requires importing constructors independent of their data
type (which changed from 0.5 to 0.6), via the `pattern` syntax.

Consequently, we drop GHC 7.6 which does not have `PatternSynonyms`.
  • Loading branch information
andreasabel committed Dec 20, 2023
1 parent 91904de commit 24693ce
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 26 deletions.
22 changes: 10 additions & 12 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.20231012
# version: 0.17.20231112
#
# REGENDATA ("0.17.20231012",["github","cabal.project"])
# REGENDATA ("0.17.20231112",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand Down Expand Up @@ -42,9 +42,9 @@ jobs:
compilerVersion: 9.6.3
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.7
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.4.7
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.8
Expand Down Expand Up @@ -100,20 +100,18 @@ jobs:
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.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
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.7.yaml;
"$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)
"$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.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
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.7.yaml;
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
env:
HCKIND: ${{ matrix.compilerKind }}
Expand All @@ -133,13 +131,13 @@ jobs:
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$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.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.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))')
Expand Down
2 changes: 1 addition & 1 deletion example-client/example-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cabal-version: >=1.10
tested-with:
GHC == 9.8.1
GHC == 9.6.3
GHC == 9.4.7
GHC == 9.4.8
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
Expand Down
6 changes: 3 additions & 3 deletions hackage-repo-tool/hackage-repo-tool.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 1.12
name: hackage-repo-tool
version: 0.1.1.3
x-revision: 4
x-revision: 5

build-type: Simple
synopsis: Manage secure file-based package repositories
Expand All @@ -26,7 +26,7 @@ bug-reports: https://github.com/haskell/hackage-security/issues
tested-with:
GHC == 9.8.1
GHC == 9.6.3
GHC == 9.4.7
GHC == 9.4.8
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
Expand Down Expand Up @@ -87,7 +87,7 @@ executable hackage-repo-tool
-- to reduce the risk of semantic differences
build-depends: microlens >= 0.4.11.2 && < 0.5,
optparse-applicative >= 0.15.1 && < 0.18,
tar >= 0.5 && < 0.6,
tar >= 0.5 && < 0.7,
zlib >= 0.6 && < 0.7,
hackage-security >= 0.6 && < 0.7

Expand Down
2 changes: 1 addition & 1 deletion hackage-root-tool/hackage-root-tool.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cabal-version: >=1.10
tested-with:
GHC == 9.8.1
GHC == 9.6.3
GHC == 9.4.7
GHC == 9.4.8
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
Expand Down
2 changes: 1 addition & 1 deletion hackage-security-HTTP/hackage-security-HTTP.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ build-type: Simple
tested-with:
GHC == 9.8.1
GHC == 9.6.3
GHC == 9.4.7
GHC == 9.4.8
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
Expand Down
2 changes: 1 addition & 1 deletion hackage-security-curl/hackage-security-curl.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cabal-version: >=1.10
tested-with:
GHC == 9.8.1
GHC == 9.6.3
GHC == 9.4.7
GHC == 9.4.8
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cabal-version: >=1.10
tested-with:
GHC == 9.8.1
GHC == 9.6.3
GHC == 9.4.7
GHC == 9.4.8
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
Expand Down
7 changes: 7 additions & 0 deletions hackage-security/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
See also http://pvp.haskell.org/faq

0.6.2.4
-------

* Allow `tar-0.6`
* Drop support for GHC < 7.8 in favor of `PatternSynonyms`
* Tested with GHC 7.10 - 9.8

0.6.2.3
-------

Expand Down
11 changes: 6 additions & 5 deletions hackage-security/hackage-security.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cabal-version: 1.12
name: hackage-security
version: 0.6.2.3
x-revision: 8
version: 0.6.2.4

synopsis: Hackage security library
description: The hackage security library provides both server and
Expand Down Expand Up @@ -34,7 +33,7 @@ build-type: Simple
tested-with:
GHC == 9.8.1
GHC == 9.6.3
GHC == 9.4.7
GHC == 9.4.8
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
Expand Down Expand Up @@ -127,7 +126,8 @@ library
Hackage.Security.Util.TypedEmbedded
MyPrelude
-- We support ghc 7.4 (bundled with Cabal 1.14) and up
build-depends: base >= 4.5 && < 4.20,
build-depends: base >= 4.7 && < 4.20,
-- PatternSynonyms are only available since GHC 7.8 (base 4.7)
base16-bytestring >= 0.1.1 && < 1.1,
base64-bytestring >= 1.0 && < 1.3,
bytestring >= 0.9 && < 0.13,
Expand All @@ -139,7 +139,7 @@ library
cryptohash-sha256 >= 0.11 && < 0.12,
-- 0.4.2 introduces TarIndex, 0.4.4 introduces more
-- functionality, 0.5.0 changes type of serialise
tar >= 0.5 && < 0.6,
tar >= 0.5 && < 0.7,
template-haskell >= 2.7 && < 2.22,
time >= 1.2 && < 1.13,
transformers >= 0.3 && < 0.7,
Expand Down Expand Up @@ -185,6 +185,7 @@ library
NamedFieldPuns
NoImplicitPrelude
NoMonomorphismRestriction
PatternSynonyms
RankNTypes
RecordWildCards
ScopedTypeVariables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Control.Exception
import Control.Monad
import Control.Monad.IO.Class
import Data.Maybe
import Codec.Archive.Tar (Entries(..))
import Codec.Archive.Tar (Entries, pattern Done, pattern Fail, pattern Next)
import Codec.Archive.Tar.Index (TarIndex, IndexBuilder, TarEntryOffset)
import qualified Codec.Archive.Tar as Tar
import qualified Codec.Archive.Tar.Index as TarIndex
Expand Down

0 comments on commit 24693ce

Please sign in to comment.