Skip to content

Commit

Permalink
v0.1.0.2: Support Cabal-3.12, bump CI to GHC 9.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel committed Jul 2, 2024
1 parent 15baa0a commit af89487
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 25 deletions.
16 changes: 10 additions & 6 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.19.20240429
# version: 0.19.20240630
#
# REGENDATA ("0.19.20240429",["github","hackage-cli.cabal"])
# REGENDATA ("0.19.20240630",["github","hackage-cli.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -32,6 +32,11 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.8.2
Expand Down Expand Up @@ -91,9 +96,8 @@ jobs:
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.3.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
apt-get update
apt-get install -y libbrotli-dev
env:
Expand All @@ -113,7 +117,7 @@ jobs:
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.3.0 -vnormal+nowrap" >> "$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"
Expand Down Expand Up @@ -198,7 +202,7 @@ jobs:
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(Cabal|binary|hackage-cli)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(Cabal|binary|hackage-cli)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ghc-ver: [9.8, 9.6]
os: [ubuntu-latest,macos-latest,windows-latest]
ghc-ver: ['9.10', '9.8', '9.6']
# Snapshots for 9.4.8, 9.2.8, 9.0.2, 8.10.7 do not have a recent enough base-compat; 0.13 is needed.
# On ubuntu-22.04 the old versions 8.8.4, 8.6.5, 8.4.4, 8.2.2 fail due to HsOpenSSL linking errors.
# They used to work under ubuntu-20.04, but it is not worth the trouble maintaining them.
# Apparently, HsOpenSSL-0.11.6 and older are too old for ubuntu-22.04.
include:
- os: macos-latest
ghc-ver: 9.8
- os: windows-latest
ghc-ver: 9.8
# include:
# - os: macos-latest
# ghc-ver: '9.10'
# - os: windows-latest
# ghc-ver: '9.10'

env:
ARGS: "--stack-yaml=stack-${{ matrix.ghc-ver }}.yaml --no-terminal --system-ghc"
Expand Down
22 changes: 17 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
# Changelog for hackage-cli

## 0.1.0.2

_Andreas Abel, 2024-07-02_

- Allow revision of `stability` field
(`hackage-server` issue [#1182](https://github.com/haskell/hackage-server/issues/1182)).
- Print correct revision in `push-cabal --incr-rev`
(issue [#66](https://github.com/hackage-trustees/hackage-cli/issues/66)).
- Fix for `Cabal-3.12.0.0`.

Builds with `Cabal 3.4 - 3.12` and `GHC 8.2 - 9.10`.

## 0.1.0.1

_Andreas Abel, 2023-02-20_

- Fix for `Cabal-3.9.0.0`
- Fix for `Cabal-3.9.0.0`.

Builds with `Cabal 3.4 - 3.9` and `GHC 8.2 - 9.6`.

## 0.1.0.0

_Andreas Abel, 2023-01-15_

- Skip errors when running `add-bound` on several files.
(PR [#42](https://github.com/hackage-trustees/hackage-cli/pull/42))
- Skip errors when running `add-bound` on several files
(PR [#42](https://github.com/hackage-trustees/hackage-cli/pull/42)).

- If no version range is given for a dependency, interpret it as `-any` rather than _none_ (`<0`).
(PR [#48](https://github.com/hackage-trustees/hackage-cli/pull/48))
- If no version range is given for a dependency, interpret it as `-any` rather than _none_ (`<0`)
(PR [#48](https://github.com/hackage-trustees/hackage-cli/pull/48)).

Builds with `Cabal 3.4 - 3.8` and `GHC 8.2 - 9.4`.

Expand Down
5 changes: 3 additions & 2 deletions hackage-cli.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: hackage-cli
version: 0.1.0.1
version: 0.1.0.2

synopsis: CLI tool for Hackage
description:
Expand All @@ -18,6 +18,7 @@ build-type: Simple
-- Supported GHC versions when building with cabal:
tested-with:
-- Keep in descending order.
GHC == 9.10.1
GHC == 9.8.2
GHC == 9.6.5
GHC == 9.4.8
Expand Down Expand Up @@ -53,7 +54,7 @@ library cabal-revisions
build-depends:
, base >= 4.10.0.0 && < 5
, bytestring >= 0.10.4.0 && < 0.13
, Cabal >= 3.4 && < 3.11
, Cabal >= 3.4 && < 3.13
, containers >= 0.5.0.0 && < 0.8
, mtl >= 2.2.2 && < 2.3 || >= 2.3.1 && < 2.4
, pretty ^>= 1.1.2
Expand Down
13 changes: 10 additions & 3 deletions lib/Distribution/Server/Util/CabalRevisions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
-- Copyright : Duncan Coutts et al.
-- SPDX-License-Identifier: BSD-3-Clause
--
-- Maintainer : [email protected]
-- Maintainer : Andreas Abel
-- Stability : provisional
-- Portability : portable
--
Expand Down Expand Up @@ -178,8 +178,15 @@ checkCabalFileRevision checkXRevision old new = do

checkPackageChecks :: Check GenericPackageDescription
checkPackageChecks pkg pkg' =
let checks = checkPackage pkg Nothing
checks' = checkPackage pkg' Nothing
let checks = checkPackage pkg
-- The API change of checkPackage happened somewhere between 3.10 and 3.12.
#if !MIN_VERSION_Cabal(3,12,0)
Nothing
#endif
checks' = checkPackage pkg'
#if !MIN_VERSION_Cabal(3,12,0)
Nothing
#endif
in case checks' \\ checks of
[] -> return ()
newchecks -> fail $ unlines (map ppPackageCheck newchecks)
Expand Down
23 changes: 23 additions & 0 deletions stack-9.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
resolver: nightly-2024-07-01
compiler: ghc-9.10.1
compiler-check: match-exact

# Libraries shipped with GHC 9.10.1:
extra-deps:
- Cabal-3.12.0.0
- Cabal-syntax-3.12.0.0
- directory-1.3.8.3
- filepath-1.5.2.0
- process-1.6.19.0
- unix-2.8.5.1
# For Windows:
- Win32-2.14.0.0
- time-1.12.2

flags:
directory:
os-string: true
unix:
os-string: true
Win32:
os-string: true
2 changes: 1 addition & 1 deletion stack-9.6.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
resolver: lts-22.21
resolver: lts-22.27
2 changes: 1 addition & 1 deletion stack-9.8.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
resolver: nightly-2024-05-11
resolver: nightly-2024-07-01

0 comments on commit af89487

Please sign in to comment.