Commit d5170890 authored by Tamar Christina's avatar Tamar Christina Committed by Ben Gamari
Browse files

Revert "compiler: Disable atomic renaming on Windows"

The original reason this was disabled should be fixed by the previous
commit.

This reverts commit 1c1b63d6.
parent 8f6fd089
...@@ -1291,8 +1291,7 @@ modificationTimeIfExists f = do ...@@ -1291,8 +1291,7 @@ modificationTimeIfExists f = do
-- also results in a skip. -- also results in a skip.
withAtomicRename :: (MonadIO m) => FilePath -> (FilePath -> m a) -> m a withAtomicRename :: (MonadIO m) => FilePath -> (FilePath -> m a) -> m a
withAtomicRename targetFile f withAtomicRename targetFile f = do
| enableAtomicRename = do
-- The temp file must be on the same file system (mount) as the target file -- The temp file must be on the same file system (mount) as the target file
-- to result in an atomic move on most platforms. -- to result in an atomic move on most platforms.
-- The standard way to ensure that is to place it into the same directory. -- The standard way to ensure that is to place it into the same directory.
...@@ -1303,17 +1302,6 @@ withAtomicRename targetFile f ...@@ -1303,17 +1302,6 @@ withAtomicRename targetFile f
liftIO $ renameFile temp targetFile liftIO $ renameFile temp targetFile
return res return res
| otherwise = f targetFile
where
-- As described in #16450, enabling this causes spurious build failures due
-- to apparently missing files.
enableAtomicRename :: Bool
#if defined(mingw32_BUILD_OS)
enableAtomicRename = False
#else
enableAtomicRename = True
#endif
-- -------------------------------------------------------------- -- --------------------------------------------------------------
-- split a string at the last character where 'pred' is True, -- split a string at the last character where 'pred' is True,
-- returning a pair of strings. The first component holds the string -- returning a pair of strings. The first component holds the string
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment