windows back to lts-18.13 temporarily
authorJoey Hess <joeyh@joeyh.name>
Wed, 2 Aug 2023 16:48:12 +0000 (12:48 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 2 Aug 2023 16:49:38 +0000 (12:49 -0400)
I can't seem to get stack to resolve dependencies with Win32-2.13.4.0,
no matter what I try. Why it blows up, I don't know.

And allow-newer: true actually causes it to downgrade Win32 to the one
version that won't build. Unbelivable that allows downgrades.

So just gonna have to wait for that to get into stackage nightly, and
then stack.yaml can be updated to use that, and the changes in this
commit reverted.

.appveyor.yml
Utility/LockFile/Windows.hs
git-annex.cabal
stack-lts-18.13.yaml [new file with mode: 0644]

index ff3a95feea2c4bc3f0c14e8141da44d18654b423..82e3bfe3f657a95629acca6c6fad298af25b2014 100644 (file)
@@ -100,7 +100,8 @@ install:
 # 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
index 64a8ab86d0b0bc0fdd85ef035ed67cff23710007..2ab521e438c525afe50a5f698732149cc2a7a6f6 100644 (file)
@@ -5,7 +5,7 @@
  - License: BSD-2-clause
  -}
 
-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE OverloadedStrings, CPP #-}
 
 module Utility.LockFile.Windows (
        lockShared,
@@ -58,12 +58,21 @@ lockExclusive = openLock fILE_SHARE_NONE
 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
 
index fe0167fd24c9cbab433736e20e281b715b5c2e88..aa05f76989590eccc55d102fa05e796eea0c948d 100644 (file)
@@ -35,6 +35,7 @@ Description:
 -- make cabal install git-annex work.
 Extra-Source-Files:
   stack.yaml
+  stack-lts-18.13.yaml
   README
   CHANGELOG
   NEWS
@@ -413,7 +414,7 @@ Executable git-annex
 
   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)
diff --git a/stack-lts-18.13.yaml b/stack-lts-18.13.yaml
new file mode 100644 (file)
index 0000000..7dbfb65
--- /dev/null
@@ -0,0 +1,27 @@
+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