diff options
| author | Ben Sima <ben@bsima.me> | 2025-11-14 16:06:30 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bsima.me> | 2025-11-14 16:06:30 -0500 |
| commit | 77f836754cf63bcd8f44dfbf1f8305277700554c (patch) | |
| tree | 028b4277cafe99f473d6ec6aa97a343e706be6d8 /Omni/Bild.hs | |
| parent | d3acbdec5c04f27d33d7b2023b544a640a611947 (diff) | |
Redesign LineManager to show one line per namespace
- Allocate one line per namespace (not per concurrent job) - Add
Pending state shown as [...] when build hasn't started - Initialize all
namespace lines at start showing [...] - Update to [~] when building,
[✓]/[x] when complete - Each namespace keeps its line throughout
the build - At end, all namespaces show their final status - --jobs
controls concurrency, not line count
Diffstat (limited to 'Omni/Bild.hs')
| -rwxr-xr-x | Omni/Bild.hs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Omni/Bild.hs b/Omni/Bild.hs index 704a47d..90f6cd6 100755 --- a/Omni/Bild.hs +++ b/Omni/Bild.hs @@ -955,13 +955,14 @@ build :: Bool -> Bool -> Int -> Int -> Analysis -> IO [Exit.ExitCode] build andTest loud jobs cpus analysis = do root <- Env.getEnv "CODEROOT" let targets = Map.elems analysis - LogC.withLineManager jobs <| \lineMgr -> do - results <- mapConcurrentlyBounded jobs (buildTarget lineMgr root) targets + let namespaces = map (\Target {..} -> namespace) targets + LogC.withLineManager namespaces <| \lineMgr -> do + LogC.initializeLines lineMgr + results <- mapConcurrentlyBounded jobs (buildTarget root) targets pure (map fst results) where - buildTarget :: LogC.LineManager -> FilePath -> Target -> IO (Exit.ExitCode, ByteString) - buildTarget lineMgr root target@Target {..} = do - _ <- LogC.reserveLine lineMgr namespace + buildTarget :: FilePath -> Target -> IO (Exit.ExitCode, ByteString) + buildTarget root target@Target {..} = do result <- case compiler of CPython -> case out of Just _ -> @@ -1011,7 +1012,7 @@ build andTest loud jobs cpus analysis = do nixBuild loud jobs cpus target Sbcl -> proc loud namespace (toNixFlag compiler) compilerFlags - LogC.releaseCurrentLine namespace (isSuccess (fst result) ?: (LogC.Success, LogC.Failed)) + LogC.updateLineState namespace (isSuccess (fst result) ?: (LogC.Success, LogC.Failed)) pure result data Proc = Proc @@ -1096,7 +1097,7 @@ logs ns src = .> decodeUtf8 .> Text.take (columns - 1) .> (<> "…") - .> LogC.updateCurrentLine ns + .> LogC.updateLine ns .> liftIO ) .| Conduit.foldC |
