Skip to content

Commit 1687638

Browse files
committed
Support Cabal-3.14 (GHC 9.12)
1 parent 38ecb66 commit 1687638

File tree

7 files changed

+58
-28
lines changed

7 files changed

+58
-28
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.19.20241223
11+
# version: 0.19.20250506
1212
#
13-
# REGENDATA ("0.19.20241223",["github","hackage-cli.cabal"])
13+
# REGENDATA ("0.19.20250506",["github","hackage-cli.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -23,7 +23,7 @@ on:
2323
jobs:
2424
linux:
2525
name: Haskell-CI - Linux - ${{ matrix.compiler }}
26-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-24.04
2727
timeout-minutes:
2828
60
2929
container:
@@ -32,19 +32,24 @@ jobs:
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.10.1
35+
- compiler: ghc-9.12.2
3636
compilerKind: ghc
37-
compilerVersion: 9.10.1
37+
compilerVersion: 9.12.2
38+
setup-method: ghcup
39+
allow-failure: false
40+
- compiler: ghc-9.10.2
41+
compilerKind: ghc
42+
compilerVersion: 9.10.2
3843
setup-method: ghcup
3944
allow-failure: false
4045
- compiler: ghc-9.8.4
4146
compilerKind: ghc
4247
compilerVersion: 9.8.4
4348
setup-method: ghcup
4449
allow-failure: false
45-
- compiler: ghc-9.6.6
50+
- compiler: ghc-9.6.7
4651
compilerKind: ghc
47-
compilerVersion: 9.6.6
52+
compilerVersion: 9.6.7
4853
setup-method: ghcup
4954
allow-failure: false
5055
- compiler: ghc-9.4.8
@@ -97,12 +102,12 @@ jobs:
97102
- name: Install GHCup
98103
run: |
99104
mkdir -p "$HOME/.ghcup/bin"
100-
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
105+
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
101106
chmod a+x "$HOME/.ghcup/bin/ghcup"
102107
- name: Install cabal-install
103108
run: |
104-
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
105-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
109+
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
110+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
106111
- name: Install GHC (GHCup)
107112
if: matrix.setup-method == 'ghcup'
108113
run: |

cabal.project

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
packages: .
22

3-
-- with-compiler: ghc-8.2.1
4-
5-
-- In order to build hackage-cli w/ an unreleased Cabal-2.x (NB: this builds fine w/ GHC 8.2.1 and its bundled Cabal-2.0):
6-
-- 1. `cabal get -s Cabal`
7-
-- 2. uncomment the 2 lines below (the constraints-line is a hack to avoid `setup`-components picking up the local Cabal package)
8-
9-
-- packages: Cabal/Cabal
10-
-- constraints: setup.Cabal < 2
3+
constraints: HsOpenSSL +use-pkg-config

hackage-cli.cabal

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ build-type: Simple
1818
-- Supported GHC versions when building with cabal:
1919
tested-with:
2020
-- Keep in descending order.
21-
GHC == 9.10.1
21+
GHC == 9.12.2
22+
GHC == 9.10.2
2223
GHC == 9.8.4
23-
GHC == 9.6.6
24+
GHC == 9.6.7
2425
GHC == 9.4.8
2526
GHC == 9.2.8
2627
GHC == 9.0.2
@@ -55,7 +56,7 @@ library cabal-revisions
5556
build-depends:
5657
, base >= 4.10.0.0 && < 5
5758
, bytestring >= 0.10.4.0 && < 0.13
58-
, Cabal >= 3.4 && < 3.13
59+
, Cabal >= 3.4 && < 3.15
5960
, containers >= 0.5.0.0 && < 0.8
6061
, mtl >= 2.2.2 && < 2.3 || >= 2.3.1 && < 2.4
6162
, pretty ^>= 1.1.2
@@ -125,7 +126,7 @@ executable hackage-cli
125126
, microlens-mtl >= 0.1.11.1 && < 0.3
126127
, microlens-th >= 0.4.1.3 && < 0.5
127128
, netrc ^>= 0.2.0.0
128-
, optparse-applicative >= 0.14 && < 0.19
129+
, optparse-applicative >= 0.14 && < 1
129130
, process-extras ^>= 0.7.4
130131
, semigroups >= 0.18.3 && < 0.21
131132
, stringsearch ^>= 0.3.6

src/Main.hs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ import qualified Distribution.Text as C
5252
#if MIN_VERSION_Cabal(3,7,0)
5353
import qualified Distribution.Simple.PackageDescription as C
5454
#endif
55+
#if MIN_VERSION_Cabal(3,14,0)
56+
import Distribution.Utils.Path (makeSymbolicPath)
57+
#endif
5558

5659
import Lens.Micro
5760
import Lens.Micro.Mtl
@@ -652,8 +655,16 @@ mainWithOptions Options{ optHost, optCommand } = do
652655

653656
return ()
654657

655-
(pkgn,pkgv,xrev) <- pkgDescToPkgIdXrev <$> C.readGenericPackageDescription C.deafening optSyCFile
656658
SyncCabal (SyncCOptions{ optSyCFile, optSyCIncrRev, optSyCForce }) -> do
659+
(pkgn,pkgv,xrev) <- pkgDescToPkgIdXrev <$>
660+
C.readGenericPackageDescription
661+
C.deafening
662+
#if MIN_VERSION_Cabal(3,14,0)
663+
Nothing
664+
(makeSymbolicPath optSyCFile)
665+
#else
666+
optSyCFile
667+
#endif
657668
cab0 <- BS.readFile optSyCFile
658669

659670
BS8.putStrLn $ mconcat [ "local : "
@@ -736,7 +747,15 @@ mainWithOptions Options{ optHost, optCommand } = do
736747
putStrLn $ "Using Hackage credentials for username " ++ show username
737748

738749
forM_ optPsCFiles $ \fn -> do
739-
(pkgn, pkgv, xrev0) <- pkgDescToPkgIdXrev <$> C.readGenericPackageDescription C.deafening fn
750+
(pkgn, pkgv, xrev0) <- pkgDescToPkgIdXrev <$>
751+
C.readGenericPackageDescription
752+
C.deafening
753+
#if MIN_VERSION_Cabal(3,14,0)
754+
Nothing
755+
(makeSymbolicPath fn)
756+
#else
757+
fn
758+
#endif
740759
let xrev = applyWhen optPsCIncrRev (+1) xrev0
741760

742761
putStrLn $ concat [ "Pushing ", show fn

stack-9.10.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
resolver: nightly-2025-01-06
2-
compiler: ghc-9.10.1
1+
resolver: nightly-2025-05-28
2+
compiler: ghc-9.10.2
33
compiler-check: match-exact
4+
5+
flags:
6+
HsOpenSSL:
7+
use-pkg-config: true

stack-9.6.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
resolver: lts-22.43
1+
resolver: lts-22.44
2+
3+
flags:
4+
HsOpenSSL:
5+
use-pkg-config: true

stack-9.8.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
resolver: lts-23.3
1+
resolver: lts-23.24
2+
3+
flags:
4+
HsOpenSSL:
5+
use-pkg-config: true

0 commit comments

Comments
 (0)