mirror of
https://github.com/lima-vm/lima.git
synced 2026-10-28 11:44:35 +08:00
Pre-compute the total number of requirement steps (essential + optional + guest-agent wait + final) and thread a shared counter through waitForRequirements so each progress line is prefixed with (N/total). Progress is emitted as a structured RequirementProgress event so the limactl-side event watcher can render it two ways: * TTY: each step occupies a single line that flips from 🕐 to ✅ in place when it completes. * Non-TTY (piped output, log files, CI): two regular log lines per step, matching the previous behaviour. Built-in requirement descriptions are reworded so they read naturally in the new form (e.g. systemd must be available -> systemd is available). capitalizeFirst is kept so user-supplied probe descriptions render uniformly with the built-in ones, and is rune-safe. Fix replaying of RequirementProgress events: the progress field was kept on currentStatus after emit, so every subsequent unrelated event (port-forward, vsock, cloud-init) carried the previous RequirementProgress along and the limactl-side renderer re-emitted the pending line for each one. Clear the transient field from the cached status inside emitEvent so only the event that explicitly carries it renders. Add a defensive dedup in renderRequirementProgress keyed on step/total:done so any future re-emit path cannot reintroduce the spam. Reword the built-in descriptions back to the to be form so the pending line reads as a goal, not a premature completion claim. Closes: https://github.com/lima-vm/lima/issues/4553 Signed-off-by: mn-ram <235066282+mn-ram@users.noreply.github.com> Signed-off-by: Ansuman Sahoo <anshumansahoo500@gmail.com>