From: Joey Hess Date: Wed, 2 Aug 2023 16:48:12 +0000 (-0400) Subject: windows back to lts-18.13 temporarily X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~36^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=85aadcfa1eb39c38827e764ab8716aa31bc207e6;p=git-annex.git windows back to lts-18.13 temporarily 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. --- diff --git a/.appveyor.yml b/.appveyor.yml index ff3a95feea..82e3bfe3f6 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -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 diff --git a/Utility/LockFile/Windows.hs b/Utility/LockFile/Windows.hs index 64a8ab86d0..2ab521e438 100644 --- a/Utility/LockFile/Windows.hs +++ b/Utility/LockFile/Windows.hs @@ -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 diff --git a/git-annex.cabal b/git-annex.cabal index fe0167fd24..aa05f76989 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -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 index 0000000000..7dbfb657ac --- /dev/null +++ b/stack-lts-18.13.yaml @@ -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