Skip to content

Support GHC 9.4 #8420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions cabal-install-solver/cabal-install-solver.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion cabal-install/cabal-install.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -60,6 +60,7 @@ common cabal-install-solver-dep
library
import: warnings, base-dep, cabal-dep, cabal-syntax-dep, cabal-install-solver-dep
default-language: Haskell2010
default-extensions: TypeOperators

hs-source-dirs: src
exposed-modules:
Expand Down Expand Up @@ -272,6 +273,7 @@ executable cabal
test-suite unit-tests
import: warnings, base-dep, cabal-dep, cabal-syntax-dep, cabal-install-solver-dep
default-language: Haskell2010
default-extensions: TypeOperators
ghc-options: -rtsopts -threaded

type: exitcode-stdio-1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
skipUnlessGhcVersion ">= 8.1"
ghc <- isGhcVersion "== 9.0.2 || == 9.2.*"
ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.*"
expectBrokenIf ghc 7987 $ do
withPackageDb $ do
withDirectory "mylib" $ setup_install_with_docs ["--ipid", "mylib-0.1.0.0"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Test.Cabal.Prelude
main = setupTest $ do
-- No cabal test because per-component is broken with it
skipUnlessGhcVersion ">= 8.1"
ghc <- isGhcVersion "== 9.0.2 || == 9.2.*"
ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.*"
expectBrokenIf ghc 7987 $
withPackageDb $ do
let setup_install' args = setup_install_with_docs (["--cabal-file", "Includes2.cabal"] ++ args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Data.List
import qualified Data.Char as Char
main = setupAndCabalTest $ do
skipUnlessGhcVersion ">= 8.1"
ghc <- isGhcVersion "== 9.0.2 || == 9.2.*"
ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.*"
expectBrokenIf ghc 7987 $
withPackageDb $ do
containers_id <- getIPID "containers"
Expand Down
16 changes: 9 additions & 7 deletions cabal-testsuite/PackageTests/CCompilerOverride/setup.test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ import Test.Cabal.Prelude
main = setupAndCabalTest $ do
skipUnlessGhcVersion ">= 8.8"
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
env <- getTestEnv
let pwd = testCurrentDir env
customCC = pwd ++ "/custom-cc" ++ if isWin then ".bat" else ""

setup "configure"
[ "--ghc-option=-DNOERROR1"
, "--ghc-option=-optc=-DNOERROR2"
, "--ghc-option=-optP=-DNOERROR3"
, "--with-gcc=" ++ customCC
]
setup "build" ["-v2"]
expectBrokenIf (isWin && ghc94) 8451 $ do
setup "configure"
[ "--ghc-option=-DNOERROR1"
, "--ghc-option=-optc=-DNOERROR2"
, "--ghc-option=-optP=-DNOERROR3"
, "--with-gcc=" ++ customCC
]
setup "build" ["-v2"]
3 changes: 3 additions & 0 deletions cabal-testsuite/PackageTests/CustomPreProcess/cabal.test.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude
-- Test internal custom preprocessor
main = cabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
skipUnless "no Cabal for GHC" =<< hasCabalForGhc

-- old Cabal's ./Setup.hs output is difficult to normalise
Expand Down
3 changes: 3 additions & 0 deletions cabal-testsuite/PackageTests/FFI/ForeignOptsC/cabal.test.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Test.Cabal.Prelude
main = cabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
cabal "v2-build" ["foreign-opts-c-exe"]
withPlan $ runPlanExe "foreign-opts-c" "foreign-opts-c-exe" []
3 changes: 3 additions & 0 deletions cabal-testsuite/PackageTests/FFI/ForeignOptsCxx/cabal.test.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Test.Cabal.Prelude
main = cabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
cabal "v2-build" ["foreign-opts-cxx-exe"]
withPlan $ runPlanExe "foreign-opts-cxx" "foreign-opts-cxx-exe" []
2 changes: 1 addition & 1 deletion cabal-testsuite/PackageTests/ForeignLibs/UseLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/* Forward declarations */
bool myForeignLibInit();
void myForeignLibExit();
void sayHi();
extern void sayHi();

int main()
{
Expand Down
6 changes: 3 additions & 3 deletions cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import Test.Cabal.Prelude
main = setupAndCabalTest . recordMode DoNotRecord $ do
-- Foreign libraries don't work with GHC 7.6 and earlier
skipUnlessGhcVersion ">= 7.8"
osx <- isOSX
ghc80 <- isGhcVersion "== 8.0.2"
expectBrokenIf (osx && ghc80) 7989 $
win <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (win && ghc94) 8451 $
withPackageDb $ do
setup_install []
setup "copy" [] -- regression test #4156
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude

main = cabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
cabal "v2-bench"
[ "--benchmark-option=1"
, "--benchmark-options=\"2 3\""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude

main = cabalTest . void $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
cabal' "v2-build" ["script.hs"]

env <- getTestEnv
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Test.Cabal.Prelude

main = cabalTest . void $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
cabal' "v2-build" ["script.hs"]
cabalWithStdin "v2-repl" ["script.hs"] ""
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Test.Cabal.Prelude

main = cabalTest . void $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
cabal' "v2-build" ["script.hs"]
cabal' "v2-run" ["script.hs"]
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Test.Cabal.Prelude

main = cabalTest . void $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
cabal' "v2-build" ["script.hs"]
cabal' "v2-build" ["script.hs"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import Test.Cabal.Prelude
import System.Directory (copyFile, removeFile)

main = cabalTest . void $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
env <- getTestEnv
let td = testCurrentDir env

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import Test.Cabal.Prelude
import System.Directory (copyFile, removeFile)

main = cabalTest . void $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
env <- getTestEnv
let td = testCurrentDir env

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude

main = cabalTest . void $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
cabal' "v2-build" ["script.hs"]
cabal' "v2-clean" ["script.hs"]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude

main = cabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
res <- cabal' "v2-run" ["script.hs"]
assertOutputContains "Hello World" res

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Test.Cabal.Prelude

main = cabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
res <- cabal' "v2-run" ["script.lhs"]
assertOutputContains "Hello World" res
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Test.Cabal.Prelude

main = cabalTest . void $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
cabal' "v2-run" ["with sp"] >>= assertOutputContains "Hello World"
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Test.Cabal.Prelude

main = cabalTest . void $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
cabal' "v2-run" ["script.hs"]
cabal' "v2-run" ["script.hs"]
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude

main = cabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
-- script is called "s.hs" to avoid Windows long path issue in CI
res <- cabal' "v2-run" ["s.hs"]
assertOutputContains "Hello World" res
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude

main = cabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
cabal "v2-test"
[ "--test-option=1"
, "--test-options=\"2 3\""
Expand Down
10 changes: 6 additions & 4 deletions cabal-testsuite/cabal-testsuite.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -103,6 +103,7 @@ executable cabal-tests
, clock ^>= 0.7.2 || ^>=0.8

build-tool-depends: cabal-testsuite:setup
default-extensions: TypeOperators

-- this executable is needed by lib:cabal-testsuite
executable setup
Expand All @@ -112,7 +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
setup-depends: Cabal == 3.6.*,
Cabal-syntax == 3.6.*,
-- 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