summaryrefslogtreecommitdiff
path: root/Omni/Bild.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-11-15 09:03:21 -0500
committerBen Sima <ben@bsima.me>2025-11-15 09:03:21 -0500
commite8ff5ae65312229c67a6deb9235ce935709ae173 (patch)
tree758e86a64c0a7486c299ad07efd8a350c2168e03 /Omni/Bild.hs
parent335a1a4692dc921d6b0b6fab0e93c30063b622d5 (diff)
refactor(bild): simplify terminal output - use --loud flag
- Remove BILD_OUTPUT_MODE environment variable - Simplify to 2 modes: MultiLine (≥80 cols) and SingleLine (<80) - Use existing --loud flag to disable concurrent UI entirely - When --loud: show all compiler output line-by-line (for debugging) - When not --loud: adaptive concurrent UI based on terminal width This is simpler and uses the existing --loud flag instead of adding new configuration. The --loud flag was already meant for debugging, so it makes sense to use it to show all output. Note: Omni/Bild.nix updated to include new Omni/Log/Terminal.hs module. Blocked by: stdin bug (see _/llm/STDIN_BUG.md) - cannot test build yet.
Diffstat (limited to 'Omni/Bild.hs')
-rw-r--r--Omni/Bild.hs22
1 files changed, 15 insertions, 7 deletions
diff --git a/Omni/Bild.hs b/Omni/Bild.hs
index 15e359f..4bb62a5 100644
--- a/Omni/Bild.hs
+++ b/Omni/Bild.hs
@@ -555,11 +555,11 @@ analyzeAll :: [Namespace] -> IO Analysis
analyzeAll nss = do
LogC.withLineManager nss <| \lineMgr -> do
LogC.initializeLines lineMgr
- targets <- mapConcurrentlyBounded 8 (analyzeOne lineMgr) nss
+ targets <- mapConcurrentlyBounded 8 analyzeOne nss
pure <| Map.fromList <| catMaybes <| zipWith (\ns mt -> (ns,) </ mt) nss targets
where
- analyzeOne :: LogC.LineManager -> Namespace -> IO (Maybe Target)
- analyzeOne _lineMgr namespace@(Namespace parts ext) = do
+ analyzeOne :: Namespace -> IO (Maybe Target)
+ analyzeOne namespace@(Namespace parts ext) = do
let path = Namespace.toPath namespace
root <- Env.getEnv "CODEROOT"
let abspath = root </> path
@@ -1147,10 +1147,18 @@ build andTest loud jobs cpus analysis = do
root <- Env.getEnv "CODEROOT"
let targets = Map.elems analysis
let namespaces = map (\Target {..} -> namespace) targets
- LogC.withLineManager namespaces <| \lineMgr -> do
- LogC.initializeLines lineMgr
- results <- mapConcurrentlyBounded jobs (buildTarget root) targets
- pure (map fst results)
+ -- Use adaptive concurrent UI unless --loud is set
+ if loud
+ then do
+ -- Loud mode: simple output, no concurrent UI
+ results <- mapConcurrentlyBounded jobs (buildTarget root) targets
+ pure (map fst results)
+ else -- Adaptive UI based on terminal width
+
+ LogC.withLineManager namespaces <| \lineMgr -> do
+ LogC.initializeLines lineMgr
+ results <- mapConcurrentlyBounded jobs (buildTarget root) targets
+ pure (map fst results)
where
buildTarget :: FilePath -> Target -> IO (Exit.ExitCode, ByteString)
buildTarget root target@Target {..} = do