From 6e90cc9f83b939dfc7a8e1c6dfcb76ed7d4db65d Mon Sep 17 00:00:00 2001 From: brandon s allbery kf8nh Date: Wed, 3 Jul 2024 21:23:58 -0400 Subject: [PATCH] fix non-POSIX [[ ]] Otherwise CI prints `validate.sh: 332: [[: not found` and the line does nothing (but `validate.sh` continues to run), unless the system shell is `ksh` / `bash` / `zsh`. This may explain https://github.com/haskell/cabal/pull/10114#issuecomment-2178163927. (cherry picked from commit 0b5cf151c4d97f8344c06c8ef3da6ff9b2d4bae6) --- validate.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/validate.sh b/validate.sh index e6cd603db41..8aec55f69ed 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 #######################################################################