on master help sign in
Switch to UseProvidedHandle after upstream bugfix
31036c1Michael Snoyman
Stackage2/PerformBuild.hs+1−5
@@ -214,17 +214,13 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
214 ]
214 ]
215
215
216 runIn wdir outH errH cmd args =
216 runIn wdir outH errH cmd args =
217− withCheckedProcess cp $ \ClosedStream out err -> do
217+ withCheckedProcess cp $ \ClosedStream UseProvidedHandle UseProvidedHandle ->
218− void $ async $ out $$ sinkHandle outH
219− void $ async $ err $$ sinkHandle errH
220 (return () :: IO ())
218 (return () :: IO ())
221 where
219 where
222 cp = (proc (unpack $ asText cmd) (map (unpack . asText) args))
220 cp = (proc (unpack $ asText cmd) (map (unpack . asText) args))
223 { cwd = Just $ fpToString wdir
221 { cwd = Just $ fpToString wdir
224− {- FIXME UseProvidedHandle is broken
225 , std_out = UseHandle outH
222 , std_out = UseHandle outH
226 , std_err = UseHandle errH
223 , std_err = UseHandle errH
227− -}
228 , env = Just sbModifiedEnv
224 , env = Just sbModifiedEnv
229 }
225 }
230 runParent = runIn sbBuildDir
226 runParent = runIn sbBuildDir
Stackage2/Prelude.hs−40
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE DeriveDataTypeable #-}
1{-# LANGUAGE DeriveDataTypeable #-}
3{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2{-# LANGUAGE GeneralizedNewtypeDeriving #-}
4{-# LANGUAGE NoImplicitPrelude #-}
3{-# LANGUAGE NoImplicitPrelude #-}
@@ -59,45 +58,6 @@ data ParseFailedException = ParseFailedException TypeRep Text
59 deriving (Show, Typeable)
58 deriving (Show, Typeable)
60instance Exception ParseFailedException
59instance Exception ParseFailedException
61
60
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−
101newtype Maintainer = Maintainer { unMaintainer :: Text }
61newtype Maintainer = Maintainer { unMaintainer :: Text }
102 deriving (Show, Eq, Ord, Hashable, ToJSON, FromJSON, IsString)
62 deriving (Show, Eq, Ord, Hashable, ToJSON, FromJSON, IsString)
103
63
stackage.cabal+1
@@ -72,6 +72,7 @@ library
72 , stm
72 , stm
73 , mono-traversable
73 , mono-traversable
74 , async
74 , async
75+ , streaming-commons >= 0.1.7.1
75
76
76executable stackage
77executable stackage
77 default-language: Haskell2010
78 default-language: Haskell2010