build.cabal.sh: Use cabal new-run (#435)
authorBen Gamari <ben@smart-cactus.org>
Thu, 12 Oct 2017 22:17:50 +0000 (18:17 -0400)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Thu, 12 Oct 2017 22:17:50 +0000 (23:17 +0100)
The previous approach was terribly unreliable, leading me to waste an hour
debugging #425.

build.sh

index 2a0e8a7..5d1c2c2 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -46,9 +46,8 @@ if [ "${CABVER[0]}" -eq 2 -o "${CABVER[0]}" -eq 1 -a "${CABVER[1]}" -ge 24 ]; th
     # New enough cabal version detected, so
     # let's use the superior 'cabal new-build' mode
 
-    # there's no 'cabal new-run' yet, but it's easy to emulate
     "$CABAL" new-build --disable-profiling --disable-documentation -j exe:hadrian
-    $(find ./dist-newstyle -type f -name hadrian | head -n 1) \
+    "$CABAL" new-run -- hadrian        \
         --lint                         \
         --directory "$absoluteRoot/.." \
         "$@"