[Python-bugs-list] [ python-Bugs-599248 ] ext module generation problem
noreply@sourceforge.net
noreply@sourceforge.net
Thu, 26 Dec 2002 07:00:20 -0800
Bugs item #599248, was opened at 2002-08-23 10:01
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=599248&group_id=5470
Category: Distutils
Group: None
Status: Open
Resolution: Fixed
Priority: 5
Submitted By: Stefan Seefeld (stefan)
Assigned to: A.M. Kuchling (akuchling)
Summary: ext module generation problem
Initial Comment:
when compiling an extension module, the source file
location
is not mirrored into the object file location, i.e.
subdirectories
are ignored (foo/bar/baz.c is compiled to baz.o, not
foo/bar/baz.o)
----------------------------------------------------------------------
>Comment By: A.M. Kuchling (akuchling)
Date: 2002-12-26 10:00
Message:
Logged In: YES
user_id=11375
A much simpler change is to modify the original patch that caused the problem, and strip the directory prefixes when python_build is true, trusting that there won't be conflicting filenames in the Python distribution.
----------------------------------------------------------------------
Comment By: A.M. Kuchling (akuchling)
Date: 2002-12-04 13:13
Message:
Logged In: YES
user_id=11375
Now I get it.
In an in-tree build, the source path is something relative, such as
../Modules/foo.c, but in an out-of-tree build it's absolute. This is due to a line in setup.py, but I can't remember why this is done.
One fix that's an egregious hack is to modify CCompiler.object_filenames: if strip_dir is false and
the path is absolute, strip off the path to the source directory; see the attached patch. The patch also modifies setup.py to leave the path names alone.
I'll keep thinking about this.
----------------------------------------------------------------------
Comment By: Michael Hudson (mwh)
Date: 2002-12-04 10:18
Message:
Logged In: YES
user_id=6656
OK, they don't actually break, but .o files end up in
src/Modules/
rather than
src/build-temp/build/temp.foo/
so multiple oot builds don't so what you'd expect.
This came up on python-dev in the thread
"extension module .o files wind up in the wrong place"
starting here:
http://mail.python.org/pipermail/python-dev/2002-December/030644.html
----------------------------------------------------------------------
Comment By: A.M. Kuchling (akuchling)
Date: 2002-12-04 10:12
Message:
Logged In: YES
user_id=11375
One "make distclean" later, out-of-the-tree builds work fine for me. How do they fail?
----------------------------------------------------------------------
Comment By: A.M. Kuchling (akuchling)
Date: 2002-12-04 09:54
Message:
Logged In: YES
user_id=11375
Not sure. I'm trying to replicate it, but current CVS out-of-tree builds
are failing much earlier for me, when it tries to link Parser/pgen.
----------------------------------------------------------------------
Comment By: Michael Hudson (mwh)
Date: 2002-12-04 08:27
Message:
Logged In: YES
user_id=6656
This broke out-of-tree builds of Python.
Any quick ideas on what to do?
----------------------------------------------------------------------
Comment By: A.M. Kuchling (akuchling)
Date: 2002-11-13 20:30
Message:
Logged In: YES
user_id=11375
Great! Checked in as rev 1.52 of ccompiler.py, and I'll
backport it to
the 2.2 maintenance branch.
----------------------------------------------------------------------
Comment By: Stefan Seefeld (stefan)
Date: 2002-11-13 16:59
Message:
Logged In: YES
user_id=764
I 'applied' the patch to my python2.2 installation, i.e. I
replaced the (single)
call to 'object_filenames' by your version. That works.
Thanks !
----------------------------------------------------------------------
Comment By: A.M. Kuchling (akuchling)
Date: 2002-11-13 16:47
Message:
Logged In: YES
user_id=11375
OK, then try the attached patch. Does it fix the problem?
----------------------------------------------------------------------
Comment By: Stefan Seefeld (stefan)
Date: 2002-11-13 16:42
Message:
Logged In: YES
user_id=764
yes, precisely !
----------------------------------------------------------------------
Comment By: A.M. Kuchling (akuchling)
Date: 2002-11-13 16:38
Message:
Logged In: YES
user_id=11375
Hm. Compiling my cryptography modules, it mirrors the location for the final source file (Crypto/Cipher/DES.so), but not for the intermediate
.o file, which gets written to build/temp.linux-i686-2.3/DES.o. Is that
the problem you're seeing?
(In any case, the temp. directory should use full paths, so this is a bug.)
----------------------------------------------------------------------
Comment By: Stefan Seefeld (stefan)
Date: 2002-11-06 10:21
Message:
Logged In: YES
user_id=764
I experienced it with linux / gcc
----------------------------------------------------------------------
Comment By: A.M. Kuchling (akuchling)
Date: 2002-11-06 10:14
Message:
Logged In: YES
user_id=11375
Hm, this is supposed to work, judging by the docstring of
Compiler.compile(). Maybe some subclass of Compiler gets it wrong; what platform are you on?
----------------------------------------------------------------------
Comment By: Stefan Seefeld (stefan)
Date: 2002-08-23 15:31
Message:
Logged In: YES
user_id=764
precisely.
----------------------------------------------------------------------
Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-08-23 15:26
Message:
Logged In: YES
user_id=3066
Why is this a problem? Are you running into name clashes?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=599248&group_id=5470