From 0bc43407e5b27404f3ed5b1917fb8b2efa7a26c3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 19 May 2013 20:35:33 -0400 Subject: [PATCH] do a clean build if incremental fails --- standalone/windows/build.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/standalone/windows/build.sh b/standalone/windows/build.sh index 81e66f2929..230ffd2465 100644 --- a/standalone/windows/build.sh +++ b/standalone/windows/build.sh @@ -35,14 +35,24 @@ cd .. cabal install --only-dependencies -f"$FLAGS" -# Build git-annex -withcyg cabal configure -f"$FLAGS" -withcyg cabal build +runbuild () { + # Build git-annex + withcyg cabal configure -f"$FLAGS" + withcyg cabal build + + # Build the installer + cabal install nsis + ghc --make Build/NullSoftInstaller.hs + withcyg Build/NullSoftInstaller.exe +} -# Build the installer -cabal install nsis -ghc --make Build/NullSoftInstaller.hs -withcyg Build/NullSoftInstaller.exe +# Incremental build sometimes may fail, possibly because the configure +# script has changed but cabal neglects to re-build it on Windows +if ! runbuild; then + echo "Retrying after cabal clean" + cabal clean + runbuild +fi # Test git-annex rm -rf .t