* [PATCH] meson: set colorout to auto
@ 2020-08-25 6:43 Gerd Hoffmann
2020-08-25 6:59 ` Marc-André Lureau
2020-08-25 13:26 ` Richard Henderson
0 siblings, 2 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2020-08-25 6:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Dunno why the default is set to "always". IMHO it should be "auto",
i.e. only colorize in case stdout goes to a terminal. Cluttering
logfiles and confusing compiler message parsers with terminal control
sequences is not nice ...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index df5bf728b57a..558e0139768f 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,6 @@
project('qemu', ['c'], meson_version: '>=0.55.0',
- default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11', 'b_lundef=false'],
+ default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11',
+ 'b_lundef=false','b_colorout=auto'],
version: run_command('head', meson.source_root() / 'VERSION').stdout().strip())
not_found = dependency('', required: false)
--
2.27.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] meson: set colorout to auto
2020-08-25 6:43 [PATCH] meson: set colorout to auto Gerd Hoffmann
@ 2020-08-25 6:59 ` Marc-André Lureau
2020-08-25 8:06 ` Gerd Hoffmann
2020-08-25 13:26 ` Richard Henderson
1 sibling, 1 reply; 7+ messages in thread
From: Marc-André Lureau @ 2020-08-25 6:59 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: QEMU
[-- Attachment #1: Type: text/plain, Size: 804 bytes --]
Hi
On Tue, Aug 25, 2020 at 10:44 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
> Dunno why the default is set to "always". IMHO it should be "auto",
> i.e. only colorize in case stdout goes to a terminal. Cluttering
> logfiles and confusing compiler message parsers with terminal control
> sequences is not nice ...
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>
"Enable colored output with GCC. Ninja redirects stdout/stderr so by
default GCC thinks it is not talking to a terminal"
https://github.com/mesonbuild/meson/commit/4f63fe498314c385de2d3b6a3a953d15985914d2
Since we use make, I don't know if it's any better.
Perhaps meson should set compiler/tools colors = always/never based on what
it is connected to at configure time instead?
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 1451 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] meson: set colorout to auto
2020-08-25 6:59 ` Marc-André Lureau
@ 2020-08-25 8:06 ` Gerd Hoffmann
2020-08-25 8:11 ` Marc-André Lureau
0 siblings, 1 reply; 7+ messages in thread
From: Gerd Hoffmann @ 2020-08-25 8:06 UTC (permalink / raw)
To: Marc-André Lureau; +Cc: QEMU
On Tue, Aug 25, 2020 at 10:59:42AM +0400, Marc-André Lureau wrote:
> Hi
>
> On Tue, Aug 25, 2020 at 10:44 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> > Dunno why the default is set to "always". IMHO it should be "auto",
> > i.e. only colorize in case stdout goes to a terminal. Cluttering
> > logfiles and confusing compiler message parsers with terminal control
> > sequences is not nice ...
> >
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> >
>
> "Enable colored output with GCC. Ninja redirects stdout/stderr so by
> default GCC thinks it is not talking to a terminal"
>
> https://github.com/mesonbuild/meson/commit/4f63fe498314c385de2d3b6a3a953d15985914d2
Hmm, maybe ninja handles this then, by stripping the terminal sequences
in case stdout isn't a terminal.
With ninja being the default backend the default kind-of makes sense
(for meson upstream) ...
> Since we use make, I don't know if it's any better.
... but given qemu uses make not ninja we might prefer something else ;)
As far I know make doesn't redirect output. Or maybe it redirects using
a pty (instead of a pipe) in case stdout is a terminal. At least auto
mode for colored gcc warnings works fine with make. It is colored when
started in a terminal, it isn't when started in emacs (and piped through
the emacs message parser).
> Perhaps meson should set compiler/tools colors = always/never based on what
> it is connected to at configure time instead?
Why? Even when running configure in a terminal I might use emacs for
builds later on.
take care,
Gerd
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] meson: set colorout to auto
2020-08-25 8:06 ` Gerd Hoffmann
@ 2020-08-25 8:11 ` Marc-André Lureau
2020-08-30 9:37 ` Paolo Bonzini
0 siblings, 1 reply; 7+ messages in thread
From: Marc-André Lureau @ 2020-08-25 8:11 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Paolo Bonzini, QEMU
[-- Attachment #1: Type: text/plain, Size: 1969 bytes --]
Hi
On Tue, Aug 25, 2020 at 12:07 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
> On Tue, Aug 25, 2020 at 10:59:42AM +0400, Marc-André Lureau wrote:
> > Hi
> >
> > On Tue, Aug 25, 2020 at 10:44 AM Gerd Hoffmann <kraxel@redhat.com>
> wrote:
> >
> > > Dunno why the default is set to "always". IMHO it should be "auto",
> > > i.e. only colorize in case stdout goes to a terminal. Cluttering
> > > logfiles and confusing compiler message parsers with terminal control
> > > sequences is not nice ...
> > >
> > > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > >
> >
> > "Enable colored output with GCC. Ninja redirects stdout/stderr so by
> > default GCC thinks it is not talking to a terminal"
> >
> >
> https://github.com/mesonbuild/meson/commit/4f63fe498314c385de2d3b6a3a953d15985914d2
>
> Hmm, maybe ninja handles this then, by stripping the terminal sequences
> in case stdout isn't a terminal.
>
> With ninja being the default backend the default kind-of makes sense
> (for meson upstream) ...
>
> > Since we use make, I don't know if it's any better.
>
> ... but given qemu uses make not ninja we might prefer something else ;)
>
> As far I know make doesn't redirect output. Or maybe it redirects using
> a pty (instead of a pipe) in case stdout is a terminal. At least auto
> mode for colored gcc warnings works fine with make. It is colored when
> started in a terminal, it isn't when started in emacs (and piped through
> the emacs message parser).
>
>
Then it looks like you have a legit patch. We can revert it when we switch
back to ninja some day.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Perhaps meson should set compiler/tools colors = always/never based on
> what
> > it is connected to at configure time instead?
>
> Why? Even when running configure in a terminal I might use emacs for
> builds later on.
>
> take care,
> Gerd
>
>
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 3055 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] meson: set colorout to auto
2020-08-25 6:43 [PATCH] meson: set colorout to auto Gerd Hoffmann
2020-08-25 6:59 ` Marc-André Lureau
@ 2020-08-25 13:26 ` Richard Henderson
2020-08-26 5:05 ` Gerd Hoffmann
1 sibling, 1 reply; 7+ messages in thread
From: Richard Henderson @ 2020-08-25 13:26 UTC (permalink / raw)
To: Gerd Hoffmann, qemu-devel
On 8/24/20 11:43 PM, Gerd Hoffmann wrote:
> Dunno why the default is set to "always". IMHO it should be "auto",
> i.e. only colorize in case stdout goes to a terminal. Cluttering
> logfiles and confusing compiler message parsers with terminal control
> sequences is not nice ...
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> meson.build | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Yes please. All the color escape codes has broken emacs make next-error.
Although applying this doesn't seem to have helped...
r~
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] meson: set colorout to auto
2020-08-25 13:26 ` Richard Henderson
@ 2020-08-26 5:05 ` Gerd Hoffmann
0 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2020-08-26 5:05 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel
On Tue, Aug 25, 2020 at 06:26:33AM -0700, Richard Henderson wrote:
> On 8/24/20 11:43 PM, Gerd Hoffmann wrote:
> > Dunno why the default is set to "always". IMHO it should be "auto",
> > i.e. only colorize in case stdout goes to a terminal. Cluttering
> > logfiles and confusing compiler message parsers with terminal control
> > sequences is not nice ...
> >
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> > meson.build | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Yes please. All the color escape codes has broken emacs make next-error.
>
> Although applying this doesn't seem to have helped...
meson remembers the state of the options, so running a build alone
doesn't help. rm -rf $builddir and starting over will pick up the
new default. You can probably also use "meson configure $something".
HTH,
Gerd
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] meson: set colorout to auto
2020-08-25 8:11 ` Marc-André Lureau
@ 2020-08-30 9:37 ` Paolo Bonzini
0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2020-08-30 9:37 UTC (permalink / raw)
To: Marc-André Lureau, Gerd Hoffmann; +Cc: QEMU
On 25/08/20 10:11, Marc-André Lureau wrote:
>
> As far I know make doesn't redirect output. Or maybe it redirects using
> a pty (instead of a pipe) in case stdout is a terminal. At least auto
> mode for colored gcc warnings works fine with make. It is colored when
> started in a terminal, it isn't when started in emacs (and piped through
> the emacs message parser).
>
> Then it looks like you have a legit patch. We can revert it when we
> switch back to ninja some day.
>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com
> <mailto:marcandre.lureau@redhat.com>>
>
make has the same issue if you use -O/--output-sync. Programs are
supposed to check MAKE_TERMOUT and MAKE_TERMERR to decide whether to
colorize output, but I think pretty much no one does?
In any case this would not be a new issue, so b_colorout=auto is
preferrable.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-08-30 9:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 6:43 [PATCH] meson: set colorout to auto Gerd Hoffmann
2020-08-25 6:59 ` Marc-André Lureau
2020-08-25 8:06 ` Gerd Hoffmann
2020-08-25 8:11 ` Marc-André Lureau
2020-08-30 9:37 ` Paolo Bonzini
2020-08-25 13:26 ` Richard Henderson
2020-08-26 5:05 ` Gerd Hoffmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.