[Git][ghc/ghc][master] hadrian: Build with threaded runtime if available

Marge Bot gitlab at gitlab.haskell.org
Wed Jun 17 19:31:19 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
d23fc678 by Stefan Schulze Frielinghaus at 2020-06-17T15:31:09-04:00
hadrian: Build with threaded runtime if available

See #16873.

- - - - -


1 changed file:

- hadrian/build-cabal


Changes:

=====================================
hadrian/build-cabal
=====================================
@@ -1,7 +1,8 @@
 #!/usr/bin/env bash
 
 CABAL=cabal
-CABFLAGS="--disable-documentation --disable-profiling --disable-library-profiling $CABFLAGS"
+CABFLAGS=("--disable-documentation" "--disable-profiling" "--disable-library-profiling" $CABFLAGS)
+( ${GHC:-ghc} --info | grep -s '("Support SMP","YES")' > /dev/null ) || CABFLAGS+=("--constraint=hadrian -threaded")
 
 # It is currently more robust to pass Cabal an absolute path to the project file.
 PROJ="$PWD/hadrian/cabal.project"
@@ -21,27 +22,13 @@ fi
 CABVERSTR=$("$CABAL" --numeric-version)
 CABVER=( ${CABVERSTR//./ } )
 
-build_failed() {
-    ( ghc --info | grep -s '("Support SMP","YES")' > /dev/null ) \
-      || cat <<EOF
-Your compiler does not support the threaded runtime system.
-Please disable the \`threaded\` Cabal flag in project.cabal.local
-by running:
-
-    echo -e "package hadrian\n  flags: -threaded" >> project.cabal.local
-
-EOF
-    exit 1
-}
-
 if [ "${CABVER[0]}" -gt 2 -o "${CABVER[0]}" -eq 2 -a "${CABVER[1]}" -ge 2 ];
 then
-    "$CABAL" --project-file="$PROJ" new-build $CABFLAGS -j exe:hadrian
+    "$CABAL" --project-file="$PROJ" new-build "${CABFLAGS[@]}" -j exe:hadrian
     # use new-exec instead of new-run to make sure that the build-tools (alex & happy) are in PATH
-    "$CABAL" --project-file="$PROJ" new-exec  $CABFLAGS    hadrian -- \
+    "$CABAL" --project-file="$PROJ" new-exec  "${CABFLAGS[@]}"    hadrian -- \
         --directory "$PWD" \
-        "$@" \
-        || build_failed
+        "$@"
 else
     echo "Cabal version is too old; you need at least cabal-install 2.2"
     exit 2



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d23fc67847a27222ad8a0c193e6a10b5a4c0cf48

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d23fc67847a27222ad8a0c193e6a10b5a4c0cf48
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200617/9cec5435/attachment-0001.html>


More information about the ghc-commits mailing list