Reserve N lines during analysis for N build targets

t-136·WorkTask·
·
·
·Omni/Bild.hs
Created3 months ago·Updated3 months ago

Dependencies

Description

Edit

Problem

When building multiple targets like bild Omni/Bild/Example*, only one line is reserved during the analysis step. Expected: N lines for N targets.

Root Cause

This is related to the issue in t-l6kc73wk (bild status line output not overwriting). The problem is that analyzeAll and build create SEPARATE LineManagers:

1. analyzeAll (Omni/Bild.hs:571) creates LineManager with nss (N namespaces) 2. LineManager exits, cleanup happens 3. build (Omni/Bild.hs:1167) creates NEW LineManager

During analysis, withLineManager DOES reserve N lines (line 90-92 in Concurrent.hs):

let numLines = min (length nss) (tiHeight termInfo - 2)
replicateM_ numLines (IO.hPutStrLn IO.stderr "")

But because two separate managers are created, the first one's reserved lines get lost when it exits.

Solution

This is part of the fix for t-l6kc73wk. The solution is to have a SINGLE LineManager span both analyze and build phases:

1. In move function (Omni/Bild.hs), create one LineManager before calling analyzeAll 2. Pass the LineManager (or a flag) to both analyzeAll and build 3. Only cleanup the LineManager after build completes

Implementation Plan

1. Refactor move to wrap both analyzeAll and build in a single withLineManager 2. Modify analyzeAll to accept an optional existing LineManager 3. Modify build to accept an optional existing LineManager 4. When LineManager is provided, don't create a new one (reuse existing)

Files to Modify

  • Omni/Bild.hs - move, analyzeAll, build functions
  • Omni/Log/Concurrent.hs - possibly add API for reusing managers

Related

  • Parent issue: t-l6kc73wk (Fix bild status line output not overwriting properly)

Timeline (0)

No activity yet.