Skip to content

install.sh: draw a real progress bar during the build steps - #192

Closed
mmelnich wants to merge 1 commit into
randblas-install-docsfrom
randblas-install-progress
Closed

install.sh: draw a real progress bar during the build steps#192
mmelnich wants to merge 1 commit into
randblas-install-docsfrom
randblas-install-progress

Conversation

@mmelnich

Copy link
Copy Markdown
Contributor

What this adds

A determinate progress bar during the three long build steps, with three rendering tiers chosen by probing the terminal.

Tier Condition Output
2 terminal, colour allowed, UTF-8 locale bar redrawn in place, /
1 terminal, but NO_COLOR, TERM=dumb, or a non-UTF-8 locale same bar, #/-
0 not a terminal one line per step, no escapes, no carriage returns

Tier 0 is a requirement, not a fallback. Redirected output becomes install.log, CI transcripts and bug reports, and control characters make all three unreadable. run_build_step falls straight through to the existing run_step there, so redirected bytes are identical to before this change — and the install-script workflow already asserts that redirected output contains no escape sequence and no carriage return, so this cannot regress silently.

The bar is determinate. Both build tools already report progress on the stream being captured anyway — Ninja writes [12/34], Make writes [ 42%] — so it tracks real work rather than elapsed time. Steps with no parseable progress (clone, configure, verify) keep their existing one-line form rather than growing a bar that means nothing.

Verification

  • Redirected: byte-identical to the previous output, and escape-free.
  • Under a pty: the bar advances through 5%, 20%, 49% during the RandBLAS build, and every step resolves to a done line.

Notes for reviewers

Three rendering tiers, chosen by probing the terminal:

  2  a terminal with colour and UTF-8: a bar redrawn in place, block glyphs
  1  a terminal without one of those: the same bar in ASCII
  0  not a terminal: one line per step, no escapes, no carriage returns

Tier 0 is a requirement rather than a fallback. Redirected output becomes
install.log, CI transcripts and bug reports, and control characters make all
three unreadable, so run_build_step falls straight through to run_step there
and the bytes are identical to before this change. CI already asserts that
redirected output contains no escape sequence and no carriage return.

The bar is determinate. Both build tools already report progress on the
stream being captured anyway -- Ninja writes "[12/34]" and Make writes
"[ 42%]" -- so it tracks real work rather than elapsed time. A spinner would
have conveyed nothing. Steps with no parseable progress keep their existing
one-line form rather than growing a fake bar.

Implementation note: the parsing loop necessarily runs in a subshell, so the
build command's exit status is passed back through a file rather than a
variable, and checked explicitly.

Verified: redirected output byte-identical and escape-free; under a pty the
bar advances through 5%, 20%, 49% during the RandBLAS build and each step
resolves to a "done" line.
@rileyjmurray
rileyjmurray force-pushed the randblas-install-progress branch from 9c41218 to 417f33e Compare August 13, 2026 17:11
@mmelnich

Copy link
Copy Markdown
Contributor Author

Folded into #187 at Riley's request ("please combine PRs 187, 190, and 191 — they have no business landing separately"). The commit is unchanged, now sitting on randblas-install-sh alongside the rest of the installer work. Nothing was dropped: the consolidated branch's tree is byte-identical to the state that was tested and green here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant