Repository navigation
Show a build progress spinner - #24261
Closed
HaraldNordgren wants to merge 1 commit into
Closed
HaraldNordgren wants to merge 1 commit into
HaraldNordgren wants to merge 1 commit into
Conversation
- Builds without `--verbose` print nothing while a command runs, so long ones such as `llvm` from source look stuck for hours. - The sandbox already relays the build's pseudo-terminal output, so keep a spinner below that output for the whole build, including startup, checksum checks and unpacking. - Show Ninja (`[12/345]`) or CMake (`[ 42%]`) step progress next to it, read from the newest build log, so `Formula#system` keeps writing straight to the log. - Stop drawing once a Ctrl-C is echoed, as the progress no longer matters while the build is being interrupted.
Member
|
Sorry, passing on this. Building from source is not a supported user configuration and don't want to add dedicated code here when we already have e.g. |
Contributor
Author
|
@MikeMcQuaid Fair enough. |
This was referenced Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without
--verbose, build commands only write to their logs, sobrewshows nothing while they run. A long build such asllvmprints==> cmake --build buildand then nothing for a long time, so it looks stuck. Unpacking a large source tarball and configure steps can be silent for a while too. The only way to tell it is still working is to find andtailthe logs in~/Library/Logs/Homebrew/<formula>.This keeps a spinner below the build output for the whole build, so it never looks stuck. During a step without progress markers, e.g. CMake's configure step:
And when the current command prints Ninja (
[12/345]) or CMake ([ 42%]) progress markers:Sandboxed builds already run in a pseudo-terminal whose output the parent
brewprocess relays inSandbox#copy_pty_output. For builds,BuildProgress#forwardtakes over that relay: it clears the status line before each chunk of output and redraws it afterwards, so the==>lines,patchoutput and warnings always print above it. It reuses the download queue's spinner.The step progress is read from the tail of the newest log in
formula.logs, soFormula#systemis unchanged and build commands still write straight to their logs. Compiler wrapper (*.cc.log) and sandbox logs are skipped, as are logs from before the build started.While a build runs, Ctrl-C goes to the build's pseudo-terminal rather than to
brew, so the parent only sees the^Cit echoes. Once that appears the status line stops being drawn, as the progress no longer matters while the build is being interrupted.Nothing changes with
--verbose,--debugor--interactive, when output isn't a terminal orTERM=dumb, or for builds that don't run in the sandbox.To see it, build any formula from source that uses CMake or Ninja, e.g.
brew install --build-from-source llvm.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Code (Claude Opus 5.5) wrote the change, its tests and this description. Verified with
brew typecheck,brew style, the affected specs and a source build ofllvmon macOS 12 for the examples above.