Skip to content

generate-posix-vars failed when building Python 2.7.14 on Linux #77555

Closed

Description

@piotrdobrogost
BPO 33374
Nosy @benjaminp, @ned-deily

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 = None
closed_at = <Date 2018-04-29.19:25:54.145>
created_at = <Date 2018-04-27.15:45:47.474>
labels = ['build']
title = 'generate-posix-vars failed when building Python 2.7.14 on Linux'
updated_at = <Date 2018-07-04.14:18:33.988>
user = 'https://bugs.python.org/piotrdobrogost'

bugs.python.org fields:

activity = <Date 2018-07-04.14:18:33.988>
actor = 'Peter Senna Tschudin'
assignee = 'none'
closed = True
closed_date = <Date 2018-04-29.19:25:54.145>
closer = 'benjamin.peterson'
components = ['Build']
creation = <Date 2018-04-27.15:45:47.474>
creator = 'piotr.dobrogost'
dependencies = []
files = []
hgrepos = []
issue_num = 33374
keywords = []
message_count = 4.0
messages = ['315846', '315857', '315916', '321044']
nosy_count = 6.0
nosy_names = ['benjamin.peterson', 'ned.deily', 'piotr.dobrogost', 'fweimer', 'tgrigg', 'Peter Senna Tschudin']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue33374'
versions = ['Python 2.7']

Activity

  1. piotrdobrogost commented on Apr 27, 2018

    piotrdobrogostmannequin
    MannequinAuthor

    When building Python 2.7.14 on Fedora 28 I get the following error:

    [piotr@demon]/tmp/Python-2.7.14% make
    (…)
    ./python -E -S -m sysconfig --generate-posix-vars ;\
    if test $? -ne 0 ; then \
    echo "generate-posix-vars failed" ; \
    rm -f ./pybuilddir.txt ; \
    exit 1 ; \
    fi
    /bin/sh: line 5: 25857 Segmentation fault (core dumped) ./python -E -S -m sysconfig --generate-posix-vars
    generate-posix-vars failed
    make[2]: *** [Makefile:514: pybuilddir.txt] Error 1
    make[2]: Leaving directory '/tmp/Python-2.7.14'
    make[1]: *** [Makefile:444: build_all_generate_profile] Error 2
    make[1]: Leaving directory '/tmp/Python-2.7.14'
    make: *** [Makefile:429: profile-opt] Error 2

    Running problematic command alone I get this:

    [piotr@demon]/tmp/Python-2.7.14% ./python -E -S -m sysconfig --generate-posix-vars
    Could not find platform dependent libraries <exec_prefix>
    Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
    zsh: segmentation fault (core dumped) ./python -E -S -m sysconfig --generate-posix-vars

    I found somehow related https://bugs.python.org/issue21166 with excellent explanation by Ned Deily (https://bugs.python.org/msg225217) but that issue is supposedly fixed.

    I have Python 3.6.5 installed at /usr/bin/python3 and Python 2.7.14 installed at /usr/bin/python{2} – both from RPM packages.

    I have Python 2.7.13 installed at /usr/local/bin/python{2} – built from source.

    Running which python returns "/usr/local/bin/python".

    Trying to isolate configuration and build by prefixing commands with
    PATH=/usr/bin:/usr/sbin LIBRARY_PATH= LD_LIBRARY_PATH= (…)
    does not help.

  2. tgrigg commented on Apr 27, 2018

    tgriggmannequin
    Mannequin

    I beleive this is caused by https://bugs.python.org/issue27987 in combination with GCC 8.

    Florian Weimer proposed a patch which is included in the Fedora build:

    https://src.fedoraproject.org/cgit/rpms/python2.git/tree/00293-fix-gc-alignment.patch

    It would be nice if this was fixed for 2.7.15 so that it would build out of the box with GCC 8 on x86_64-linux-gnu.

  3. benjaminp commented on Apr 29, 2018

    @benjaminp
    Contributor

    New changeset 0b91f8a by Benjamin Peterson (Florian Weimer) in branch '2.7':
    Indicate that _PyGC_Head is only 8-byte aligned. (closes bpo-33374)
    0b91f8a

  4. PeterSennaTschudin commented on Jul 4, 2018

    PeterSennaTschudinmannequin
    Mannequin

    I got here when trying to build Yocto Sumo on Fedora 28. python_native build was failing with a segfault. Here is how I fixed it with no elegance intended:

    $ git clone https://github.com/python/cpython.git
    $ cd cpython/
    $ git show 0b91f8a668201fc58fa732b8acc496caedfdbae0 > /tmp/gcc8-fix.patch
    
    $ cd $HOME/poky-sumo/meta/recipes-devtools/python
    $ cp /tmp/gcc8-fix.patch python-native/
    $ git diff python-native_2.7.14.bb
    diff --git a/meta/recipes-devtools/python/python-native_2.7.14.bb b/meta/recipes-devtools/python/python-native_2.7.14.bb
    index 7c491fa3e0..e9a8c14e9c 100644
    --- a/meta/recipes-devtools/python/python-native_2.7.14.bb
    +++ b/meta/recipes-devtools/python/python-native_2.7.14.bb
    @@ -16,6 +16,7 @@ SRC_URI += "\
                 file://builddir.patch \
                 file://parallel-makeinst-create-bindir.patch \
                 file://revert_use_of_sysconfigdata.patch \
    +            file://gcc8-fix.patch \
                "
     
     S = "${WORKDIR}/Python-${PV}"
  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-build

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions