From e8ff5ae65312229c67a6deb9235ce935709ae173 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 15 Nov 2025 09:03:21 -0500 Subject: refactor(bild): simplify terminal output - use --loud flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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. --- Omni/Bild.hs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'Omni/Bild.hs') 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,) 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 -- cgit v1.2.3