[commit: packages/directory] Mistuke-bump-win32-version-bounds, bgamari-patch-1, cbits, master: Add LTS 2 to AppVeyor to test against GHC 7.8 (595f519)

git at git.haskell.org git at git.haskell.org
Mon Apr 17 21:33:57 UTC 2017


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

On branches: Mistuke-bump-win32-version-bounds,bgamari-patch-1,cbits,master
Link       : http://ghc.haskell.org/trac/ghc/changeset/595f519d6f44191c52d00577568c6910635bb3d6/directory

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

commit 595f519d6f44191c52d00577568c6910635bb3d6
Author: Phil Ruffwind <rf at rufflewind.com>
Date:   Sat Apr 30 13:57:41 2016 -0400

    Add LTS 2 to AppVeyor to test against GHC 7.8


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

595f519d6f44191c52d00577568c6910635bb3d6
 appveyor.yml     |  3 ++-
 tools/testscript | 22 +++++++++++++++++-----
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index 8db1c30..fc53613 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -5,11 +5,12 @@ build: false
 environment:
   global:
     # use a short path prefix to avoid running into path-length limitations
-    STACK: stack --resolver lts-5 --skip-msys
     STACK_ROOT: C:\sr
   matrix:
   - DEPS:
+    STACK: stack --skip-msys --resolver lts-5
   - DEPS: Win32-2.3.0.1
+    STACK: stack --skip-msys --resolver lts-2
 cache:
 - "%STACK_ROOT%"
 install:
diff --git a/tools/testscript b/tools/testscript
index 1df340d..a09f300 100755
--- a/tools/testscript
+++ b/tools/testscript
@@ -4,9 +4,18 @@ set -eu
 ghcflags="-rtsopts -threaded -Werror"
 testflags="CreateDirectoryIfMissing001.num-repeats=100000 +RTS -N2"
 
-post_configure() {
+before_build() {
+    # workaround for https://github.com/haskell/cabal/issues/2375
+    if grep "^resolver: lts-2" stack.yaml >/dev/null 2>&1; then
+        sed -i.bak 's/WithHooks autoconfUserHooks//' Setup.hs
+        stack exec sh ./configure
+    fi
+}
+
+after_cabal_configure() {
+    # this hook is only executed in the Cabal case
     if [ "${DISABLE_UTIMENSAT+x}" ]; then
-        sed -i "s/#define HAVE_UTIMENSAT 1//" HsDirectoryConfig.h
+        sed -i.bak "s/#define HAVE_UTIMENSAT 1//" HsDirectoryConfig.h
     fi
 }
 
@@ -39,9 +48,11 @@ prepare() {
         tools/retry $stack setup >/dev/null
         $stack ghc -- --version
         $stack --version
+        for dep in ${DEPS-}; do
+            url=https://hackage.haskell.org/package/${dep}/${dep}.tar.gz
+            curl --retry 3 -fsLS "$url" | tar xzf -
+        done
         $stack init
-        sed "s/^\(extra-deps:\).*/\1 [${DEPS-}]/" stack.yaml >stack.yaml.tmp
-        mv stack.yaml.tmp stack.yaml
         $stack test --install-ghc --only-dependencies
         $stack list-dependencies
 
@@ -59,6 +70,7 @@ prepare() {
 }
 
 build() {
+    before_build
     if [ "${STACK+x}" ]; then
 
         stack="$STACK --no-terminal"
@@ -103,7 +115,7 @@ build() {
 
         testflags=`printf " %s" "$testflags" | sed "s/ / --test-option=/g"`
         cabal configure -v2 --enable-tests --ghc-options="$ghcflags"
-        post_configure
+        after_cabal_configure
         cabal build
         cabal check
         cabal sdist



More information about the ghc-commits mailing list