From ba3f203d721e44109fbcc48ba7600e4da121541a Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Sun, 3 Dec 2023 15:15:00 +0200 Subject: [PATCH] Support building with GHC-9.8; allow-newer ShellCheck deps --- .github/workflows/haskell-ci.yml | 21 +++++++++++++++++- .../cabal-install-parsers.cabal | 21 ++++++++++-------- .../src/Cabal/Internal/Newtypes.hs | 3 +++ cabal.project | 10 +++++++++ haskell-ci.cabal | 22 ++++++++++--------- haskell-ci.sh | 13 +++++++++-- src/HaskellCI/Auxiliary.hs | 3 +-- src/HaskellCI/Prelude.hs | 2 +- 8 files changed, 70 insertions(+), 25 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 10ee72ba..8e3b73aa 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -30,6 +30,16 @@ jobs: strategy: matrix: include: + - compiler: ghc-9.8.1 + compilerKind: ghc + compilerVersion: 9.8.1 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.6.3 + compilerKind: ghc + compilerVersion: 9.6.3 + setup-method: ghcup + allow-failure: false - compiler: ghc-9.4.8 compilerKind: ghc compilerVersion: 9.4.8 @@ -216,13 +226,22 @@ jobs: ghc-options: -Werror=missing-methods -Werror=missing-fields EOF cat >> cabal.project <=4.10 && <4.18 + , base >=4.10 && <4.20 , binary ^>=0.8.5 - , bytestring ^>=0.10.8.1 || ^>=0.11.1.0 + , bytestring ^>=0.10.8.1 || ^>=0.11.1.0 || ^>=0.12.0.2 , Cabal-syntax ^>=3.10.1.0 , containers ^>=0.5.7.1 || ^>=0.6.0.1 - , deepseq ^>=1.4.2.0 + , deepseq ^>=1.4.2.0 || ^>=1.5.0.0 , directory ^>=1.3.0.0 , filepath ^>=1.4.1.1 , parsec ^>=3.1.13.0 , pretty ^>=1.1.3.3 - , text ^>=1.2.3.0 || ^>=2.0.1 + , text ^>=1.2.3.0 || ^>=2.0.1 || ^>=2.1 , time ^>=1.8.0.2 || ^>=1.9.3 || ^>=1.11.1.1 || ^>=1.12.2 - , transformers ^>=0.5.2.0 + , transformers ^>=0.5.2.0 || ^>=0.6.1.0 -- extra dependencies build-depends: - , aeson ^>=2.1.0.0 + , aeson ^>=2.1.0.0 || ^>=2.2.0.0 , base16-bytestring ^>=1.0.0.0 , binary-instances ^>=1 , cryptohash-sha256 ^>=0.11.101.0 @@ -107,7 +110,7 @@ test-suite cabal-parsers-index -- dependencies needing explicit constraints build-depends: - , tasty ^>=1.4 + , tasty ^>=1.4 || ^>=1.5 , tasty-hunit ^>=0.10.0.2 test-suite cabal-parsers-golden @@ -129,8 +132,8 @@ test-suite cabal-parsers-golden -- dependencies needing explicit constraints build-depends: - , ansi-terminal >=1.0 && <1.1 - , tasty ^>=1.4 + , ansi-terminal >=1.0 && <1.1 + , tasty ^>=1.4 || ^>=1.5 , tasty-golden ^>=2.3.1.1 , tree-diff >=0.2 && <0.4 diff --git a/cabal-install-parsers/src/Cabal/Internal/Newtypes.hs b/cabal-install-parsers/src/Cabal/Internal/Newtypes.hs index e95830ee..83256c2b 100644 --- a/cabal-install-parsers/src/Cabal/Internal/Newtypes.hs +++ b/cabal-install-parsers/src/Cabal/Internal/Newtypes.hs @@ -5,6 +5,9 @@ {-# LANGUAGE ScopedTypeVariables #-} module Cabal.Internal.Newtypes where +-- hide redundant import warning +import Prelude hiding (Applicative (..)) + import Control.Applicative (Alternative (..), liftA2) import Data.Char (isSpace) import Data.Function (on) diff --git a/cabal.project b/cabal.project index cf6029ae..74abda39 100644 --- a/cabal.project +++ b/cabal.project @@ -6,3 +6,13 @@ tests: True package haskell-ci ghc-options: -Wall ghc-options: -Werror + +-- ShellCheck doesn't allow newer versions of dependencies +allow-newer: ShellCheck-0.9.0:aeson +allow-newer: ShellCheck-0.9.0:bytestring +allow-newer: ShellCheck-0.9.0:deepseq +allow-newer: ShellCheck-0.9.0:Diff +allow-newer: ShellCheck-0.9.0:fgl +allow-newer: ShellCheck-0.9.0:mtl +allow-newer: ShellCheck-0.9.0:text +allow-newer: ShellCheck-0.9.0:transformers diff --git a/haskell-ci.cabal b/haskell-ci.cabal index 45551c77..6b84b5ae 100644 --- a/haskell-ci.cabal +++ b/haskell-ci.cabal @@ -41,6 +41,8 @@ tested-with: || ==9.0.2 || ==9.2.8 || ==9.4.8 + || ==9.6.3 + || ==9.8.1 extra-source-files: CHANGELOG.md extra-source-files: @@ -144,27 +146,27 @@ library haskell-ci-internal ViewPatterns build-depends: - , base >=4.10 && <4.18 + , base >=4.10 && <4.20 , binary ^>=0.8.5.1 - , bytestring ^>=0.10.8.1 || ^>=0.11.1.0 + , bytestring ^>=0.10.8.1 || ^>=0.11.1.0 || ^>=0.12.0.2 , Cabal-syntax ^>=3.10.1.0 , containers ^>=0.5.7.1 || ^>=0.6.0.1 - , deepseq ^>=1.4.2.0 + , deepseq ^>=1.4.2.0 || ^>=1.5.0.0 , directory ^>=1.3.0.0 , filepath ^>=1.4.1.1 - , mtl ^>=2.2.2 + , mtl ^>=2.2.2 || ^>=2.3.1 , parsec ^>=3.1.13.0 , pretty ^>=1.1.3.3 , process ^>=1.4.3.0 || ^>=1.6.1.0 - , text ^>=1.2.3.0 || ^>=2.0.1 - , transformers ^>=0.5.2.0 + , text ^>=1.2.3.0 || ^>=2.0.1 || ^>=2.1 + , transformers ^>=0.5.2.0 || ^>=0.6.1.0 if !impl(ghc >=8.2) build-depends: bifunctors ^>=5.5.4 -- other dependencies build-depends: - , aeson ^>=1.5.6.0 || ^>=2.0.0.0 || ^>=2.1.0.0 + , aeson ^>=2.1.0.0 || ^>=2.2.0.0 , attoparsec ^>=0.14.1 , base-compat ^>=0.13.0 , base16-bytestring ^>=1.0.1.0 @@ -216,7 +218,7 @@ test-suite golden -- dependencies needing explicit constraints build-depends: - , ansi-terminal >=1.0 && <1.1 - , Diff ^>=0.4.0 - , tasty ^>=1.4.1 + , ansi-terminal >=1.0 && <1.1 + , Diff ^>=0.4.0 || ^>=0.5 + , tasty ^>=1.4.1 || ^>=1.5 , tasty-golden ^>=2.3.1.1 diff --git a/haskell-ci.sh b/haskell-ci.sh index 988f690b..ddcb4952 100755 --- a/haskell-ci.sh +++ b/haskell-ci.sh @@ -19,7 +19,7 @@ fi CFG_CABAL_STORE_CACHE="" CFG_CABAL_REPO_CACHE="" -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" +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" CFG_CABAL_UPDATE=false SCRIPT_NAME=$(basename "$0") @@ -482,13 +482,22 @@ package * ghc-options: -Werror=missing-methods EOF cat >> cabal.project < pkgName <$> listToMaybe pkgs) doctestEnabled = any (maybeGHC False (`C.withinRange` cfgDoctestEnabled cfgDoctest)) linuxVersions docspecEnabled = any (maybeGHC False (`C.withinRange` cfgDocspecEnabled cfgDocspec)) linuxVersions diff --git a/src/HaskellCI/Prelude.hs b/src/HaskellCI/Prelude.hs index 590a8c4d..053bd7e5 100644 --- a/src/HaskellCI/Prelude.hs +++ b/src/HaskellCI/Prelude.hs @@ -29,7 +29,7 @@ import Data.Functor.Compat as X ((<&>)) import Data.Functor.Identity as X (Identity (..)) import Data.List as X (foldl', intercalate, isPrefixOf, nub, stripPrefix, tails) import Data.List.NonEmpty as X (NonEmpty (..), groupBy) -import Data.Maybe as X (fromMaybe, isJust, isNothing, mapMaybe) +import Data.Maybe as X (fromMaybe, isJust, isNothing, listToMaybe, mapMaybe) import Data.Proxy as X (Proxy (..)) import Data.Set as X (Set) import Data.String as X (IsString (fromString))