From cebb8894f5da27945e78a7d01a86f664bcd39502 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 26 Nov 2025 14:08:46 -0500 Subject: 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 --- Omni/Bild.hs | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'Omni/Bild.hs') 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") -- cgit v1.2.3