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.
This commit is contained in:
Joey Hess 2023-08-02 12:48:12 -04:00
parent 461330c585
commit 85aadcfa1e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 41 additions and 3 deletions

View 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