fix build on windows
authorJoey Hess <joeyh@joeyh.name>
Fri, 3 Mar 2023 16:58:39 +0000 (12:58 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 3 Mar 2023 16:58:39 +0000 (12:58 -0400)
Remote/Git.hs
Utility/DirWatcher/Win32Notify.hs
doc/bugs/windows_build_fails_starting_from_commit_54ad1b4cf.mdwn

index c65d1388d1f05fd3891040e7a567faa57f3a0b68..2fc5867058a7c2383c3a92b20117051a96ef74fa 100644 (file)
@@ -65,13 +65,10 @@ import Types.ProposedAccepted
 import Annex.Action
 import Messages.Progress
 
-#ifndef mingw32_HOST_OS
-import qualified Utility.RawFilePath as R
-#endif
-
 import Control.Concurrent
 import qualified Data.Map as M
 import qualified Data.ByteString as S
+import qualified Utility.RawFilePath as R
 import Network.URI
 
 remote :: RemoteType
index 7eba40de97fb33aea42a02db65bfccf11a361ef9..a6a7e4ce97ca619bb3c85268a99bf09343b5b4ab 100644 (file)
@@ -9,6 +9,7 @@ module Utility.DirWatcher.Win32Notify (watchDir) where
 
 import Common hiding (isDirectory)
 import Utility.DirWatcher.Types
+import qualified Utility.RawFilePath as R
 
 import System.Win32.Notify
 import qualified System.PosixCompat.Files (isRegularFile)
@@ -59,7 +60,7 @@ watchDir dir ignored scanevents hooks = do
                  where
                        runhook h s = maybe noop (\a -> a f s) (h hooks)
                
-       getstatus = catchMaybeIO . getFileStatus
+       getstatus = catchMaybeIO . R.getFileStatus . fromRawFilePath
 
 {- Check each component of the path to see if it's ignored. -}
 ignoredPath :: (FilePath -> Bool) -> FilePath -> Bool
index ffe08b7fb2502d92e2ee0af1328095c68fa88482..75257c8732eb04e69b28b1645f568a6ad69022a6 100644 (file)
@@ -111,3 +111,8 @@ Git Annex is great. I use it several times a week with my multigigabyte backups,
 
 [[!meta author=jkniiv]]
 [[!meta title="windows: build fails starting from commit 54ad1b4cf"]]
+
+> Kind of expected there would be something! The patch is almost right,
+> but we're avoiding using System.PosixCompat.Files.getFileStatus 
+> since it doesn't support long paths, so have to use
+> Utility.RawFilePath.getFileStatus instead. [[done]] --[[Joey]]