# Building dependencies takes almost too long on windows, so build without
# optimisation (including when building the dependencies)
before_build:
- - cp stack.yaml stack.yaml.build
+ - sh: cp stack.yaml stack.yaml.build
+ - ps: cp stack-lts-18.13.yaml stack.yaml.build
- sh: 'echo "apply-ghc-options: everything" >> stack.yaml.build'
- ps: '"apply-ghc-options: everything" |Add-Content -Path .\stack.yaml.build'
- stack --stack-yaml stack.yaml.build build --only-dependencies --ghc-options=-O0
- License: BSD-2-clause
-}
-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE OverloadedStrings, CPP #-}
module Utility.LockFile.Windows (
lockShared,
openLock :: ShareMode -> LockFile -> IO (Maybe LockHandle)
openLock sharemode f = do
f' <- convertToWindowsNativeNamespace f
+#if MIN_VERSION_Win32(2,13,4)
r <- tryNonAsync $ createFile_NoRetry f' gENERIC_READ sharemode
security_attributes oPEN_ALWAYS fILE_ATTRIBUTE_NORMAL
(maybePtr Nothing)
return $ case r of
Left _ -> Nothing
Right h -> Just h
+#else
+ h <- withTString (fromRawFilePath f') $ \c_f ->
+ c_CreateFile c_f gENERIC_READ sharemode security_attributes
+ oPEN_ALWAYS fILE_ATTRIBUTE_NORMAL (maybePtr Nothing)
+ return $ if h == iNVALID_HANDLE_VALUE
+ then Nothing
+ else Just h
+#endif
where
security_attributes = maybePtr Nothing
-- make cabal install git-annex work.
Extra-Source-Files:
stack.yaml
+ stack-lts-18.13.yaml
README
CHANGELOG
NEWS
if (os(windows))
Build-Depends:
- Win32 (>= 2.13.4.0),
+ Win32 ((>= 2.6.1.0 && < 2.12.0.0) || >= 2.13.4.0),
setenv,
process (>= 1.6.2.0),
silently (>= 1.2.5.1)
--- /dev/null
+flags:
+ git-annex:
+ production: true
+ assistant: true
+ pairing: true
+ torrentparser: true
+ magicmime: false
+ dbus: false
+ debuglocks: false
+ benchmark: true
+ gitlfs: true
+packages:
+- '.'
+resolver: lts-18.13
+extra-deps:
+- IfElse-0.85
+- aws-0.22
+- bloomfilter-2.0.1.0
+- git-lfs-1.2.0
+- http-client-restricted-0.0.4
+- network-multicast-0.3.2
+- sandi-0.5
+- torrent-10000.1.1
+- base16-bytestring-0.1.1.7
+- base64-bytestring-1.0.0.3
+- bencode-0.6.1.1
+- http-client-0.7.9