Re: build src with colored output?

From: David Chisnall <David.Chisnall_at_cl.cam.ac.uk>
Date: Tue, 16 May 2017 09:29:25 +0100
On 16 May 2017, at 07:42, Johannes Lundberg <johalun0_at_gmail.com> wrote:
> 
> Gonna answer myself here. Think I found a way.
> 
> Add CFLAGS=-fcolor-diagnostics to env or /etc/src.conf
> Do clean build, that is no -DNO_CLEAN,KERNFAST, etc.
> 
> Makes it a lot easier to find the errors in a 16 threads build output...
> 
> The mystery still remains though, why is color disabled for parallel
> builds?

It’s disabled for two reasons.  The first is aesthetic - some people don’t like coloured output.  I’m not going to debate that one.  The other is technical.  Unlike modern build tools, such as Ninja, bmake’s handling of multithreaded output is very bad.  It simply allows each task the same output device, whereas ninja gives each parallel job a pipe back to the build process and then merges the output itself.  This means that you periodically encounter the case where one child process has sent a colour escape sequence to the output and then another process sends the next line, giving weird visual effects and reducing the utility of colour outputs.

Ideally, we’d solve this by fixing bmake to behave more like a modern build tool and:

 - Giving each sub-process its own pipe.
 - Emitting the full compile command for all failed tasks.
 - Displaying only a summary for successful commands

Or we could find someone with the time to spend giving FreeBSD a modern build system, which would probably save us 1-2 man years of developer time each year overall.

David
Received on Tue May 16 2017 - 06:29:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:11 UTC