Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distutils test_build_ext's test_get_outputs fails in bootstrap environment #52582

Closed
matejcik mannequin opened this issue Apr 7, 2010 · 7 comments
Closed

distutils test_build_ext's test_get_outputs fails in bootstrap environment #52582

matejcik mannequin opened this issue Apr 7, 2010 · 7 comments
Assignees
Labels
build The build process and cross-build stdlib Python modules in the Lib dir

Comments

@matejcik
Copy link
Mannequin

matejcik mannequin commented Apr 7, 2010

BPO 8335
Nosy @warsaw, @matejcik, @tarekziade, @merwok, @sandrotosi
Superseder
  • bpo-10126: test_distutils failure with --enable-shared
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/tarekziade'
    closed_at = <Date 2010-10-18.15:17:23.488>
    created_at = <Date 2010-04-07.17:54:00.540>
    labels = ['build', 'library']
    title = "distutils test_build_ext's test_get_outputs fails in bootstrap environment"
    updated_at = <Date 2010-10-18.15:17:23.476>
    user = 'https://github.com/matejcik'

    bugs.python.org fields:

    activity = <Date 2010-10-18.15:17:23.476>
    actor = 'eric.araujo'
    assignee = 'tarek'
    closed = True
    closed_date = <Date 2010-10-18.15:17:23.488>
    closer = 'eric.araujo'
    components = ['Distutils', 'Distutils2']
    creation = <Date 2010-04-07.17:54:00.540>
    creator = 'matejcik'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 8335
    keywords = []
    message_count = 7.0
    messages = ['102552', '105995', '106454', '106472', '106537', '119014', '119028']
    nosy_count = 7.0
    nosy_names = ['barry', 'matejcik', 'tarek', 'eric.araujo', 'sandro.tosi', 'Canfield', 'valeo']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '10126'
    type = 'compile error'
    url = 'https://bugs.python.org/issue8335'
    versions = ['3rd party', 'Python 3.1', 'Python 2.7', 'Python 3.2']

    @matejcik
    Copy link
    Mannequin Author

    matejcik mannequin commented Apr 7, 2010

    when running testsuite in a clean environment without pre-installed system python, test_distutils fail in test_build_ext, test_get_outputs:
    /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -lpython2.6
    LinkError: command 'gcc' failed with exit status 1

    full traceback is below.

    this is most likely caused by change in r72637:
    http://svn.python.org/view/python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py?r1=72637&r2=72636&pathrev=72637
    this changes compiler's working directory, so that it can no longer find libpython2.6.so with "-L."
    (related to bpo-6022 - the comments there point it out)

    not sure about proper fix - personally, i don't care much about leaving one more file in builddir, whereas i do care about tests passing in clean env, so for SUSE i'm reverting r72637

    full traceback:

    test_distutils
    /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -lpython2.6
    collect2: ld returned 1 exit status
    test test_distutils failed -- Traceback (most recent call last):
      File "/usr/src/packages/BUILD/Python-2.6.5/Lib/distutils/tests/test_build_ext.py", line 261, in test_get_outputs
        cmd.run()
      File "/usr/src/packages/BUILD/Python-2.6.5/Lib/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/usr/src/packages/BUILD/Python-2.6.5/Lib/distutils/command/build_ext.py", line 449, in build_extensions
        self.build_extension(ext)
      File "/usr/src/packages/BUILD/Python-2.6.5/Lib/distutils/command/build_ext.py", line 531, in build_extension
        target_lang=language)
      File "/usr/src/packages/BUILD/Python-2.6.5/Lib/distutils/ccompiler.py", line 769, in link_shared_object
        extra_preargs, extra_postargs, build_temp, target_lang)
      File "/usr/src/packages/BUILD/Python-2.6.5/Lib/distutils/unixccompiler.py", line 259, in link
        raise LinkError, msg
    LinkError: command 'gcc' failed with exit status 1

    @matejcik matejcik mannequin assigned tarekziade Apr 7, 2010
    @matejcik matejcik mannequin added stdlib Python modules in the Lib dir build The build process and cross-build labels Apr 7, 2010
    @Canfield
    Copy link
    Mannequin

    Canfield mannequin commented May 18, 2010

    I am having the exact same problem with test_distutils failing on a clean env. Did reverting the changes in r72637 fix your problem?

    @matejcik
    Copy link
    Mannequin Author

    matejcik mannequin commented May 25, 2010

    yes, reverting r72637 fixes this problem for me

    it reintroduces the original bug (there is some temporary file left behind), but i don't care about that

    @tarekziade
    Copy link
    Mannequin

    tarekziade mannequin commented May 25, 2010

    Dylan, what is your platform ?

    The only difference is that the test chdir in a new temporary directory.

    Could anyone trace the test to step into the linker call to see its error output ? (can't reproduce here)

    @matejcik
    Copy link
    Mannequin Author

    matejcik mannequin commented May 26, 2010

    Tarek,
    the error output is this:
    /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -lpython2.6

    the chdir is the problem - because in an environment where you don't have an existing Python installation, you will not find -lpython2.6.

    the linker from unixccompiler.py:link() is this:
    ['gcc', '-pthread', '-shared', '/tmp/pythontest_eosQ1d/tempt/tmp/tmphIMDH2/foo.o', '-L.', '-lpython2.6', '-o', '/tmp/tmppAsk00/foo.so']

    and since you're in new temporary directory, -L. does not include libpython2.6 (unless you copy it in that directory or change -L. to the right place)

    @merwok
    Copy link
    Member

    merwok commented Oct 18, 2010

    This may be solved by backporting the fix in bpo-10126. I’ll do it when my network gives me access to svn again :/

    @merwok
    Copy link
    Member

    merwok commented Oct 18, 2010

    Marking as duplicate, following Barry in msg119022

    @merwok merwok closed this as completed Oct 18, 2010
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant