diff --git a/Annex/Content.hs b/Annex/Content.hs index 3bdaacd45a..a7535da1cd 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -154,7 +154,7 @@ winLocker :: (LockFile -> IO (Maybe LockHandle)) -> ContentLocker winLocker takelock _ (Just lockfile) = do modifyContent lockfile $ void $ liftIO $ tryIO $ - writeFile lockfile "" + writeFile (fromRawFilePath lockfile) "" liftIO $ takelock lockfile -- never reached; windows always uses a separate lock file winLocker _ _ Nothing = return Nothing diff --git a/Annex/Content/Presence.hs b/Annex/Content/Presence.hs index 3d05765fcb..861288c0b9 100644 --- a/Annex/Content/Presence.hs +++ b/Annex/Content/Presence.hs @@ -115,7 +115,7 @@ inAnnexSafe key = inAnnex' (fromMaybe True) (Just False) go key Nothing -> return is_locked Just lockhandle -> do dropLock lockhandle - void $ tryIO $ removeWhenExistsWith removeLink lockfile + void $ tryIO $ removeWhenExistsWith removeLink (fromRawFilePath lockfile) return is_unlocked , return is_missing ) diff --git a/Assistant.hs b/Assistant.hs index a0bbd37047..d7e75e23de 100644 --- a/Assistant.hs +++ b/Assistant.hs @@ -102,7 +102,7 @@ startDaemon assistant foreground startdelay cannotrun listenhost startbrowser = createAnnexDirectory (parentDir logfile) ifM (liftIO $ isNothing <$> getEnv flag) ( liftIO $ withNullHandle $ \nullh -> do - loghandle <- openLog logfile + loghandle <- openLog (fromRawFilePath logfile) e <- getEnvironment cmd <- programPath ps <- getArgs @@ -115,7 +115,7 @@ startDaemon assistant foreground startdelay cannotrun listenhost startbrowser = exitcode <- withCreateProcess p $ \_ _ _ pid -> waitForProcess pid exitWith exitcode - , start (Utility.Daemon.foreground (Just pidfile)) $ + , start (Utility.Daemon.foreground (Just (fromRawFilePath pidfile))) $ case startbrowser of Nothing -> Nothing Just a -> Just $ a Nothing Nothing diff --git a/CHANGELOG b/CHANGELOG index fe32908de6..e914ee55f6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,7 @@ git-annex (8.20201117) UNRELEASED; urgency=medium * Fix hang when an external special remote program exited but the stderr pipe to it was left open, due to a daemon having inherited the file descriptor. + * Fix build on Windows. -- Joey Hess Mon, 16 Nov 2020 09:38:32 -0400 diff --git a/Logs/Transfer.hs b/Logs/Transfer.hs index 2722702d2f..369c6a630f 100644 --- a/Logs/Transfer.hs +++ b/Logs/Transfer.hs @@ -131,7 +131,7 @@ checkTransfer t = debugLocks $ do v <- liftIO $ lockShared lck liftIO $ case v of Nothing -> catchDefaultIO Nothing $ - readTransferInfoFile Nothing tfile + readTransferInfoFile Nothing (fromRawFilePath tfile) Just lockhandle -> do dropLock lockhandle cleanstale diff --git a/Remote/Directory.hs b/Remote/Directory.hs index 5c20894ee3..bc5d2ab3b6 100644 --- a/Remote/Directory.hs +++ b/Remote/Directory.hs @@ -258,7 +258,7 @@ removeDirGeneric topdir dir = do #ifdef mingw32_HOST_OS {- Windows needs the files inside the directory to be writable - before it can delete them. -} - void $ tryIO $ mapM_ allowWrite =<< dirContents dir + void $ tryIO $ mapM_ (allowWrite . toRawFilePath) =<< dirContents dir #endif tryNonAsync (removeDirectoryRecursive dir) >>= \case Right () -> return () @@ -446,7 +446,7 @@ retrieveExportWithContentIdentifierM dir loc cid dest mkkey p = #ifndef mingw32_HOST_OS =<< getFdStatus fd #else - =<< getFileStatus f + =<< R.getFileStatus f #endif guardSameContentIdentifiers cont cid currcid diff --git a/Utility/Daemon.hs b/Utility/Daemon.hs index 683a59263e..9a34255897 100644 --- a/Utility/Daemon.hs +++ b/Utility/Daemon.hs @@ -112,7 +112,7 @@ lockPidFile pidfile = do pid <- getPID writeFile pidfile (show pid) lckfile <- winLockFile pid pidfile - writeFile lckfile "" + writeFile (fromRawFilePath lckfile) "" void $ lockExclusive lckfile #endif diff --git a/doc/bugs/release_8.20201116_doesn__39__t_build_on_windows.mdwn b/doc/bugs/release_8.20201116_doesn__39__t_build_on_windows.mdwn index 96ca8fee3a..a344855665 100644 --- a/doc/bugs/release_8.20201116_doesn__39__t_build_on_windows.mdwn +++ b/doc/bugs/release_8.20201116_doesn__39__t_build_on_windows.mdwn @@ -208,3 +208,5 @@ Annex -- my use case is more like local archiving and stuff. Git Annex does give my backup files around and it's always nice to have an external checksum (I use MD5E w/Annex) recorded "in the system" so that you can be sure your files are not altered due to bit rot, etc. In any case, big thanks go to Joey (et al.) for this wonderful tool you made! + +> [[fixed|done]] --[[Joey]]