Skip to content

Add colour to Buildbot output #588

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Apr 14, 2025

Like python/cpython#129196, will help us find errors in logs more easily.

@hugovk hugovk marked this pull request as draft April 14, 2025 17:47
@hugovk
Copy link
Member Author

hugovk commented Apr 14, 2025

Set to draft as a demo build shows some colour output but also ANSI codes leaking out:

before: https://buildbot.python.org/#/builders/301/builds/11808/steps/6/logs/stdio
after: https://buildbot.python.org/#/builders/301/builds/11810/steps/6/logs/stdio

@vstinner
Copy link
Member

I'm not convinced by this change. It makes my typical use case more painful: download logs and open them in a text editor (vim). There are now ANSI codes which make the logs harder to read :-(

Set to draft as a demo build shows some colour output but also ANSI codes leaking out:

At the beginning, there are nice colors. At the middle, raw ANSI codes are displayed which makes the output harder to read :-(

Screenshot 2025-04-15 at 10-56-26 Buildbot

Also, if I download the logs and open them my text editor (vim), I also see the raw ANSI codes (not colors).

@hugovk
Copy link
Member Author

hugovk commented Apr 15, 2025

Yeah, it's not ready for merge, it's not meant to switch from colour to ANSI codes mid-way.

Also, if I download the logs and open them my text editor (vim), I also see the raw ANSI codes (not colors).

Hmm, even if we fix the switch, the codes would still be there when downloading logs viewing in a text editor.

This is also the case with GitHub Actions: compare the rendered logs and the raw logs. But I think people rarely look at the raw logs. (I occasionally diff them, but the rendered colour is much more beneficial to me than the codes when diffing.)

If it's more important to keep raw logs more readable than rendered logs for Buildbots, then we can just close this.


btw, is there a way to download the full logs from a Buildbot run (that is, all of "configure", "compile", "test", and so on), rather than just for a single step (for example, just "test")?

@vstinner
Copy link
Member

If it's more important to keep raw logs more readable than rendered logs for Buildbots, then we can just close this.

The problem of buildbots is that the web site is very slow and buggy. Reading logs with an external tool is a workaround for that. It's also easier for me to navigate large logs (2 000 lines or more) with a fast text editor, rather than the slow web site.

btw, is there a way to download the full logs from a Buildbot run (that is, all of "configure", "compile", "test", and so on), rather than just for a single step (for example, just "test")?

I'm not aware of such feature, I always download logs of a single step such as "test".

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.

2 participants