From 5f905a93c67a3259156fc0b3f7ce11afed0a2a24 Mon Sep 17 00:00:00 2001
From: Andreas Abel <andreas.abel@ifi.lmu.de>
Date: Fri, 19 Aug 2022 11:01:33 +0200
Subject: [PATCH] enable GHC 9.4, add it to CI

---
 .github/workflows/validate.yml                  |  5 +++--
 cabal-install-solver/cabal-install-solver.cabal |  4 ++--
 cabal-install/cabal-install.cabal               |  2 +-
 cabal-testsuite/cabal-testsuite.cabal           | 15 ++++++---------
 4 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml
index 849722480f..2a79790a7b 100644
--- a/.github/workflows/validate.yml
+++ b/.github/workflows/validate.yml
@@ -38,7 +38,7 @@ jobs:
     strategy:
       matrix:
         os: ["ubuntu-latest", "macos-latest", "windows-latest"]
-        ghc: ["9.2.3", "9.0.2", "8.10.7", "8.8.4", "8.6.5", "8.4.4"]
+        ghc: ["9.4.2", "9.2.3", "9.0.2", "8.10.7", "8.8.4", "8.6.5", "8.4.4"]
         exclude:
           # corrupts GHA cache or the fabric of reality itself, see https://github.com/haskell/cabal/issues/8356
           - os: "windows-latest"
@@ -61,7 +61,7 @@ jobs:
         id: setup-haskell
         with:
           ghc-version: ${{ matrix.ghc }}
-          cabal-version: latest # default, keeping for visibility
+          cabal-version: '3.8.1.0'
 
       #  See the following link for a breakdown of the following step
       #  https://github.com/haskell/actions/issues/7#issuecomment-745697160
@@ -212,6 +212,7 @@ jobs:
         id: setup-haskell
         with:
           ghc-version: ${{ matrix.ghc }}
+          cabal-version: '3.8.1.0'
 
       # As we are reusing the cached build dir from the previous step
       # the generated artifacts are available here,
diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal
index 47970ccd0a..69f7042a32 100644
--- a/cabal-install-solver/cabal-install-solver.cabal
+++ b/cabal-install-solver/cabal-install-solver.cabal
@@ -105,7 +105,7 @@ library
 
   build-depends:
     , array         >=0.4      && <0.6
-    , base          >=4.10     && <4.17
+    , base          >=4.10     && <4.18
     , bytestring    >=0.10.6.0 && <0.12
     , Cabal         ^>=3.9
     , Cabal-syntax  ^>=3.9
@@ -138,7 +138,7 @@ Test-Suite unit-tests
      UnitTests.Distribution.Solver.Modular.MessageUtils
 
    build-depends:
-     , base        >= 4.10  && <4.17
+     , base        >= 4.10  && <4.18
      , Cabal
      , Cabal-syntax
      , cabal-install-solver
diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal
index 1f00efde12..981f42e88b 100644
--- a/cabal-install/cabal-install.cabal
+++ b/cabal-install/cabal-install.cabal
@@ -46,7 +46,7 @@ common warnings
       ghc-options: -Wunused-packages
 
 common base-dep
-    build-depends: base >=4.10 && <4.17
+    build-depends: base >=4.10 && <4.18
 
 common cabal-dep
     build-depends: Cabal ^>=3.9
diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal
index 6df8128320..35555d76b3 100644
--- a/cabal-testsuite/cabal-testsuite.cabal
+++ b/cabal-testsuite/cabal-testsuite.cabal
@@ -26,7 +26,7 @@ common shared
   default-language: Haskell2010
 
   build-depends:
-    , base >= 4.6 && <4.17
+    , base >= 4.6 && <4.18
     -- this needs to match the in-tree lib:Cabal version
     , Cabal ^>= 3.9.0.0
     , Cabal-syntax ^>= 3.9.0.0
@@ -113,11 +113,8 @@ executable setup
 custom-setup
   -- we only depend on even stable releases of lib:Cabal
   -- and due to Custom complexity and ConstraintSetupCabalMaxVersion
-  -- it can't be the current version
-  if impl(ghc < 8)
-    setup-depends: Cabal == 3.6.*,
-                   Cabal-syntax == 3.6.*,
-  else
-    setup-depends: Cabal == 3.8.*,
-                   Cabal-syntax == 3.8.*,
-  setup-depends: base, filepath, directory
+  -- it has to be the latest release version plus
+  -- you have to use the latest cabal-install release
+  setup-depends: Cabal == 3.8.*,
+                 Cabal-syntax == 3.8.*,
+                 base, filepath, directory
-- 
GitLab