[Scons-users] coloring compoiler / linker output

Kenny, Jason L jason.l.kenny at intel.com
Wed Sep 3 09:13:52 EDT 2014


Technically Parts replaces the SPAWN call as well. It provides some options for logging of that data as well as control over what colors are used.

This process is the only  known way at the moment to color the data at the moment in SCons across all the output.

Jason

From: Scons-users [mailto:scons-users-bounces at scons.org] On Behalf Of Nick Hilton via Scons-users
Sent: Sunday, August 31, 2014 2:23 PM
To: scons-users at scons.org
Subject: Re: [Scons-users] coloring compoiler / linker output

Hi,

The only workable technique that I know of is replacing env['SPAWN'] with your own wrapper that spawns the command in subprocess and you capture stdout & stderr through pipes.  Then you can process the output and write the special terminal codes to get colored output.

To see an example of a env['SPAWN'] replacement look at the file 'builder_support.py' on this scons issue:

http://scons.tigris.org/issues/show_bug.cgi?id=2974

It filters out the extra output from visual studio's cl.exe compiler.  But using env['SPAWN'] will break the build if the command line gets too long.

I've used colorama successfully in the project at work, until the command line gets too long.  Issue 2974 is to fix the problem and perhaps provide us an easier way to customize the builder output.

:)
Nick


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140903/1336089a/attachment.html>


More information about the Scons-users mailing list