From owner-freebsd-current@freebsd.org Tue May 16 08:29:25 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D82BED6FB16 for ; Tue, 16 May 2017 08:29:25 +0000 (UTC) (envelope-from dc552@hermes.cam.ac.uk) Received: from ppsw-41.csi.cam.ac.uk (ppsw-41.csi.cam.ac.uk [131.111.8.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 991941789 for ; Tue, 16 May 2017 08:29:25 +0000 (UTC) (envelope-from dc552@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from host109-151-49-114.range109-151.btcentralplus.com ([109.151.49.114]:49903 helo=[192.168.1.65]) by ppsw-41.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:587) with esmtpsa (PLAIN:dc552) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1dAXr9-0003tW-RY (Exim 4.89) (return-path ); Tue, 16 May 2017 09:29:23 +0100 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: build src with colored output? From: David Chisnall In-Reply-To: Date: Tue, 16 May 2017 09:29:25 +0100 Cc: freebsd-current Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Johannes Lundberg X-Mailer: Apple Mail (2.3124) Sender: "Dr D. Chisnall" X-Mailman-Approved-At: Tue, 16 May 2017 11:05:55 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 May 2017 08:29:25 -0000 On 16 May 2017, at 07:42, Johannes Lundberg 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