From 821cf6d14a42459585c010a1caa3928aff40a0d4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 Oct 2017 13:00:29 -0400 Subject: update windows build scripts to use stack Not tested yet. The EvilLinker workaround is removed. That got fixed in ghc 8.0.1, (per https://ghc.haskell.org/trac/ghc/ticket/8596) which will finally be used by the windows autobuilder now. I have not deleted the EvilLinker yet (or closed its bugs). This commit was sponsored by John Peloquin on Patreon. --- standalone/windows/build-simple.sh | 26 ++++++----------- standalone/windows/build.sh | 59 +++++++++----------------------------- 2 files changed, 23 insertions(+), 62 deletions(-) (limited to 'standalone/windows') diff --git a/standalone/windows/build-simple.sh b/standalone/windows/build-simple.sh index 65be71271..381f5635f 100755 --- a/standalone/windows/build-simple.sh +++ b/standalone/windows/build-simple.sh @@ -11,28 +11,20 @@ PATH="/c/Program Files/Git/cmd:/c/Program Files/NSIS:$PATH" withcyg () { PATH="$PATH:/c/cygwin/bin" "$@" } + +# Prefer programs from cygwin. withcygpreferred () { PATH="/c/cygwin/bin:$PATH" "$@" } -# Install haskell dependencies. -# cabal install is not run in cygwin, because we don't want configure scripts -# for haskell libraries to link them with the cygwin library. -if ! cabal install --only-dependencies; then - cabal update || true - cabal install --only-dependencies -fi +# Deps are not built with cygwin environment, because we don't want +# configure scripts for haskell libraries to link them with the cygwin +# libraries. +stack setup +stack build --dependencies-only # Build git-annex -if [ ! -e "dist/setup-config" ]; then - withcyg cabal configure -fi -if ! withcyg cabal build; then - ghc --make Build/EvilLinker -fno-warn-tabs - withcyg Build/EvilLinker -fi +withcyg stack build # Build the installer -cabal install nsis -ghc --make Build/NullSoftInstaller.hs -fno-warn-tabs -PATH="$PATH:/cygdrive/c/Program Files/NSIS" Build/NullSoftInstaller.exe +withcygpreferred stack runghc --package nsis Build/NullSoftInstaller.hs diff --git a/standalone/windows/build.sh b/standalone/windows/build.sh index 2aa382cdc..f4407ab31 100755 --- a/standalone/windows/build.sh +++ b/standalone/windows/build.sh @@ -19,6 +19,11 @@ withcyg () { PATH="$PATH:/c/cygwin/bin" "$@" } +# Prefer programs from cygwin. +withcygpreferred () { + PATH="/c/cygwin/bin:$PATH" "$@" +} + # This tells git-annex where to upgrade itself from. UPGRADE_LOCATION=http://downloads.kitenet.net/git-annex/windows/current/git-annex-installer.exe export UPGRADE_LOCATION @@ -28,49 +33,18 @@ export UPGRADE_LOCATION #FORCE_GIT_VERSION=1.9.5 #export FORCE_GIT_VERSION -# Uncomment to get rid of cabal installed libraries. -#cabal list --installed -#rm -rf /c/Users/jenkins/AppData/Roaming/cabal /c/Users/jenkins/AppData/Roaming/ghc - # Don't allow build artifact from a past successful build to be extracted # if we fail. rm -f git-annex-installer.exe -# Install haskell dependencies. -# cabal install is not run in cygwin, because we don't want configure scripts -# for haskell libraries to link them with the cygwin library. -cabal update || true - -# workaround strange cabal install bug for xss-sanitize -if [ ! -d xss-sanitize ]; then - git clone https://github.com/yesodweb/haskell-xss-sanitize xss-sanitize - (cd xss-sanitize && cabal install) -fi - -cabal install --only-dependencies \ - --constraint='persistent-sqlite ==2.2' \ - --constraint='cryptonite ==0.7' \ - --constraint='mwc-random ==0.13.3.2' \ - --force-reinstalls \ - || true - -# Detect when the last build was an incremental build and failed, -# and try a full build. Done this way because this shell seems a bit -# broken. -if [ -e last-incremental-failed ]; then - cabal clean || true - # windows breakage.. - rm -rf dist dist.old || mv -v dist dist.old -fi -touch last-incremental-failed - +# Deps are not built with cygwin environment, because we don't want +# configure scripts for haskell libraries to link them with the cygwin +# libraries. +stack setup +stack build --dependencies-only + # Build git-annex -withcyg cabal configure -if ! withcyg cabal build; then - rm -f Build/EvilLinker.exe - ghc --make Build/EvilLinker -fno-warn-tabs - Build/EvilLinker -fi +withcyg stack build # Get extra programs to bundle with git-annex. # These are msys2 programs, from https://msys2.github.io/. @@ -96,15 +70,10 @@ getextra rsync.exe 85cb7a4d16d274fcf8069b39042965ad26abd6aa getextra wget.exe 044380729200d5762965b10123a4f134806b01cf # Build the installer -cabal install nsis -ghc -fforce-recomp --make Build/NullSoftInstaller.hs -fno-warn-tabs -PATH=".:/c/cygwin/bin:$PATH" Build/NullSoftInstaller.exe - -rm -f last-incremental-failed +withcygpreferred stack runghc --package nsis Build/NullSoftInstaller.hs rm -f dist/build-version -ghc --make Build/BuildVersion.hs -Build/BuildVersion > dist/build-version +stack runghc Build/BuildVersion.hs > dist/build-version # Test git-annex # The test is run in c:/WINDOWS/Temp, because running it in the autobuilder -- cgit v1.2.3