Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 May 2017 09:29:25 +0100
From:      David Chisnall <David.Chisnall@cl.cam.ac.uk>
To:        Johannes Lundberg <johalun0@gmail.com>
Cc:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: build src with colored output?
Message-ID:  <B2120C01-F487-4206-B07C-DF16E525B5CA@cl.cam.ac.uk>
In-Reply-To: <CAECmPwvr31=hjgAgKRT-tgW_KG3xkkXM4TtyW6hDOp_Hi9qftg@mail.gmail.com>
References:  <CAECmPwuxq-pfBEcPvCXRcpJ7jwqMnfiUawribHcW2zdt%2BgoQQw@mail.gmail.com> <CAECmPwvr31=hjgAgKRT-tgW_KG3xkkXM4TtyW6hDOp_Hi9qftg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 16 May 2017, at 07:42, Johannes Lundberg <johalun0@gmail.com> wrote:
>=20
> Gonna answer myself here. Think I found a way.
>=20
> Add CFLAGS=3D-fcolor-diagnostics to env or /etc/src.conf
> Do clean build, that is no -DNO_CLEAN,KERNFAST, etc.
>=20
> Makes it a lot easier to find the errors in a 16 threads build =
output...
>=20
> The mystery still remains though, why is color disabled for parallel
> builds?

It=E2=80=99s disabled for two reasons.  The first is aesthetic - some =
people don=E2=80=99t like coloured output.  I=E2=80=99m not going to =
debate that one.  The other is technical.  Unlike modern build tools, =
such as Ninja, bmake=E2=80=99s 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=E2=80=99d 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B2120C01-F487-4206-B07C-DF16E525B5CA>