Bug 474 - waf output to stderr
waf output to stderr
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: build system
ns-3-dev
All All
: P4 normal
Assigned To: Gustavo J. A. M. Carneiro
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-19 09:43 UTC by TimoB
Modified: 2009-01-31 16:23 UTC (History)
2 users (show)

See Also:


Attachments
patch (944 bytes, patch)
2009-01-22 13:48 UTC, Gustavo J. A. M. Carneiro
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TimoB 2009-01-19 09:43:05 UTC
Shouldn't all output from waf be to stderr?

That would enable better use of ./waf --run scratch/program > save.log

Currently part of the output is on stdout and part on stderr. Standard make's output is only on stderr.
Comment 1 Gustavo J. A. M. Carneiro 2009-01-19 10:48:57 UTC
Hi.  I am neutral on this.  But if you really care about it you have to convince upstream WAF maintainer:

   http://code.google.com/p/waf/issues/list

Anyway, it's trivial to redirect everything, just:

   ./waf --run scratch/program >& save.log

Or, if you do not want to use bash extensions:

   ./waf --run scratch/program > save.log 2>&1

Comment 2 TimoB 2009-01-19 11:02:28 UTC
Yes, sure you can redirect stderr.

However my issue is a different one: the scratch program outputs debug traces, gnuplot data or whatever on stdout.

But waf also outputs to stdout, so the output gets mixed. And gnuplot does not like

[  1/251] cxx: scratch/three-nodes-capture-border.cc -> build/debug/scratch/three-nodes-capture-border_8.o
[251/251] cxx_link: build/debug/scratch/three-nodes-capture-border_8.o -> build/debug/scratch/three-nodes-capture-border

in it's data files. Yes, I could just write a file directly, but it's easier to use std::cout.
Comment 3 Gustavo J. A. M. Carneiro 2009-01-19 11:16:53 UTC
Keep in mind you still have ./waf --shell, then you can run your programs manually without waf interference.
Comment 4 TimoB 2009-01-19 11:21:46 UTC
That's how I do it currently.
But ./waf --run also recompiles if necessary.
Comment 5 Gustavo J. A. M. Carneiro 2009-01-22 07:32:34 UTC
http://code.google.com/p/waf/issues/detail?id=319
Comment 6 Gustavo J. A. M. Carneiro 2009-01-22 13:48:08 UTC
Created attachment 360 [details]
patch

I think this patch takes care of it.
Comment 7 Tom Henderson 2009-01-23 01:53:53 UTC
(In reply to comment #6)
> Created an attachment (id=360) [details]
> patch
> 
> I think this patch takes care of it.
> 

this works for me, +1
Comment 8 Gustavo J. A. M. Carneiro 2009-01-23 07:01:54 UTC
This was fixed in upstream WAF.  I'll merge in about a week, when WAF 1.5.3 gets released.
Comment 9 TimoB 2009-01-23 09:50:12 UTC
Works ok, only kills color if stdout is redirected. Probably some terminal detection code. The upstream changes also fix that issue.
Comment 10 Gustavo J. A. M. Carneiro 2009-01-31 16:23:01 UTC
changeset:   4132:6f24531bb23e