Py-2.3 distutils is broken in the following situation
when building extension modules:
If a file in C sources list is given with absolute
path, say
/path/to/foo.c then Py-2.3 distutils tries to create
the corresponding
object file to /path/to/foo.o (earlier versions would
create it to, say, build/temp.linux-i686-2.2/foo.o).
This causes problems when
1) an user does not have permissions to write to
/path/to/, e.g. in multiuser systems
2) an user builds extension modules, say, using
different compilers or flags. Then /path/to/foo.o will
be in a way for subsequent builds.
IMHO, distutils should not create any files outside the
given
build directory, unless explicitely specified using
--build-temp.
Fix:
The problematic code seems to be in the method
ccompiler.object_filenames in file distutils/ccompiler.py.
As a fix, I suggest using the following object name for
a C source if given with absolute path:
./build/temp.linux-i686-2.2/path/to/foo.o.
This can be achived by inserting the following line
just after
the line `base, ext = os.path.splitext(src_name)`:
base = base[os.path.isabs(base):]
Pearu
|