summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-10-17 13:00:29 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-10-17 13:00:29 -0400
commit821cf6d14a42459585c010a1caa3928aff40a0d4 (patch)
treeb63bc5153a1d28ab479f69fb38aa48fa6e20877c
parentff19dbe8b420bbd68cac0471c3f9e95df651cd05 (diff)
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.
-rw-r--r--Build/NullSoftInstaller.hs13
-rwxr-xr-xstandalone/windows/build-simple.sh26
-rwxr-xr-xstandalone/windows/build.sh59
3 files changed, 29 insertions, 69 deletions
diff --git a/Build/NullSoftInstaller.hs b/Build/NullSoftInstaller.hs
index 7ce470bc9..acbdd83fd 100644
--- a/Build/NullSoftInstaller.hs
+++ b/Build/NullSoftInstaller.hs
@@ -1,17 +1,16 @@
{- Generates a NullSoft installer program for git-annex on Windows.
-
- - This uses the Haskell nsis package (cabal install nsis)
- - to generate a .nsi file, which is then used to produce
- - git-annex-installer.exe
+ - This uses the Haskell nsis package to generate a .nsi file,
+ - which is then used to produce git-annex-installer.exe
-
- The installer includes git-annex, and utilities it uses, with the
- exception of git and some utilities that are bundled with git.
- The user needs to install git separately, and the installer checks
- for that.
-
- - To build the installer, git-annex should already be built by cabal,
- - and the necessary utility programs (rsync and wget) already installed
- - in PATH from msys32.
+ - To build the installer, git-annex should already be built using
+ - stack and the necessary utility programs (rsync and wget) already
+ - installed in PATH from msys32.
-
- Copyright 2013-2015 Joey Hess <id@joeyh.name>
-
@@ -41,7 +40,7 @@ import Build.BundledPrograms
main = do
withTmpDir "nsis-build" $ \tmpdir -> do
let gitannex = tmpdir </> gitannexprogram
- mustSucceed "ln" [File "dist/build/git-annex/git-annex.exe", File gitannex]
+ mustSucceed "stack" [Param "--local-bin-path", File ".", Param "install"]
let license = tmpdir </> licensefile
mustSucceed "sh" [Param "-c", Param $ "zcat standalone/licences.gz > '" ++ license ++ "'"]
webappscript <- vbsLauncher tmpdir "git-annex-webapp" "git annex webapp"
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