hadrian/ghci.sh doesn't fail gracefully when hadrian/build.cabal.sh does
If hadrian/build.cabal.sh
dies (eg. if cabal
's version is too old), it will print a nice message and quit.
However, hadrian/ghci.sh
doesn't check for errors, and will thus dump the nice error message into the flags for setting up ghci
:
stack exec -- bash -x ./hadrian/ghci.sh
++ TERM=dumb
++ CABFLAGS=-v0
++ . hadrian/build.cabal.sh tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci
+++ CABAL=cabal
+++ CABFLAGS='--disable-documentation --disable-profiling --disable-library-profiling -v0'
+++ PROJ=/home/sandy/prj/ghc/hadrian/cabal.project
+++ set -euo pipefail
+++ '[' -f /home/sandy/prj/ghc/hadrian/cabal.project ']'
+++ type cabal
++++ cabal --numeric-version
+++ CABVERSTR=2.0.0.1
+++ CABVER=(${CABVERSTR//./ })
+++ '[' 2 -gt 2 -o 2 -eq 2 -a 0 -ge 2 ']'
+++ echo 'Cabal version is too old; you need at least cabal-install 2.2'
+++ exit 2
+ ghci Cabal version is too 'old;' you need at least cabal-install 2.2 -fno-code -fwrite-interface -hidir=.hadrian_ghci/interface -O0 ghc/Main.hs