[commit: ghc] wip/nfs-locking: Restore the original build script relying on the global package database (2f88f30)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:44:42 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/2f88f30099934a46fb9ceceb4267924e3975ecaa/ghc

>---------------------------------------------------------------

commit 2f88f30099934a46fb9ceceb4267924e3975ecaa
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sat Oct 14 23:44:49 2017 +0100

    Restore the original build script relying on the global package database
    
    See #435, #430


>---------------------------------------------------------------

2f88f30099934a46fb9ceceb4267924e3975ecaa
 build.global-db.sh | 66 ++++++++++++++++++------------------------------------
 1 file changed, 22 insertions(+), 44 deletions(-)

diff --git a/build.global-db.sh b/build.global-db.sh
index 2a0e8a7..5f1579b 100755
--- a/build.global-db.sh
+++ b/build.global-db.sh
@@ -1,7 +1,5 @@
 #!/usr/bin/env bash
 
-CABAL=cabal
-
 set -euo pipefail
 
 # readlink on os x, doesn't support -f, to prevent the
@@ -30,45 +28,25 @@ function rl {
     echo "$RESULT"
 }
 
-absoluteRoot="$(dirname "$(rl "$0")")"
-cd "$absoluteRoot"
-
-if ! type "$CABAL" > /dev/null; then
-    echo "Please make sure 'cabal' is in your PATH"
-    exit 2
-fi
-
-CABVERSTR=$("$CABAL" --numeric-version)
-
-CABVER=( ${CABVERSTR//./ } )
-
-if [ "${CABVER[0]}" -eq 2 -o "${CABVER[0]}" -eq 1 -a "${CABVER[1]}" -ge 24 ]; then
-    # 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) \
-        --lint                         \
-        --directory "$absoluteRoot/.." \
-        "$@"
-
-else
-    # The logic below is quite fragile, but it's better than nothing for pre-1.24 cabals
-    echo "Old pre cabal 1.24 version detected. Falling back to legacy 'cabal sandbox' mode."
-
-    # Initialize sandbox if necessary
-    if ! ( "$CABAL" sandbox hc-pkg list > /dev/null 2>&1); then
-        "$CABAL" sandbox init
-        "$CABAL" sandbox add-source ../libraries/Cabal/Cabal
-        "$CABAL" install                \
-            --dependencies-only         \
-            --disable-library-profiling \
-            --disable-shared
-    fi
-
-    "$CABAL" run hadrian --            \
-        --lint                         \
-        --directory "$absoluteRoot/.." \
-        "$@"
-fi
+root="$(dirname "$(rl "$0")")"
+
+mkdir -p "$root/bin"
+
+ghc                                      \
+    "$root/src/Main.hs"                  \
+    -Wall                                \
+    -fno-warn-name-shadowing             \
+    -XRecordWildCards                    \
+    -i"$root/src"                        \
+    -i"$root/../libraries/Cabal/Cabal"   \
+    -rtsopts                             \
+    -with-rtsopts=-I0                    \
+    -threaded                            \
+    -outputdir="$root/bin" \
+    -j -O                                \
+    -o "$root/bin/hadrian"
+
+"$root/bin/hadrian"        \
+    --lint                 \
+    --directory "$root/.." \
+    "$@"
\ No newline at end of file



More information about the ghc-commits mailing list