Skip to content

Commit ba3f203

Browse files
committed
Support building with GHC-9.8; allow-newer ShellCheck deps
1 parent f2e14f2 commit ba3f203

File tree

8 files changed

+70
-25
lines changed

8 files changed

+70
-25
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ jobs:
3030
strategy:
3131
matrix:
3232
include:
33+
- compiler: ghc-9.8.1
34+
compilerKind: ghc
35+
compilerVersion: 9.8.1
36+
setup-method: ghcup
37+
allow-failure: false
38+
- compiler: ghc-9.6.3
39+
compilerKind: ghc
40+
compilerVersion: 9.6.3
41+
setup-method: ghcup
42+
allow-failure: false
3343
- compiler: ghc-9.4.8
3444
compilerKind: ghc
3545
compilerVersion: 9.4.8
@@ -216,13 +226,22 @@ jobs:
216226
ghc-options: -Werror=missing-methods -Werror=missing-fields
217227
EOF
218228
cat >> cabal.project <<EOF
229+
allow-newer: ShellCheck-0.9.0:aeson
230+
allow-newer: ShellCheck-0.9.0:bytestring
231+
allow-newer: ShellCheck-0.9.0:deepseq
232+
allow-newer: ShellCheck-0.9.0:Diff
233+
allow-newer: ShellCheck-0.9.0:fgl
234+
allow-newer: ShellCheck-0.9.0:mtl
235+
allow-newer: ShellCheck-0.9.0:text
236+
allow-newer: ShellCheck-0.9.0:transformers
237+
219238
package haskell-ci
220239
ghc-options: -Werror
221240
222241
package cabal-install-parsers
223242
ghc-options: -Werror
224243
225-
keep-going: False
244+
keep-going: False
226245
227246
package bytestring
228247
tests: False

cabal-install-parsers/cabal-install-parsers.cabal

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cabal-version: 2.2
22
name: cabal-install-parsers
33
version: 0.6.1.1
4+
x-revisions: 1
45
synopsis: Utilities to work with cabal-install files
56
description:
67
@cabal-install-parsers@ provides parsers for @cabal-install@ files:
@@ -33,6 +34,8 @@ tested-with:
3334
|| ==9.0.2
3435
|| ==9.2.8
3536
|| ==9.4.8
37+
|| ==9.6.3
38+
|| ==9.8.1
3639

3740
extra-source-files:
3841
Changelog.md
@@ -65,23 +68,23 @@ library
6568

6669
-- GHC-boot libraries
6770
build-depends:
68-
, base >=4.10 && <4.18
71+
, base >=4.10 && <4.20
6972
, binary ^>=0.8.5
70-
, bytestring ^>=0.10.8.1 || ^>=0.11.1.0
73+
, bytestring ^>=0.10.8.1 || ^>=0.11.1.0 || ^>=0.12.0.2
7174
, Cabal-syntax ^>=3.10.1.0
7275
, containers ^>=0.5.7.1 || ^>=0.6.0.1
73-
, deepseq ^>=1.4.2.0
76+
, deepseq ^>=1.4.2.0 || ^>=1.5.0.0
7477
, directory ^>=1.3.0.0
7578
, filepath ^>=1.4.1.1
7679
, parsec ^>=3.1.13.0
7780
, pretty ^>=1.1.3.3
78-
, text ^>=1.2.3.0 || ^>=2.0.1
81+
, text ^>=1.2.3.0 || ^>=2.0.1 || ^>=2.1
7982
, time ^>=1.8.0.2 || ^>=1.9.3 || ^>=1.11.1.1 || ^>=1.12.2
80-
, transformers ^>=0.5.2.0
83+
, transformers ^>=0.5.2.0 || ^>=0.6.1.0
8184

8285
-- extra dependencies
8386
build-depends:
84-
, aeson ^>=2.1.0.0
87+
, aeson ^>=2.1.0.0 || ^>=2.2.0.0
8588
, base16-bytestring ^>=1.0.0.0
8689
, binary-instances ^>=1
8790
, cryptohash-sha256 ^>=0.11.101.0
@@ -107,7 +110,7 @@ test-suite cabal-parsers-index
107110

