From owner-svn-src-head@FreeBSD.ORG Thu Dec 1 05:03:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ADA31067726; Thu, 1 Dec 2011 05:03:19 +0000 (UTC) (envelope-from fjoe@samodelkin.net) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id BD8F08FC12; Thu, 1 Dec 2011 05:03:18 +0000 (UTC) Received: by ghbg20 with SMTP id g20so2244552ghb.13 for ; Wed, 30 Nov 2011 21:03:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.16.101 with SMTP id f5mr1124520obd.33.1322715797986; Wed, 30 Nov 2011 21:03:17 -0800 (PST) Sender: fjoe@samodelkin.net Received: by 10.182.76.225 with HTTP; Wed, 30 Nov 2011 21:03:17 -0800 (PST) X-Originating-IP: [93.92.220.178] In-Reply-To: References: <201111301807.pAUI7cXI008371@svn.freebsd.org> <20111201001646.GA49249@freebsd.org> Date: Thu, 1 Dec 2011 12:03:17 +0700 X-Google-Sender-Auth: xox-i-QLNFDT1wKc_fE0bRlO5GA Message-ID: From: Max Khon To: Alexander Best Content-Type: multipart/mixed; boundary=f46d0447f0d8471cbd04b300c5b1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228157 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 05:03:19 -0000 --f46d0447f0d8471cbd04b300c5b1 Content-Type: text/plain; charset=ISO-8859-1 Alexander, On Thu, Dec 1, 2011 at 11:05 AM, Max Khon wrote: it would also be nice, if at some point, somebody could dive into the code >> to >> see why 'make buildkernel' will let clang produce coloured output, but >> 'make -j(N>1) buildkernel' doesn't (and why adding a -B switch to that >> command >> fixes it). >> > > This one is simple: job make (-jX) runs commands with stdin/stdout/stderr > redirected to pipes. > -B turns on compat mode for job make. > > This can be demonstrated by running make with -jX or -jX -B with the > following Makefile: > --- cut here --- > all: > @if [ -t 1 ]; then echo "stdout is a tty"; else echo "stdout is > not a tty"; fi > --- cut here --- > > If you really want to see colored output in -jX case you should teach > clang to output ANSI color sequences not only in isatty(1) case, but also > when MAKE_JOBS_FIFO environment variable is present (it is set when make > runs in job mode). > This will not work for the cases when make(1) is itself redirected. Something like attached patch should work, but it blocks sometimes in "ttyout" state for some reason (needs more work). Max --f46d0447f0d8471cbd04b300c5b1 Content-Type: text/x-patch; charset=US-ASCII; name="openpty.diff" Content-Disposition: attachment; filename="openpty.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gvnanp4y0 SW5kZXg6IHVzci5iaW4vbWFrZS9NYWtlZmlsZQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSB1c3IuYmluL21ha2Uv TWFrZWZpbGUJKHJldmlzaW9uIDIyODE1NykKKysrIHVzci5iaW4vbWFrZS9NYWtlZmlsZQkod29y a2luZyBjb3B5KQpAQCAtNyw2ICs3LDggQEAKIFNSQ1M9CWFyY2guYyBidWYuYyBjb25kLmMgZGly LmMgZm9yLmMgaGFzaC5jIGhhc2hfdGFibGVzLmMgam9iLmMJXAogCWxzdC5jIG1haW4uYyBtYWtl LmMgcGFyc2UuYyBwcm9jLmMgc2hlbGwuYyBzdHIuYyBzdWZmLmMgdGFyZy5jCVwKIAl1dGlsLmMg dmFyLmMKK0RQQUREPQkke0xJQlVUSUx9CitMREFERD0JLWx1dGlsCiAKIE5PX1NIQVJFRD89CVlF UwogCkluZGV4OiB1c3IuYmluL21ha2Uvam9iLmMKPT09PT09PT09PT09PT09PT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