[ccache] Support for color diagnostics

Lubos Lunak l.lunak at centrum.cz
Wed Dec 4 06:24:48 MST 2013


On Saturday 30 of November 2013, Loïc Yhuel wrote:
> Le 30/11/2013 11:07, Lubos Lunak a écrit :
> > On Saturday 30 of November 2013, Loïc Yhuel wrote:
> >> Le 29/11/2013 14:08, Lubos Lunak a écrit :
> >>> On Friday 29 of November 2013, Lubos Lunak wrote:
> >>>>    Hello,
> >>>>
> >>>>    the attached patch adds ccache support for compiler color
> >>>> diagnostics (also reported by somebody as #10075).
> >
> > ...
> >
> >> I think you didn't understand GCC documentation correctly.
> >
> >   Actually I think I did. I've now tried with a chroot (openSUSE build
> > service really is a useful tool) and it pretty much matches my
> > understanding of the documentation.
> >
> >>   From the man page : "The default GCC_COLORS is ... Setting GCC_COLORS
> >> to the empty string disables colors."
> >> GCC enable colors when GCC_COLORS is not set, and your code doesn't.
> >
> >   From the man page: "The default is ‘never’ if GCC_COLORS environment
> > variable isn't present in the environment".
> >
> >> In fact you don't have to test GCC_COLORS at all : when it's an empty
> >> string (not unset !), colors are disabled , and adding
> >> -fdiagnostics-color doesn't change anything.
> >
> >   The patch does not add -fdiagnostics-color when GCC_COLORS is empty.
>
> Sorry, I didn't check : the default is auto on Fedora, and not upstream...
> That's why we don't see the same behavior.
> http://pkgs.fedoraproject.org/cgit/gcc.git/tree/gcc48-color-auto.patch

 I see. But given that this autodetection requires a terminal as the output, I 
don't see any possible way of detecting this.

-- 
 Lubos Lunak


More information about the ccache mailing list