Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Dec 2011 12:03:17 +0700
From:      Max Khon <fjoe@FreeBSD.org>
To:        Alexander Best <arundel@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r228157 - head/usr.bin/make
Message-ID:  <CADe0-4keJ=DAUGx_FEqpFinyZUC-VdBkquMLW0wDmFHiW9erbw@mail.gmail.com>
In-Reply-To: <CADe0-4=izivfmpC_w%2BahNRNrqv%2B3rwRiEbX4wEr8FaBB0q-N5A@mail.gmail.com>
References:  <201111301807.pAUI7cXI008371@svn.freebsd.org> <20111201001646.GA49249@freebsd.org> <CADe0-4=izivfmpC_w%2BahNRNrqv%2B3rwRiEbX4wEr8FaBB0q-N5A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--f46d0447f0d8471cbd04b300c5b1
Content-Type: text/plain; charset=ISO-8859-1

Alexander,

On Thu, Dec 1, 2011 at 11:05 AM, Max Khon <fjoe@freebsd.org> 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
UwogCkluZGV4OiB1c3IuYmluL21ha2Uvam9iLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gdXNyLmJpbi9tYWtl
L2pvYi5jCShyZXZpc2lvbiAyMjgxNTcpCisrKyB1c3IuYmluL21ha2Uvam9iLmMJKHdvcmtpbmcg
Y29weSkKQEAgLTExNSw2ICsxMTUsNyBAQAogI2luY2x1ZGUgPGZjbnRsLmg+CiAjaW5jbHVkZSA8
aW50dHlwZXMuaD4KICNpbmNsdWRlIDxsaW1pdHMuaD4KKyNpbmNsdWRlIDxsaWJ1dGlsLmg+CiAj
aW5jbHVkZSA8cGF0aHMuaD4KICNpbmNsdWRlIDxzdHJpbmcuaD4KICNpbmNsdWRlIDxzaWduYWwu
aD4KQEAgLTE3OTgsOCArMTc5OSwxMyBAQAogCQlpZiAodXNlUGlwZXMpIHsKIAkJCWludCBmZFsy
XTsKIAotCQkJaWYgKHBpcGUoZmQpID09IC0xKQotCQkJCVB1bnQoIkNhbm5vdCBjcmVhdGUgcGlw
ZTogJXMiLCBzdHJlcnJvcihlcnJubykpOworCQkJaWYgKGlzYXR0eSgxKSkgeworCQkJCWlmIChv
cGVucHR5KGZkLCBmZCArIDEsIE5VTEwsIE5VTEwsIE5VTEwpID09IC0xKQorCQkJCQlQdW50KCJD
YW5ub3Qgb3BlbiBwdHk6ICVzIiwgc3RyZXJyb3IoZXJybm8pKTsKKwkJCX0gZWxzZSB7CisJCQkJ
aWYgKHBpcGUoZmQpID09IC0xKQorCQkJCQlQdW50KCJDYW5ub3QgY3JlYXRlIHBpcGU6ICVzIiwg
c3RyZXJyb3IoZXJybm8pKTsKKwkJCX0KIAkJCWpvYi0+aW5QaXBlID0gZmRbMF07CiAJCQlqb2It
Pm91dFBpcGUgPSBmZFsxXTsKIAkJCWZjbnRsKGpvYi0+aW5QaXBlLCBGX1NFVEZELCAxKTsK
--f46d0447f0d8471cbd04b300c5b1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADe0-4keJ=DAUGx_FEqpFinyZUC-VdBkquMLW0wDmFHiW9erbw>