Commit 7f331525 authored by parcs's avatar parcs

Buffer stdout and stderr when we're compiling via GHCi

parent 997a8ecd
......@@ -1315,9 +1315,18 @@ doLoad retain_context howmuch = do
-- turn off breakpoints before we load: we can't turn them off later, because
-- the ModBreaks will have gone away.
lift discardActiveBreakPoints
ok <- trySuccess $ GHC.load howmuch
afterLoad ok retain_context
return ok
-- Enable buffering stdout and stderr as we're compiling. Keeping these
-- handles unbuffered will just slow the compilation down, especially when
-- compiling in parallel.
gbracket (liftIO $ do hSetBuffering stdout LineBuffering
hSetBuffering stderr LineBuffering)
(\_ ->
liftIO $ do hSetBuffering stdout NoBuffering
hSetBuffering stderr NoBuffering) $ \_ -> do
ok <- trySuccess $ GHC.load howmuch
afterLoad ok retain_context
return ok
afterLoad :: SuccessFlag
......
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