summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Assistant/Restart.hs4
-rw-r--r--Assistant/TransferSlots.hs4
-rw-r--r--CHANGELOG3
-rw-r--r--Utility/Daemon.hs4
-rw-r--r--Utility/WinProcess.hs15
-rw-r--r--doc/install/Windows.mdwn15
-rw-r--r--git-annex.cabal1
-rw-r--r--stack-windows.yaml (renamed from standalone/windows/stack.yaml)3
-rwxr-xr-xstandalone/windows/build.sh11
9 files changed, 22 insertions, 38 deletions
diff --git a/Assistant/Restart.hs b/Assistant/Restart.hs
index be1b21392..ce180b370 100644
--- a/Assistant/Restart.hs
+++ b/Assistant/Restart.hs
@@ -27,7 +27,7 @@ import Control.Concurrent
#ifndef mingw32_HOST_OS
import System.Posix (signalProcess, sigTERM)
#else
-import Utility.WinProcess
+import System.Win32.Process (terminateProcessId)
#endif
import Network.URI
@@ -59,7 +59,7 @@ terminateSelf =
#ifndef mingw32_HOST_OS
signalProcess sigTERM =<< getPID
#else
- terminatePID =<< getPID
+ terminateProcessId =<< getPID
#endif
runRestart :: Assistant URLString
diff --git a/Assistant/TransferSlots.hs b/Assistant/TransferSlots.hs
index c80cf880a..74453004d 100644
--- a/Assistant/TransferSlots.hs
+++ b/Assistant/TransferSlots.hs
@@ -41,7 +41,7 @@ import qualified Control.Concurrent.MSemN as MSemN
import System.Posix.Process (getProcessGroupIDOf)
import System.Posix.Signals (signalProcessGroup, sigTERM, sigKILL)
#else
-import Utility.WinProcess
+import System.Win32.Process (terminateProcessId)
#endif
type TransferGenerator = Assistant (Maybe (Transfer, TransferInfo, Transferrer -> Assistant ()))
@@ -270,7 +270,7 @@ cancelTransfer pause t = do
threadDelay 50000 -- 0.05 second grace period
signal sigKILL
#else
- terminatePID pid
+ terminateProcessId pid
#endif
{- Start or resume a transfer. -}
diff --git a/CHANGELOG b/CHANGELOG
index e9803b14f..6af753837 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,9 +2,6 @@ git-annex (6.20171019) UNRELEASED; urgency=medium
* Windows build fixed, and changed to use stack for more relaiable build
environment.
- * Code for terminating processes on Windows is not linking anymore;
- made a warning be displayed instead. This breaks restarting the
- assistant and git annex assistant --stop.
* Windows: Remove wget from bundle; it needs libraries that are not
included, and git for windows includes curl which git-annex will use
instead.
diff --git a/Utility/Daemon.hs b/Utility/Daemon.hs
index 5c0ea4169..2cb0864d2 100644
--- a/Utility/Daemon.hs
+++ b/Utility/Daemon.hs
@@ -14,7 +14,7 @@ import Utility.PID
#ifndef mingw32_HOST_OS
import Utility.LogFile
#else
-import Utility.WinProcess
+import System.Win32.Process (terminateProcessId)
import Utility.LockFile
#endif
@@ -162,7 +162,7 @@ stopDaemon pidfile = go =<< checkDaemon pidfile
#ifndef mingw32_HOST_OS
signalProcess sigTERM pid
#else
- terminatePID pid
+ terminateProcessId pid
#endif
{- Windows locks a lock file that corresponds with the pid of the process.
diff --git a/Utility/WinProcess.hs b/Utility/WinProcess.hs
deleted file mode 100644
index cb9029874..000000000
--- a/Utility/WinProcess.hs
+++ /dev/null
@@ -1,15 +0,0 @@
-{- Windows processes
- -
- - Copyright 2014 Joey Hess <id@joeyh.name>
- -
- - License: BSD-2-clause
- -}
-
-module Utility.WinProcess where
-
-import Utility.PID
-import System.IO
-
-terminatePID :: PID -> IO ()
-terminatePID p = hPutStrLn stderr "terminating processes on windows is not currently working"
-
diff --git a/doc/install/Windows.mdwn b/doc/install/Windows.mdwn
index 1d9599ac8..af68e8028 100644
--- a/doc/install/Windows.mdwn
+++ b/doc/install/Windows.mdwn
@@ -32,15 +32,16 @@ To build git-annex from source on Windows, you need to install
[Git for Windows](http://git-scm.com/downloads), and
[Stack](http://haskellstack.org/).
-You also need to install rsync and wget for windows.
-They need to be linked with the same MINGW32 libraries that come with Git
-for Windows. One way is to download them from
+You also need to install rsync for windows.
+It needs to be linked with the same MINGW32 libraries that come with Git
+for Windows. One way is to download it from
<https://downloads.kitenet.net/git-annex/windows/assets/>.
-Put them somewhere in PATH.
+Put it somewhere in PATH.
-Then open Git Bash, [[clone git-annex|download]], and in
-git-annex's source tree, run "stack build" to download and build
-all dependencies and git-annex. "stack install" will install git-annex.
+Then open Git Bash, [[clone git-annex|download]], and in git-annex's source
+tree, run "stack build --stack-yaml stack-windows.yaml" to download and
+build all dependencies and git-annex. "stack install --stack-yaml
+stack-windows.yaml" will install git-annex.
(To build the git-annex installer, you also need to install the NullSoft
installer system. The script `standalone/windows/build.sh` is
diff --git a/git-annex.cabal b/git-annex.cabal
index 4115b5ba6..14142eea6 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -1061,7 +1061,6 @@ Executable git-annex
Other-Modules:
Utility.LockFile.Windows
Utility.LockPool.Windows
- Utility.WinProcess
else
Other-Modules:
Utility.LockFile.Posix
diff --git a/standalone/windows/stack.yaml b/stack-windows.yaml
index 54b8fe920..cdf4b3870 100644
--- a/standalone/windows/stack.yaml
+++ b/stack-windows.yaml
@@ -16,6 +16,9 @@ flags:
androidsplice: false
packages:
- '../..'
+- location:
+ git: https://github.com/joeyh/win32
+ commit: f41d9e1cc60f225bc4ef4bbd7ec0bac43b61b982
extra-deps:
- aws-0.17.1
- bloomfilter-2.0.1.0
diff --git a/standalone/windows/build.sh b/standalone/windows/build.sh
index 481d2be7d..5240e6be3 100755
--- a/standalone/windows/build.sh
+++ b/standalone/windows/build.sh
@@ -59,21 +59,20 @@ getextra rsync.exe 85cb7a4d16d274fcf8069b39042965ad26abd6aa
# 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-yaml standalone/windows/stack.yaml
-stack build -j 1 --stack-yaml standalone/windows/stack.yaml --no-haddock --dependencies-only
+stack setup --stack-yaml stack-windows.yaml
+stack build -j 1 --stack-yaml stack-windows.yaml --no-haddock --dependencies-only
# Build git-annex
-withcyg stack build --stack-yaml standalone/windows/stack.yaml
+withcyg stack build --stack-yaml stack-windows.yaml
# Build the installer
-withcygpreferred stack ghc --stack-yaml standalone/windows/stack.yaml --no-haddock \
+withcygpreferred stack ghc --stack-yaml stack-windows.yaml --no-haddock \
--package nsis Build/NullSoftInstaller.hs
./Build/NullSoftInstaller
rm -f dist/build-version
mkdir -p dist
-stack ghc --stack-yaml standalone/windows/stack.yaml --no-haddock \
- Build/BuildVersion.hs
+stack ghc --stack-yaml stack-windows.yaml --no-haddock Build/BuildVersion.hs
./Build/BuildVersion > dist/build-version
# Test git-annex