From a562b57da5d4e14823efcfa66ffa3af11def5d2b Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Fri, 14 Jun 2024 13:56:21 +0200 Subject: [PATCH] Use `--io-manager=native` in `lib-suite` on Windows --- cabal-testsuite/cabal-testsuite.cabal | 2 +- validate.sh | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index 1a6ed1996..1c27e40c2 100644 --- a/cabal-testsuite/cabal-testsuite.cabal +++ b/cabal-testsuite/cabal-testsuite.cabal @@ -91,7 +91,7 @@ executable cabal-tests import: shared main-is: cabal-tests.hs hs-source-dirs: main - ghc-options: -threaded + ghc-options: -threaded -rtsopts -- Make sure these are built before the executable is run build-tool-depends: cabal-testsuite:test-runtime-deps build-depends: diff --git a/validate.sh b/validate.sh index 3b56a945c..40ad0576b 100755 --- a/validate.sh +++ b/validate.sh @@ -324,6 +324,13 @@ CABAL_TESTSUITE_BDIR="$(pwd)/$BUILDDIR/build/$ARCH/$BASEHC/cabal-testsuite-3" CABALNEWBUILD="${CABAL} build $JOBS -w $HC --builddir=$BUILDDIR --project-file=$PROJECTFILE" CABALLISTBIN="${CABAL} list-bin --builddir=$BUILDDIR --project-file=$PROJECTFILE" +# This was needed in some local Windows MSYS2 environments +# but breaks CI for Windows + GHC 9.0.2, thus it is set only on non-CI executions +# of validate.sh +# https://github.com/haskell/cabal/issues/9571 +# https://github.com/haskell/cabal/pull/10114 +RTSOPTS="$([[ $ARCH = "x86_64-windows" && -z "$CI" ]] && echo "+RTS --io-manager=native" || echo "")" + # header ####################################################################### @@ -344,6 +351,7 @@ doctest: $DOCTEST benchmarks: $BENCHMARKS verbose: $VERBOSE extra compilers: $EXTRAHCS +extra RTS options: $RTSOPTS EOF } @@ -426,7 +434,7 @@ fi step_lib_suite() { print_header "Cabal: cabal-testsuite" -CMD="$($CABALLISTBIN cabal-testsuite:exe:cabal-tests) --builddir=$CABAL_TESTSUITE_BDIR $TESTSUITEJOBS --with-ghc=$HC --hide-successes" +CMD="$($CABALLISTBIN cabal-testsuite:exe:cabal-tests) --builddir=$CABAL_TESTSUITE_BDIR $TESTSUITEJOBS --with-ghc=$HC --hide-successes $RTSOPTS" (cd cabal-testsuite && timed $CMD) || exit 1 } @@ -468,7 +476,7 @@ CMD="$($CABALLISTBIN cabal-install:test:integration-tests2) -j1 --hide-successes step_cli_suite() { print_header "cabal-install: cabal-testsuite" -CMD="$($CABALLISTBIN cabal-testsuite:exe:cabal-tests) --builddir=$CABAL_TESTSUITE_BDIR --with-cabal=$($CABALLISTBIN cabal-install:exe:cabal) $TESTSUITEJOBS --with-ghc=$HC --hide-successes --intree-cabal-lib=$PWD --test-tmp=$PWD/testdb" +CMD="$($CABALLISTBIN cabal-testsuite:exe:cabal-tests) --builddir=$CABAL_TESTSUITE_BDIR --with-cabal=$($CABALLISTBIN cabal-install:exe:cabal) $TESTSUITEJOBS --with-ghc=$HC --hide-successes --intree-cabal-lib=$PWD --test-tmp=$PWD/testdb $RTSOPTS" (cd cabal-testsuite && timed $CMD) || exit 1 } -- 2.11.4.GIT