Opened 13 years ago

Last modified 3 years ago

#3508 new Feature Requests

bjam output in colours

Reported by: mloskot <mateusz@…> Owned by: Vladimir Prus
Milestone: Boost 1.47.0 Component: build
Version: Boost Development Trunk Severity: Cosmetic
Keywords: coloring, output, colormake, colorgcc Cc: jan, boehme@…, flast@…

Description

I think it would be very useful if bjam prints output to stdout in colours to help to distinguish at least information messages, warnings and errors.

CMake does provide coloured output out of the box. For GNU make and GCC there are http://bre.klaki.net/programs/colormake/ colormake] and colorgcc.

All these tools help programmers to avoid nystagmus issues while analysing compiler output :-)

As a proof of concept, I attached colorbb'' script a rough port of the colormake to work with bjam + GCC toolset.

Attachments (2)

colorbb (387 bytes ) - added by mloskot <mateusz@…> 13 years ago.
Wrapper for bjam to colourise it's output and pipe through less
colorbb.pl (4.2 KB ) - added by mloskot <mateusz@…> 13 years ago.
Perl script based on colormake version

Download all attachments as: .zip

Change History (11)

by mloskot <mateusz@…>, 13 years ago

Attachment: colorbb added

Wrapper for bjam to colourise it's output and pipe through less

by mloskot <mateusz@…>, 13 years ago

Attachment: colorbb.pl added

Perl script based on colormake version

comment:1 by Vladimir Prus, 13 years ago

This would be nifty. The only issue is detecting if the terminal handles those escape sequences. CMake has cmSystemTools.cxx:MakefileColorEcho, which in turn uses cmsysTerminal_Color_AssumeTTY and cmsysTerminal_cfprintf, but I could not find the definitions of those two.

comment:2 by mloskot <mateusz@…>, 13 years ago

Vladimir, I appreciate you like this idea.

The function is implemented in CMake low-level module cmsys/kwsys.

Next, during building CMake, ./bootstrap step, the kwsys module, so the files above, is used to generate cmsys module and the Termina.h generated from the '"Terminal.h.in renames kwsys prefix to cmksys prefix:

#if !defined(KWSYS_NAMESPACE)
# define kwsys_ns(x) cmsys##x
# define kwsysEXPORT cmsys_EXPORT
#endif

It means, the function cmsysTerminal_cfprintf is in fact function implemented as kwsysTerminal_cfprintf in the Terminal.c file linked above.

Shortly, it is CMake/Source/kwsys what we are looking for.

comment:3 by Vladimir Prus, 13 years ago

Milestone: Boost 1.42.0

Tentatively scheduling for 1.42

comment:4 by Vladimir Prus, 13 years ago

Component: bjambuild
Milestone: Boost 1.42.0Boost 1.43.0
Owner: changed from René Rivera to Vladimir Prus

comment:5 by jan,boehme@…, 12 years ago

Cc: jan boehme@… added
Keywords: coloring output added
Milestone: Boost 1.43.0Boost 1.47.0

What about this very nice feature?

I'd like to see the target information colored too. Maybe a environment variable B(OOST)B(UILD)_COLORS to define the colors handy.

Let me know if I can be of any support here.

comment:6 by Mateusz Loskot, 11 years ago

I posted some ideas about implementation of ECHO rule output in colours to Boost.Build ml

comment:7 by Kohei Takahashi <flast@…>, 10 years ago

Cc: flast@… added

comment:8 by Mateusz Loskot, 9 years ago

FYI, I have replace the idea of output colouring with a more feature-rich integration of Boost.Build with an IDE, so I went for Boost.Build Plugin for Qt Creator. Testers and contributors welcome!

comment:9 by Mateusz Loskot, 3 years ago

For records, I added an experimental support for colorful output to echo rule and actions in https://github.com/boostorg/build/pull/573

Note: See TracTickets for help on using tickets.