This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: distutils mixed stdin/stdout output
Type: Stage:
Components: Distutils Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, doko, gvanrossum, jhylton
Priority: low Keywords:

Created on 2002-10-09 06:50 by doko, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
bad-output akuchling, 2002-11-04 14:29 An example of a confusing output file
Messages (6)
msg12663 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2002-10-09 06:50
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
msg12664 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2002-10-11 16:16
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.
msg12665 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2002-10-12 07:44
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?
msg12666 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-10-15 00:51
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?
msg12667 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2002-11-04 14:29
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?


msg12668 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2002-11-15 19:06
Logged In: YES 
user_id=11375

Closed; I'll assume this fixes the original poster's problem.
History
Date User Action Args
2022-04-10 16:05:44adminsetgithub: 37289
2002-10-09 06:50:21dokocreate