[Scons-users] Eclipse-friendly compile error output

Will Rouesnel w.rouesnel at gmail.com
Fri Aug 22 11:20:52 EDT 2014


Thanks - this is probably the lowest impact build solution. For the time
being I'm going with duplicate=0 since it seems to work but this was
more along the lines of what I was looking for - I'll give it a shot
sometime.

On 22/08/14 22:09, Geza Lore wrote:
>
> Hi,
>
>  
>
> You can filter the compiler output by doing something along these
> lines (I used this for colouring by piping through sed ...):
>
>  
>
>  
>
>  
>
> sedSP = subprocess.Popen([r'sed',
>
>                           r'-e',
> env.subst(r's/.*\(^\|[^=]\b\)Err.*/${RED}${BOLD}&${PLAIN}/i', raw=1),
>
>                           r'-e',
> env.subst(r's/.*\bWarn.*/${YELLOW}${BOLD}&${PLAIN}/i', raw=1)],
>
>                           stdin=subprocess.PIPE)
>
> sys.stdout = sedSP.stdin
>
> sys.stderr = sedSP.stdin
>
>  
>
> # Make sure spawned command output is fed thorugh the SCons output, so
> it's piped to sed
>
> def SpawnWrapper(pspawn):
>
>    def newSpawn(sh, escape, cmd, args, env):
>
>         return pspawn(sh, escape, cmd, args, env, sys.stdout, sys.stderr)
>
>     return newSpawn
>
>  
>
> env['SPAWN'] = SpawnWrapper(env['PSPAWN'])
>
>  
>
>  
>
>  
>
>  
>
> If you want to keep stdout and stderr separate, then you can fork off
> 2 processes to filter them separately.
>
>  
>
> Bests,
>
> Geza
>
>  
>
> *From:*Scons-users [mailto:scons-users-bounces at scons.org] *On Behalf
> Of *Gary Oberbrunner
> *Sent:* 22 August 2014 12:56 PM
> *To:* SCons users mailing list
> *Subject:* Re: [Scons-users] Eclipse-friendly compile error output
>
>  
>
>  
>
> On Thu, Aug 21, 2014 at 10:50 PM, Will Rouesnel <w.rouesnel at gmail.com
> <mailto:w.rouesnel at gmail.com>> wrote:
>
> Can I do the same for error message spew
> from the compiler,
>
>
> No, SCons does not handle or filter the compiler output (stdout,
> stderr).  It just runs the commands.
>
>  
>
> -- 
> Gary
>
>
>
> This body part will be downloaded on demand.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140823/0505cd9a/attachment.html>


More information about the Scons-users mailing list