[Python-bugs-list] [ python-Bugs-620630 ] distutils mixed stdin/stdout output

noreply@sourceforge.net noreply@sourceforge.net
Fri, 15 Nov 2002 11:06:14 -0800


Bugs item #620630, was opened at 2002-10-09 02:50
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=620630&group_id=5470

Category: Distutils
Group: Python 2.3
>Status: Closed
>Resolution: Fixed
Priority: 3
Submitted By: Matthias Klose (doko)
Assigned to: A.M. Kuchling (akuchling)
Summary: distutils mixed stdin/stdout output

Initial Comment:
If distutils output is piped to a common logfile, the
output is garbled as shown in:

http://buildd.debian.org/fetch.php?&pkg=python-numeric&ver=22.0-2&arch=powerpc&stamp=1034115818&file=log&as=raw

It's a bit confusing to search errors in the garbled
output. It would be nice, if distutils flashes the
output buffers on each newline.

Not sure how well this shows in the included snippets.

gcc-3.2 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC
-IInclude -IPackages/FFSrc/ranlibmodule.c: In function
`get_continuous_random':
[here in the middle of the line]
Src/ranlibmodule.c:47: warning: function declaration
isn't a prototype

Src/lapack_litemodule.c:649: warning:
`lapack_liteError' defined but not used
[upto here a compile command, then two other commands
succeed, then the error for the link command]
/usr/bin/ld: cannot find -lg2c-pic
collect2: ld returned 1 exit status

[and now the link command:]
gcc-3.2 -shared
build/temp.linux-ppc-2.3/lapack_litemodule.o -llapack
-lblas -lg2c-pic -o build/lib.linux-ppc-2.3/lapack_lite.so
error: command 'gcc-3.2' failed with exit status 1


----------------------------------------------------------------------

>Comment By: A.M. Kuchling (akuchling)
Date: 2002-11-15 14:06

Message:
Logged In: YES 
user_id=11375

Closed; I'll assume this fixes the original poster's problem.


----------------------------------------------------------------------

Comment By: A.M. Kuchling (akuchling)
Date: 2002-11-04 09:29

Message:
Logged In: YES 
user_id=11375

Attached is an example of bad output, producing by compiling Numeric
with "python setup.py build >out 2>&1".  The compiler error messages come first, followed by the distutils 'Building multiarray extension' message.

Jeremy's logging reorganization makes a fix simple; just add  
sys.stdout.flush() to Log._log() in distutils/log.py.  Checked in as revision 1.2 of log.py.  Matthis, does that fix your problem?




----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-10-14 20:51

Message:
Logged In: YES 
user_id=6380

The only way to turn on unbuffered output is to use python -u...

I can't interpret the output you quote above; and the word
"ranlibmodule.c" doesn't occur on the URL you mention; so
I'm not sure what the relationship between the two is.

I know very little of distutils. It seems it uses spawn() to
run subcommands, which uses fork+exec. The buffering set by
distutils for itself doesn't affect the buffering of the
subcommands.

Perhaps you could suggest a patch?

----------------------------------------------------------------------

Comment By: Matthias Klose (doko)
Date: 2002-10-12 03:44

Message:
Logged In: YES 
user_id=60903

Sure, but then I'll have to change the packaging of about
100 python packages for Debian. The distutils docs talk
about "python setup.py", not "python -u setup.py". Can
distutils  turn on unbuffered output by default? Is there a
real performance penalty using distutils with unbuffered output?


----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2002-10-11 12:16

Message:
Logged In: YES 
user_id=31392

If you're piping the output to a combined log file, you can
use python -u to unbuffer stdout.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=620630&group_id=5470