summaryrefslogtreecommitdiff
path: root/Omni/Bild.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Bild.hs')
-rw-r--r--Omni/Bild.hs31
1 files changed, 19 insertions, 12 deletions
diff --git a/Omni/Bild.hs b/Omni/Bild.hs
index 8d00936..1bb1c83 100644
--- a/Omni/Bild.hs
+++ b/Omni/Bild.hs
@@ -227,18 +227,25 @@ move args = do
+> traverse (namespaceFromPathOrDie root)
/> filter isBuildableNs
let isPlanMode = args `Cli.has` Cli.longOption "plan"
- analysis <- analyzeAll isPlanMode namespaces
- printOrBuild root analysis
- |> Timeout.timeout (toMillis minutes)
- +> \case
- Nothing ->
- Log.br
- >> Log.fail ["bild", "timeout after " <> tshow minutes <> " minutes"]
- >> Log.br
- >> exitWith (ExitFailure 124)
- Just s -> do
- when (all isSuccess s) saveGhcPkgCache
- exitSummary s
+ -- Wrap entire analyze+build sequence in a single LineManager
+ -- to avoid duplicate status line output
+ let runWithManager action = case (isPlanMode, isLoud) of
+ (True, _) -> action -- Plan mode doesn't need a manager
+ (_, True) -> action -- Loud mode doesn't need a manager
+ _ -> LogC.withLineManager namespaces (const action)
+ runWithManager <| do
+ analysis <- analyzeAll isPlanMode namespaces
+ printOrBuild root analysis
+ |> Timeout.timeout (toMillis minutes)
+ +> \case
+ Nothing ->
+ Log.br
+ >> Log.fail ["bild", "timeout after " <> tshow minutes <> " minutes"]
+ >> Log.br
+ >> exitWith (ExitFailure 124)
+ Just s -> do
+ when (all isSuccess s) saveGhcPkgCache
+ exitSummary s
where
minutes =
Cli.getArgWithDefault args "10" (Cli.longOption "time")