Issue 3054: test_disutils fails - Python tracker (original) (raw)

Created on 2008-06-06 21:34 by ronaldoussoren, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_build_ext.patch spatz,2008-06-07 13:50
get_python_inc.patch nas,2008-06-20 00:53
Messages (6)
msg67785 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2008-06-06 21:34
test_distutils fails when you're not building in the root of the source tree. That is: mkdir build cd build ../configure make make check This fails like this: test test_distutils failed -- Traceback (most recent call last): File "/Users/ronald/Projects/python/python- trunk/Lib/distutils/tests/test_build_ext.py", line 23, in setUp shutil.copy(xx_c, self.tmp_dir) File "/Users/ronald/Projects/python/python-trunk/Lib/shutil.py", line 82, in copy copyfile(src, dst) File "/Users/ronald/Projects/python/python-trunk/Lib/shutil.py", line 46, in copyfile fsrc = open(src, 'rb') IOError: [Errno 2] No such file or directory: '/Users/ronald/Projects/python/python-trunk/build104/Modules/xxmodule.c'
msg67807 - (view) Author: Dror Levin (spatz) Date: 2008-06-07 13:50
This also happens in py3k. Attached a patch that fixes this by using the dirname of sysconfig.project_base if the file is not found, but perhaps a better solution could be found...
msg68423 - (view) Author: Neil Schemenauer (nas) Date: 2008-06-19 20:36
Looks like this has exposed some ugly code. From setup.py: # Figure out the location of the source code for extension modules # (This logic is copied in distutils.test.test_sysconfig, # so building in a separate directory does not break test_distutils.) I believe the proper fix is to move some of the code from setup.py into sysconfig so that it does more than just set "python_build" when running inside a Python build directory. For example, it should also add /Include to the standard list of includes that distutils uses. The attached patch fixes test_build_ext.py to use the right source file (perhaps it should be tested on Windows). The test still fails because Python.h cannot be found.
msg68430 - (view) Author: Neil Schemenauer (nas) Date: 2008-06-20 00:00
I think my previous patch combined with sysconfig_builddir.patch fixes this issue. Someone will need to test on other platforms. Note that the messy code in setup.py and in the tests should still be cleaned up. BTW, distutils is a den of stinking evil. ;-)
msg68436 - (view) Author: Neil Schemenauer (nas) Date: 2008-06-20 00:53
One final patch for today (get_python_inc.patch). The patch combines my previous two patches and also cleans up some ugly code in setup.py and test_sysconfig.py. The source of the ugliness was that get_python_inc() did not work when running from within a build directory. The patch also fixes the header dependency feature introduced in svn r60287 (it assumed that builddir == srcdir and also that os.path.sep == '/').
msg96888 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-12-26 13:18
This issue is fixed in the 2.7 and 3.2 trees. I'm therefore closing this issue.
History
Date User Action Args
2022-04-11 14:56:35 admin set github: 47304
2009-12-26 13🔞12 ronaldoussoren set status: open -> closedresolution: fixedmessages: + stage: resolved
2008-06-20 00:54:27 nas set files: - sysconfig_builddir.patch
2008-06-20 00:54:22 nas set files: - test_ext_src.patch
2008-06-20 00:54:00 nas set files: + get_python_inc.patchmessages: +
2008-06-20 00:00:27 nas set files: + sysconfig_builddir.patchmessages: +
2008-06-19 20:36:30 nas set files: + test_ext_src.patchnosy: + nasmessages: +
2008-06-07 13:50:59 spatz set files: + test_build_ext.patchkeywords: + patchmessages: + nosy: + spatzversions: + Python 3.0
2008-06-06 21:39:51 ronaldoussoren set type: behaviorcomponents: + Tests, - Distutils
2008-06-06 21:34:17 ronaldoussoren create