Skip to content

Commit

Permalink
CI: Tweaks
Browse files Browse the repository at this point in the history
* Update ghc versions used.
* Disable huge number of failing test for ghc == 9.4.* on Windows.
  • Loading branch information
erikd committed Nov 7, 2023
1 parent 5d1521b commit d2f40f8
Show file tree
Hide file tree
Showing 59 changed files with 263 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .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.6.3", "9.4.7", "9.2.8", "9.0.2", "8.10.7", "8.8.4", "8.6.5", "8.4.4"]
ghc: ["9.6.3", "9.4.7", "9.2.7", "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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import Test.Cabal.Prelude
-- qualified imports. (Paper Backpack doesn't natively support
-- this but we must!)
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
withPackageDb $ do
withDirectory "p" $ setup_install []
withDirectory "q" $ setup_install []
Expand Down
7 changes: 5 additions & 2 deletions cabal-testsuite/PackageTests/Ambiguity/setup-reexport.test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import Test.Cabal.Prelude
-- Test that we can resolve a module name ambiguity when reexporting
-- by explicitly specifying what package we want.
main = setupAndCabalTest $ do
skipUnlessGhcVersion ">= 7.9"
withPackageDb $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
skipUnlessGhcVersion ">= 7.9"
withPackageDb $ do
withDirectory "p" $ setup_install []
withDirectory "q" $ setup_install []
withDirectory "reexport" $ setup_install []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
skipUnlessGhcVersion ">= 8.1"
withPackageDb $ do
setup_install ["--cabal-file", "Includes2.cabal"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
skipUnlessGhcVersion ">= 8.1"
withPackageDb $ do
setup_install []
Expand Down
3 changes: 3 additions & 0 deletions cabal-testsuite/PackageTests/Backpack/Includes4/setup.test.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
skipUnlessGhcVersion ">= 8.1"
withPackageDb $ do
setup_install []
Expand Down
3 changes: 3 additions & 0 deletions cabal-testsuite/PackageTests/Backpack/Includes5/setup.test.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
skipUnlessGhcVersion ">= 8.1"
setup "configure" []
r <- fails $ setup' "build" []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
skipUnlessGhcVersion ">= 8.1"
skipUnlessGhcVersion ">= 8.1"
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
withPackageDb $ do
withDirectory "p" $ setup_install_with_docs []
withDirectory "q" $ do
Expand Down
5 changes: 4 additions & 1 deletion cabal-testsuite/PackageTests/Backpack/T4754/setup.test.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
skipUnlessGhcVersion ">= 8.1"
skipUnlessGhcVersion ">= 8.1"
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
skipUnless "no profiling libs" =<< hasProfiledLibraries
setup "configure" ["--enable-profiling"]
setup "build" []
5 changes: 4 additions & 1 deletion cabal-testsuite/PackageTests/Backpack/T5634/setup.test.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
skipUnlessGhcVersion ">= 8.1"
skipUnlessGhcVersion ">= 8.1"
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
setup "configure" []
setup "build" []
6 changes: 5 additions & 1 deletion cabal-testsuite/PackageTests/BenchmarkExeV10/setup.test.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import Test.Cabal.Prelude
-- Test if exitcode-stdio-1.0 benchmark builds correctly
main = setupAndCabalTest $ setup_build ["--enable-benchmarks"]
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
setup_build ["--enable-benchmarks"]
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import Test.Cabal.Prelude
-- Test executable depends on internal library.
main = setupAndCabalTest $ setup_build []
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
setup_build []

Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import Test.Cabal.Prelude
main = setupAndCabalTest . withPackageDb $ do
withDirectory "to-install" $ setup_install []
setup_build []
r <- runExe' "lemon" []
assertEqual
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
withPackageDb $ do
withDirectory "to-install" $ setup_install []
setup_build []
r <- runExe' "lemon" []
assertEqual
("executable should have linked with the internal library")
("foo foo myLibFunc internal")
(concatOutput (resultOutput r))
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import Test.Cabal.Prelude
-- Test that internal library is preferred to an installed on
-- with the same name and LATER version
main = setupAndCabalTest . withPackageDb $ do
withDirectory "to-install" $ setup_install []
setup_build []
r <- runExe' "lemon" []
assertEqual
("executable should have linked with the internal library")
("foo foo myLibFunc internal")
(concatOutput (resultOutput r))
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
withPackageDb $ do
withDirectory "to-install" $ setup_install []
setup_build []
r <- runExe' "lemon" []
assertEqual
("executable should have linked with the internal library")
("foo foo myLibFunc internal")
(concatOutput (resultOutput r))
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ import Test.Cabal.Prelude
-- Test "old build-dep behavior", where we should get the
-- same package dependencies on all targets if setup-version
-- is sufficiently old.
main = setupAndCabalTest $ setup_build []
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
setup_build []

Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import Test.Cabal.Prelude
-- This is a control on ../TargetSpecificDeps1/setup.test.hs; it should
-- succeed.
main = setupAndCabalTest $ setup_build []
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
setup_build []
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude
-- Test PATH-munging
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
setup_build []
runExe' "hello-world" []
>>= assertOutputContains "1111"
3 changes: 3 additions & 0 deletions cabal-testsuite/PackageTests/CabalMacros/setup.test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import Test.Cabal.Prelude
import qualified Data.ByteString.Char8 as BS8

main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
env <- getTestEnv
let mode = testRecordMode env

Expand Down
5 changes: 4 additions & 1 deletion cabal-testsuite/PackageTests/CmmSources/setup.test.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import Test.Cabal.Prelude

main = setupTest $ do
skipUnlessGhcVersion ">= 7.8"
skipUnlessGhcVersion ">= 7.8"
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
setup "configure" []
res <- setup' "build" []
assertOutputContains "= Post common block elimination =" res
5 changes: 4 additions & 1 deletion cabal-testsuite/PackageTests/CmmSourcesDyn/setup.test.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import Test.Cabal.Prelude

main = setupTest $ do
skipIf "ghc < 7.8" =<< isGhcVersion "< 7.8"
skipIf "ghc < 7.8" =<< isGhcVersion "< 7.8"
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
setup "configure" []
res <- setup' "build" []
assertOutputContains "= Post common block elimination =" res
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import Test.Cabal.Prelude
-- NB: The --dependency flag is not supported by cabal-install
main = setupTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
withPackageDb $ do
base_id <- getIPID "base"
setup_install ["sublib", "--cid", "sublib-0.1-abc"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude
-- NB: The --dependency flag is not supported by cabal-install
main = setupTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
withPackageDb $ do
base_id <- getIPID "base"
setup_install ["sublib", "--cid", "sublib-0.1-abc"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import Test.Cabal.Prelude
-- a problem for you; the advised workaround is to use Setup directly
-- if you need per-component builds.
main = setupTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
withPackageDb $ do
setup_install ["sublib"]
setup_install ["exe"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import Test.Cabal.Prelude
-- dependency solver doesn't know how to solve for only
-- a single component of a package.
main = setupTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
withPackageDb $ do
setup_install ["test-for-cabal"]
withDirectory "testlib" $ setup_install []
Expand Down
3 changes: 3 additions & 0 deletions cabal-testsuite/PackageTests/CopyComponent/Lib/setup.test.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude
-- Test that per-component copy works, when only building library
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
withPackageDb $ do
setup "configure" []
setup "build" ["lib:p"]
Expand Down
14 changes: 9 additions & 5 deletions cabal-testsuite/PackageTests/CopyHie/setup.test.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import Test.Cabal.Prelude

main = setupAndCabalTest $ withPackageDb $ do
skipUnlessGhcVersion ">= 8.8"
setup_install ["hie-local"]
env <- getTestEnv
shouldExist $ testLibInstallDir env </> "hie-local-0.1.0.0" </> "extra-compilation-artifacts" </> "hie" </> "HieLocal.hie"
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
withPackageDb $ do
skipUnlessGhcVersion ">= 8.8"
setup_install ["hie-local"]
env <- getTestEnv
shouldExist $ testLibInstallDir env </> "hie-local-0.1.0.0" </> "extra-compilation-artifacts" </> "hie" </> "HieLocal.hie"
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import Test.Cabal.CheckArMetadata

-- Test that setup deterministically generates object archives
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
setup_build []
dist_dir <- fmap testDistDir getTestEnv
lbi <- getLocalBuildInfoM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import Test.Cabal.CheckArMetadata

-- Test that setup deterministically generates object archives
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
setup_build ["--disable-response-files"]
dist_dir <- fmap testDistDir getTestEnv
lbi <- getLocalBuildInfoM
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude
-- https://github.com/haskell/cabal/issues/1919
main = setupAndCabalTest $
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
withPackageDb $ do
setup_install []
setup "haddock" []
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import Test.Cabal.Prelude
-- Internal library used by public library; it must be installed and
-- registered.
main = setupAndCabalTest $
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
withPackageDb $ do
withDirectory "foolib" $ setup_install []
withDirectory "fooexe" $ do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import System.Directory
import Data.List
-- Test to see if --gen-pkg-config works.
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
withPackageDb $ do
withDirectory "p" $ do
setup_build []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import Test.Cabal.Prelude
-- Test to see if --gen-script
main = setupAndCabalTest $ do
is_windows <- isWindows
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
withPackageDb $ do
withDirectory "p" $ do
setup_build []
setup "copy" []
setup "register" ["--gen-script"]
_ <- if is_windows
_ <- if isWin
then shell "cmd" ["/C", "register.bat"]
else shell "sh" ["register.sh"]
return ()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude
-- No cabal test because per-component is broken for it
main = setupTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
withPackageDb $ do
withDirectory "p" $ do
setup_install ["q"]
Expand Down
3 changes: 3 additions & 0 deletions cabal-testsuite/PackageTests/InternalLibraries/setup.test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import Test.Cabal.Prelude
-- sure that the internal library correctly is used, not the
-- external library.
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $
withPackageDb $ do
withDirectory "q" $ setup_install []
withDirectory "p" $ do
Expand Down
3 changes: 3 additions & 0 deletions cabal-testsuite/PackageTests/Macros/setup.test.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Test.Cabal.Prelude
-- Test to ensure that setup_macros.h are computed per-component.
main = setupAndCabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 9414 $ do
setup_build []
runExe "macros-a" []
runExe "macros-b" []
Expand Down
Loading

0 comments on commit d2f40f8

Please sign in to comment.