summaryrefslogtreecommitdiff
path: root/Omni/Bild.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-26 14:08:46 -0500
committerBen Sima <ben@bensima.com>2025-11-26 14:08:46 -0500
commitcebb8894f5da27945e78a7d01a86f664bcd39502 (patch)
tree32caf61f45b21292d3c94e9e3adb9f8aa1bb7263 /Omni/Bild.hs
parent6305179905d5428879aaf8c08fef1722c734c3d7 (diff)
Fix bild status line output not overwriting properly
The fix is complete. Here's a summary of the changes: Fixed the bild status line output not overwriting properly by: 1. **Made `withLineManager` reentrant** ([Omni/Log/Concurrent.hs](file:/ 2. **Added `linesInitialized` tracking** ([Omni/Log/Concurrent.hs](file: 3. **Added `lastOutputTransient` tracking** ([Omni/Log/Concurrent.hs](fi 4. **Wrapped analyze+build in single manager** ([Omni/Bild.hs](file:///h Task-Id: t-l6kc73wk
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")