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: many distutils tests fail when run from the installed location
Type: Stage: patch review
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: doko, eric.araujo, hynek, ned.deily, python-dev, ronaldoussoren, twouters
Priority: normal Keywords: patch

Created on 2013-04-16 10:49 by doko, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue17752.diff doko, 2014-05-06 22:01 review
Messages (10)
msg187068 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-04-16 10:49
many distutils tests fail when run from the installed location, either depending on the 'srcdir' macro, files not installed ('xxmodule.c'), or needing write permissions in the installed location.
msg216514 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2014-04-16 17:43
Matthias, I think this is already fixed for Python 3.3 and later (at least.) There may still be problems in 2.7, but I'm not sure if it's worth fixing them there. Can you see if you still have problems, and if so, show us how to reproduce them? (Is it just 'python -m test.regrtest'? Is it just test_distutils or also other tests?)
msg216552 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2014-04-16 18:53
three are still failing with 3.4:

cc-4.9.real: error: /tmp/tmpdjxmlia5/xx.cpython-34m.so: No such file or directory
gcc-4.9.real: error: /tmp/tmp4zpi6ktg/foo.cpython-34m.so: No such file or directory
gcc-4.9.real: error: build/lib.linux-x86_64-3.4/xx.cpython-34m.so: No such file or directory
test test_distutils failed -- multiple errors occurred; run in verbose mode for details
1 test failed:
    test_distutils


test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase)
test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase)
test_record_extensions (distutils.tests.test_install.InstallTestCase)

The reason here is that the xx module is not found (where should it be installed in the installed testsuite?).
msg216618 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-04-16 23:10
The xx module is built by the unit tests IIRC.
msg218026 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2014-05-06 22:01
so the issue here is that -L -o <file> is passed to the compiler, and -o is interpreted as the library dir, and <file> as an input file.

To robustify, change distutils/tests/support.py to not include empty directory names.

To fix, change configure.ac (RUNPATH) not to unconditionally end the environment variables with an empty directory.

adding Ronald, Darwin is the only platform having quotes around this. Is this really needed/wanted?
msg218031 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-05-07 01:12
The quotes that you removed around the DYLD_FRAMEWORK_PATH step are not needed, at least until the rest of configure.ac and Makefile.pre.in support paths with spaces et al.  However, you missed removing the single quotes around the DYLD_LIBRARY_PATH step here:

RUNSHARED='DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}'

Otherwise, the patch LGTM; I tested it with --enable-framework and --enable-shared configs on OS X.
msg218034 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-05-07 02:42
New changeset faef1da30c6d by doko in branch '2.7':
- Issue #17752: Fix distutils tests when run from the installed location.
http://hg.python.org/cpython/rev/faef1da30c6d
msg218048 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-05-07 11:09
New changeset 7d1929cc08dd by doko in branch '3.3':
- Issue #17752: Fix distutils tests when run from the installed location.
http://hg.python.org/cpython/rev/7d1929cc08dd

New changeset 01e933cb1de9 by doko in branch '3.4':
- Issue #17752: Fix distutils tests when run from the installed location.
http://hg.python.org/cpython/rev/01e933cb1de9

New changeset c0bcf1383d77 by doko in branch 'default':
- Issue #17752: Fix distutils tests when run from the installed location.
http://hg.python.org/cpython/rev/c0bcf1383d77
msg218067 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-05-07 18:06
For future fixes, please note that 3.3 is in security mode.

Can this issue be closed?
msg218083 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2014-05-07 21:51
yes, noted myself (too late), and informed Georg about it. Closing for now.
History
Date User Action Args
2022-04-11 14:57:44adminsetgithub: 61952
2021-09-10 10:45:55iritkatriellinkissue16591 superseder
2014-05-07 21:51:18dokosetstatus: open -> closed
resolution: fixed
messages: + msg218083
2014-05-07 18:06:16eric.araujosetmessages: + msg218067
2014-05-07 11:09:14python-devsetmessages: + msg218048
2014-05-07 02:42:03python-devsetnosy: + python-dev
messages: + msg218034
2014-05-07 01:12:11ned.deilysetmessages: + msg218031
2014-05-06 22:02:23dokosetstage: needs patch -> patch review
2014-05-06 22:01:28dokosetfiles: + issue17752.diff

nosy: + ronaldoussoren, ned.deily, hynek
messages: + msg218026

keywords: + patch
2014-04-16 23:10:09eric.araujosetnosy: + eric.araujo
messages: + msg216618
2014-04-16 18:53:35dokosetmessages: + msg216552
2014-04-16 17:43:01twouterssetnosy: + twouters

messages: + msg216514
versions: + Python 2.7, - Python 3.3, Python 3.4
2013-04-16 10:49:54dokolinkissue17750 dependencies
2013-04-16 10:49:34dokocreate