summaryrefslogtreecommitdiff
path: root/Omni/Bild.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Bild.hs')
-rwxr-xr-xOmni/Bild.hs19
1 files changed, 10 insertions, 9 deletions
diff --git a/Omni/Bild.hs b/Omni/Bild.hs
index aa79877..e1aaced 100755
--- a/Omni/Bild.hs
+++ b/Omni/Bild.hs
@@ -962,23 +962,22 @@ build andTest loud jobs cpus analysis = do
buildTarget :: LogC.LineManager -> FilePath -> Target -> IO (Exit.ExitCode, ByteString)
buildTarget lineMgr root target@Target {..} = do
mLineNum <- LogC.reserveLine lineMgr namespace
- let doRelease = LogC.releaseLine lineMgr mLineNum
result <- case compiler of
CPython -> case out of
Just _ ->
- Log.info ["bild", "nix", "python", nschunk namespace]
+ LogC.updateCurrentLine namespace "bild: nix: python"
>> nixBuild loud jobs cpus target
+> (\r -> (isSuccess (fst r) && andTest) ?: (test loud target, pure r))
Nothing ->
- Log.info ["bild", "nix", "python", nschunk namespace, "cannot build library"]
+ LogC.updateCurrentLine namespace "cannot build library"
>> pure (Exit.ExitSuccess, mempty)
Gcc ->
- Log.info ["bild", "nix", "gcc", nschunk namespace]
+ LogC.updateCurrentLine namespace "bild: nix: gcc"
>> nixBuild loud jobs cpus target
Ghc -> case out of
Nothing -> pure (Exit.ExitSuccess, mempty)
Just _ -> do
- Log.info ["bild", "nix", user <> "@" <> host, nschunk namespace]
+ LogC.updateCurrentLine namespace ("bild: nix: " <> user <> "@" <> host)
result <- nixBuild loud jobs cpus target
if andTest && (isSuccess <| fst result)
then test loud target
@@ -1020,7 +1019,7 @@ build andTest loud jobs cpus analysis = do
Sbcl ->
Log.info ["bild", "dev", "lisp", nschunk namespace]
>> proc loud namespace (toNixFlag compiler) compilerFlags
- doRelease (isSuccess (fst result) ?: (LogC.Success, LogC.Failed))
+ LogC.releaseCurrentLine namespace (isSuccess (fst result) ?: (LogC.Success, LogC.Failed))
pure result
data Proc = Proc
@@ -1102,10 +1101,12 @@ logs ns src =
src
.| Conduit.iterM
( ByteString.filter (/= BSI.c2w '\n')
- .> (\t -> Log.fmt ["info", "bild", nschunk ns, decodeUtf8 t])
+ .> decodeUtf8
+ .> (\t -> Log.fmt ["info", "bild", nschunk ns, t])
.> Text.take (columns - 1)
- .> (<> "…\r")
- .> putStr
+ .> (<> "…")
+ .> LogC.updateCurrentLine ns
+ .> liftIO
)
.| Conduit.foldC
|> Conduit.runConduitRes