Skip to content
Snippets Groups Projects
Commit 62c24fa0 authored by Emanuel Borsboom's avatar Emanuel Borsboom
Browse files

Support rio-0.1.11.0

parent d64ba5b7
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,8 @@ packages:
- yaml-0.10.4.0@rev:0 #for hpack-0.31
- persistent-2.9.2@rev:0
- persistent-sqlite-2.9.3@rev:0
- rio-0.1.10.0@rev:0
- rio-0.1.11.0@rev:0
- unliftio-0.2.12@rev:0 #for rio-0.1.11.0
- ansi-terminal-0.9@rev:0
- ansi-wl-pprint-0.6.8.2@rev:1 # for ansi-terminal-0.9
- hedgehog-0.6.1@rev:4 # for ansi-terminal-0.9
......
resolver: nightly-2019-07-11
resolver: nightly-2019-07-15
name: snapshot-for-building-stack-with-ghc-8.6.5
packages:
......@@ -11,6 +11,7 @@ packages:
- cryptonite-0.26@rev:0
- git: https://github.com/snoyberg/filelock.git
commit: 97e83ecc133cd60a99df8e1fa5a3c2739ad007dc
- rio-0.1.11.0@rev:0
- persistent-template-2.7.1@rev:0
- persistent-2.10.0@rev:0
- persistent-sqlite-2.10.1@rev:0
......
......@@ -13,13 +13,13 @@ packages:
- hackage-security-0.5.3.0@rev:2
- http-api-data-0.3.8.1@rev:1
- cabal-doctest-1.0.6@rev:2
- unliftio-0.2.8.0@sha256:5a47f12ffcee837215c67b05abf35dffb792096564a6f81652d75a54668224cd,2250
- unliftio-0.2.12@rev:0 #for rio-0.1.11.0
- happy-1.19.9@sha256:f8c774230735a390c287b2980cfcd2703d24d8dde85a01ea721b7b4b4c82944f,4667
- fsnotify-0.3.0.1@rev:1
- process-1.6.3.0@sha256:fc77cfe75a9653b8c54ae455ead8c06cb8adc4d7a340984d84d8ca880b579919,2370 #because of https://github.com/haskell/process/pull/101
- persistent-2.9.2@rev:0
- persistent-sqlite-2.9.3@rev:0
- rio-0.1.10.0@rev:0
- rio-0.1.11.0@rev:0
- ansi-wl-pprint-0.6.8.2@rev:1 # for ansi-terminal-0.9
- hedgehog-0.6.1@rev:4 # for ansi-terminal-0.9
- typed-process-0.2.6.0@rev:0 # for rio-0.1.10.0
......
......@@ -25,7 +25,7 @@ module Stack.Prelude
) where
import RIO as X
import RIO.File as X
import RIO.File as X hiding (writeBinaryFileAtomic)
import Data.Conduit as X (ConduitM, runConduit, (.|))
import Path as X (Abs, Dir, File, Path, Rel,
toFilePath)
......@@ -46,9 +46,6 @@ import Data.Text.Encoding.Error (lenientDecode)
import qualified Data.Text.IO as T
import qualified RIO.Text as T
import System.Permissions (osIsWindows)
import Conduit
-- | Path version
withSystemTempDir :: MonadUnliftIO m => String -> (Path Abs Dir -> m a) -> m a
......@@ -216,21 +213,7 @@ defaultFirstFalse :: (a -> FirstFalse) -> Bool
defaultFirstFalse _ = False
-- | Write a @Builder@ to a file and atomically rename.
--
-- In the future: replace with a function in rio
writeBinaryFileAtomic :: MonadIO m => Path absrel File -> Builder -> m ()
writeBinaryFileAtomic fp builder
-- Atomic file writing is not supported on Windows yet, unfortunately.
-- withSinkFileCautious needs to be implemented properly for Windows to make
-- this work.
| osIsWindows =
liftIO $
withBinaryFile (toFilePath fp) WriteMode $ \h ->
hPutBuilder h builder
| otherwise =
liftIO $
withSinkFileCautious (toFilePath fp) $ \sink ->
runConduit $
yield builder .|
unsafeBuilderToByteString .|
sink
writeBinaryFileAtomic fp builder =
liftIO $
withBinaryFileAtomic (toFilePath fp) WriteMode (\h -> hPutBuilder h builder)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment