Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul console output #137

Merged
merged 26 commits into from
Oct 19, 2024
Merged

Overhaul console output #137

merged 26 commits into from
Oct 19, 2024

Conversation

kylewlacy
Copy link
Member

Closes #68 (incidentally)

This PR completely overhauls the console output when Brioche runs builds. Here's a little recording:

Recording of brioche build command output

(For comparison, here's a recording showing the same build running in the current version of Brioche)

I spent a lot of time iterating on the new output, and it has a few little perks I want to highlight:

  • Use color! To me at least, this makes it much easier to scan the output and understand what's going on
  • Update console output to run at 30fps. It was previously running at 10fps, and personally, it "feels" a lot faster even though everything's running at the same speed. (I also experimented with 60fps, but it felt a little too fast... like numbers and figures were changing too rapidly)
  • Use custom format for durations. The new format supports padding, so the width stays consistent (until you get to REALLY long durations). I also took special care so it's not just padded, but so figures stay in the same spot generally (it changes at the 1 minute mark, but stays very consistent otherwise)
  • Keep list of jobs (processes, downloads, etc) to a length of 4 jobs. I tried to make it clever before and expand/contract the list over time, but the new behavior just looks a lot better
  • Overhaul how process outputs are recorded with a new JobOutputContents type. Basically, we keep a buffer that can hold up to 1 MB of output, with special care for partially-written lines (e.g. unbuffered output)
    • We were previously using a whole terminal emulator, but since we were stripping ANSI colors anyway, this ended up not giving us any value. The new one is a bit "dumber", but works for our use-case better
  • Update process output with a consistent gutter showing the process ID. The gutter is also color-coded, corresponding with the process ID color in the job list
  • Show a little message if a process spends more than 1s "preparing" or "finalizing". Basically, this is time we either spend writing inputs needed by the process, or saving outputs from the process
  • Show progress bars when downloading / unarchiving / fetching from the registry

Also, I spent some time bringing over some of these changes to the "plain" output format too, where it made sense to do so. Internally, the biggest change to the "plain" format, where we can now reuse the new JobOutputContents type to handle partially-written lines (whereas it was entirely separate from the superconsole-based output)

@kylewlacy kylewlacy merged commit d7c4752 into main Oct 19, 2024
5 checks passed
@kylewlacy kylewlacy deleted the improve-reporter branch October 19, 2024 06:08
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.

Fix terminal output getting cut-off by one character
1 participant