108111
-- dependencies needing explicit constraints
109112
build-depends:
110-
, tasty ^>=1.4
113+
, tasty ^>=1.4 || ^>=1.5
111114
, tasty-hunit ^>=0.10.0.2
112115

113116
test-suite cabal-parsers-golden
@@ -129,8 +132,8 @@ test-suite cabal-parsers-golden
129132

130133
-- dependencies needing explicit constraints
131134
build-depends:
132-
, ansi-terminal >=1.0 && <1.1
133-
, tasty ^>=1.4
135+
, ansi-terminal >=1.0 && <1.1
136+
, tasty ^>=1.4 || ^>=1.5
134137
, tasty-golden ^>=2.3.1.1
135138
, tree-diff >=0.2 && <0.4
136139

cabal-install-parsers/src/Cabal/Internal/Newtypes.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
{-# LANGUAGE ScopedTypeVariables #-}
66
module Cabal.Internal.Newtypes where
77

8+
-- hide redundant import warning
9+
import Prelude hiding (Applicative (..))
10+
811
import Control.Applicative (Alternative (..), liftA2)
912
import Data.Char (isSpace)
1013
import Data.Function (on)

cabal.project

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,13 @@ tests: True
66
package haskell-ci
77
ghc-options: -Wall
88
ghc-options: -Werror
9+
10+
-- ShellCheck doesn't allow newer versions of dependencies
11+
allow-newer: ShellCheck-0.9.0:aeson
12+
allow-newer: ShellCheck-0.9.0:bytestring
13+
allow-newer: ShellCheck-0.9.0:deepseq
14+
allow-newer: ShellCheck-0.9.0:Diff
15+
allow-newer: ShellCheck-0.9.0:fgl
16+
allow-newer: ShellCheck-0.9.0:mtl
17+
allow-newer: ShellCheck-0.9.0:text
18+
allow-newer: ShellCheck-0.9.0:transformers

haskell-ci.cabal

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ tested-with:
4141
|| ==9.0.2
4242
|| ==9.2.8
4343
|| ==9.4.8
44+
|| ==9.6.3
45+
|| ==9.8.1
4446

4547
extra-source-files: CHANGELOG.md
4648
extra-source-files:
@@ -144,27 +146,27 @@ library haskell-ci-internal
144146
ViewPatterns
145147

146148
build-depends:
147-
, base >=4.10 && <4.18
149+
, base >=4.10 && <4.20
148150
, binary ^>=0.8.5.1
149-
, bytestring ^>=0.10.8.1 || ^>=0.11.1.0
151+
, bytestring ^>=0.10.8.1 || ^>=0.11.1.0 || ^>=0.12.0.2
150152
, Cabal-syntax ^>=3.10.1.0
151153
, containers ^>=0.5.7.1 || ^>=0.6.0.1
152-
, deepseq ^>=1.4.2.0
154+
, deepseq ^>=1.4.2.0 || ^>=1.5.0.0
153155
, directory ^>=1.3.0.0
154156
, filepath ^>=1.4.1.1
155-
, mtl ^>=2.2.2
157+
, mtl ^>=2.2.2 || ^>=2.3.1
156158
, parsec ^>=3.1.13.0
157159
, pretty ^>=1.1.3.3
158160
, process ^>=1.4.3.0 || ^>=1.6.1.0
159-
, text ^>=1.2.3.0 || ^>=2.0.1
160-
, transformers ^>=0.5.2.0
161+
, text ^>=1.2.3.0 || ^>=2.0.1 || ^>=2.1
162+
, transformers ^>=0.5.2.0 || ^>=0.6.1.0
161163

162164
if !impl(ghc >=8.2)
163165
build-depends: bifunctors ^>=5.5.4
164166

165167
-- other dependencies
166168
build-depends:
167-
, aeson ^>=1.5.6.0 || ^>=2.0.0.0 || ^>=2.1.0.0
169+
, aeson ^>=2.1.0.0 || ^>=2.2.0.0
168170
, attoparsec ^>=0.14.1
169171
, base-compat ^>=0.13.0
170172
, base16-bytestring ^>=1.0.1.0
@@ -216,7 +218,7 @@ test-suite golden
216218

217219
-- dependencies needing explicit constraints
218220
build-depends:
219-
, ansi-terminal >=1.0 && <1.1
220-
, Diff ^>=0.4.0
221-
, tasty ^>=1.4.1
221+
, ansi-terminal >=1.0 && <1.1
222+
, Diff ^>=0.4.0 || ^>=0.5
223+
, tasty ^>=1.4.1 || ^>=1.5
222224
, tasty-golden ^>=2.3.1.1

haskell-ci.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fi
1919

2020
CFG_CABAL_STORE_CACHE=""
2121
CFG_CABAL_REPO_CACHE=""
22-
CFG_JOBS="9.4.8 9.2.8 9.0.2 8.10.7 8.8.4 8.6.5 8.4.4 8.2.2"
22+
CFG_JOBS="9.8.1 9.6.3 9.4.8 9.2.8 9.0.2 8.10.7 8.8.4 8.6.5 8.4.4 8.2.2"
2323
CFG_CABAL_UPDATE=false
2424

2525
SCRIPT_NAME=$(basename "$0")
@@ -482,13 +482,22 @@ package *
482482
ghc-options: -Werror=missing-methods
483483
EOF
484484
cat >> cabal.project <<EOF
485+
allow-newer: ShellCheck-0.9.0:aeson
486+
allow-newer: ShellCheck-0.9.0:bytestring
487+
allow-newer: ShellCheck-0.9.0:deepseq
488+
allow-newer: ShellCheck-0.9.0:Diff
489+
allow-newer: ShellCheck-0.9.0:fgl
490+
allow-newer: ShellCheck-0.9.0:mtl
491+
allow-newer: ShellCheck-0.9.0:text
492+
allow-newer: ShellCheck-0.9.0:transformers
493+
485494
package haskell-ci
486495
ghc-options: -Werror
487496
488497
package cabal-install-parsers
489498
ghc-options: -Werror
490499
491-
keep-going: False
500+
keep-going: False
492501
493502
package bytestring
494503
tests: False

src/HaskellCI/Auxiliary.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module HaskellCI.Auxiliary (
1010
) where
1111

1212
import HaskellCI.Prelude
13-
import Prelude (head)
1413

1514
import qualified Data.Set as S
1615
import qualified Distribution.CabalSpecVersion as C
@@ -57,7 +56,7 @@ auxiliary Config {..} prj JobVersions {..} = Auxiliary {..}
5756
where
5857
pkgs = prjPackages prj
5958
uris = prjUriPackages prj
60-
projectName = fromMaybe (pkgName $ Prelude.head pkgs) cfgProjectName
59+
projectName = fromMaybe "ci" (cfgProjectName <|> pkgName <$> listToMaybe pkgs)
6160

6261
doctestEnabled = any (maybeGHC False (`C.withinRange` cfgDoctestEnabled cfgDoctest)) linuxVersions
6362
docspecEnabled = any (maybeGHC False (`C.withinRange` cfgDocspecEnabled cfgDocspec)) linuxVersions

src/HaskellCI/Prelude.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import Data.Functor.Compat as X ((<&>))
2929
import Data.Functor.Identity as X (Identity (..))
3030
import Data.List as X (foldl', intercalate, isPrefixOf, nub, stripPrefix, tails)
3131
import Data.List.NonEmpty as X (NonEmpty (..), groupBy)
32-
import Data.Maybe as X (fromMaybe, isJust, isNothing, mapMaybe)
32+
import Data.Maybe as X (fromMaybe, isJust, isNothing, listToMaybe, mapMaybe)
3333
import Data.Proxy as X (Proxy (..))
3434
import Data.Set as X (Set)
3535
import Data.String as X (IsString (fromString))

0 commit comments

Comments
 (0)