on master help sign in
Switch to UseProvidedHandle after upstream bugfix
commit31036c12f97e5c3c400bb8e9212bf39521ad443d authorMichael Snoyman <michael@snoyman.com> dateThu 11 Dec 2014, 14:44 (12 years ago) parent892fdb4
3 files changed+2−45
Stackage2/PerformBuild.hs+1−5 Stackage2/Prelude.hs−40 stackage.cabal+1
Stackage2/PerformBuild.hs+1−5
@@ -214,17 +214,13 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
214214 ]
215215
216216 runIn wdir outH errH cmd args =
217− withCheckedProcess cp $ \ClosedStream out err -> do
218− void $ async $ out $$ sinkHandle outH
219− void $ async $ err $$ sinkHandle errH
217+ withCheckedProcess cp $ \ClosedStream UseProvidedHandle UseProvidedHandle ->
220218 (return () :: IO ())
221219 where
222220 cp = (proc (unpack $ asText cmd) (map (unpack . asText) args))
223221 { cwd = Just $ fpToString wdir
224− {- FIXME UseProvidedHandle is broken
225222 , std_out = UseHandle outH
226223 , std_err = UseHandle errH
227− -}
228224 , env = Just sbModifiedEnv
229225 }
230226 runParent = runIn sbBuildDir
Stackage2/Prelude.hs−40
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
21{-# LANGUAGE DeriveDataTypeable #-}
32{-# LANGUAGE GeneralizedNewtypeDeriving #-}
43{-# LANGUAGE NoImplicitPrelude #-}
@@ -59,45 +58,6 @@ data ParseFailedException = ParseFailedException TypeRep Text
5958 deriving (Show, Typeable)
6059instance Exception ParseFailedException
6160
62−#ifndef MIN_VERSION_streaming_commons
63−#define MIN_VERSION_streaming_commons(x, y, z) 1
64−#endif
65−#if !MIN_VERSION_streaming_commons(0,1,7)
66−data ProcessExitedUnsuccessfully = ProcessExitedUnsuccessfully CreateProcess ExitCode
67− deriving Typeable
68−instance Show ProcessExitedUnsuccessfully where
69− show (ProcessExitedUnsuccessfully cp ec) = concat
70− [ "Process exited with "
71− , show ec
72− , ": "
73− , showCmdSpec (cmdspec cp)
74− ]
75− where
76− showCmdSpec (ShellCommand str) = str
77− showCmdSpec (RawCommand x xs) = unwords (x:xs)
78−instance Exception ProcessExitedUnsuccessfully
79−
80−checkExitCode :: MonadThrow m => CreateProcess -> ExitCode -> m ()
81−checkExitCode _ ExitSuccess = return ()
82−checkExitCode cp ec = throwM $ ProcessExitedUnsuccessfully cp ec
83−
84−-- FIXME move into streaming-commons?
85−withCheckedProcess :: ( InputSource stdin
86− , OutputSink stderr
87− , OutputSink stdout
88− , MonadIO m
89− )
90− => CreateProcess
91− -> (stdin -> stdout -> stderr -> m b)
92− -> m b
93−withCheckedProcess cp f = do
94− (x, y, z, sph) <- streamingProcess cp
95− res <- f x y z
96− ec <- waitForStreamingProcess sph
97− liftIO $ checkExitCode cp ec
98− return res
99−#endif
100−
10161newtype Maintainer = Maintainer { unMaintainer :: Text }
10262 deriving (Show, Eq, Ord, Hashable, ToJSON, FromJSON, IsString)
10363
stackage.cabal+1
@@ -72,6 +72,7 @@ library
7272 , stm
7373 , mono-traversable
7474 , async
75+ , streaming-commons >= 0.1.7.1
7576
7677executable stackage
7778 default-language: Haskell2010