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

make install doesn't respect configure --with-platlibdir=lib64 #84861

Closed
vstinner opened this issue May 19, 2020 · 5 comments
Closed

make install doesn't respect configure --with-platlibdir=lib64 #84861

vstinner opened this issue May 19, 2020 · 5 comments
Labels
3.9 only security fixes 3.10 only security fixes build The build process and cross-build

Comments

@vstinner
Copy link
Member

BPO 40684
Nosy @vstinner, @ned-deily, @miss-islington
PRs
  • bpo-40684: Fix make install for platlibdir=lib64 #20736
  • [3.9] bpo-40684: Fix make install for platlibdir=lib64 (GH-20736) #20761
  • 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 2020-06-09.14:39:04.813>
    created_at = <Date 2020-05-19.15:00:31.083>
    labels = ['build', '3.9', '3.10']
    title = "make install doesn't respect configure --with-platlibdir=lib64"
    updated_at = <Date 2020-06-09.14:45:39.310>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2020-06-09.14:45:39.310>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-06-09.14:39:04.813>
    closer = 'vstinner'
    components = ['Build']
    creation = <Date 2020-05-19.15:00:31.083>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40684
    keywords = ['patch']
    message_count = 5.0
    messages = ['369362', '369363', '371105', '371106', '371111']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'ned.deily', 'Arfrever', 'miss-islington']
    pr_nums = ['20736', '20761']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue40684'
    versions = ['Python 3.9', 'Python 3.10']

    @vstinner
    Copy link
    Member Author

    bpo-1294959 added --with-platlibdir option to configure, but "make install" doesn't fully respect it. Example:

    ./configure --prefix /opt/py39b1 --with-platlibdir=lib64
    make
    make install

    I get:

    /opt/py39b1/lib/python3.9/lib-dynload/readline.cpython-39-x86_64-linux-gnu.so

    whereas Python doesn't use this directory:

    $ /opt/py39b1/bin/python3.9 -m site
    Could not find platform dependent libraries <exec_prefix>
    Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
    sys.path = [
        '/home/vstinner/Python-3.9.0b1',
        '/opt/py39b1/lib64/python39.zip',
        '/opt/py39b1/lib64/python3.9',
        '/opt/py39b1/lib64/lib-dynload',
        '/home/vstinner/.local/lib/python3.9/site-packages',
        '/opt/py39b1/lib64/python3.9/site-packages',
    ]
    USER_BASE: '/home/vstinner/.local' (exists)
    USER_SITE: '/home/vstinner/.local/lib/python3.9/site-packages' (exists)
    ENABLE_USER_SITE: True

    Python looks into /opt/py39b1/lib64/lib-dynload ("lib64")

    make install writes into /opt/py39b1/lib/python3.9/lib-dynload/ ("lib")

    @vstinner vstinner added 3.9 only security fixes build The build process and cross-build 3.10 only security fixes labels May 19, 2020
    @vstinner
    Copy link
    Member Author

    The Fedora package is built using --libdir=/usr/lib64 --with-platlibdir=lib64 which works around the issue:

    + /builddir/build/BUILD/Python-3.9.0b1/configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-platlibdir=lib64 --enable-ipv6 --enable-shared --with-computed-gotos=yes --with-dbmliborder=gdbm:ndbm:bdb --with-system-expat --with-system-ffi --enable-loadable-sqlite-extensions --with-dtrace --with-lto --with-ssl-default-suites=openssl --with-valgrind --without-ensurepip --enable-optimizations

    @vstinner
    Copy link
    Member Author

    vstinner commented Jun 9, 2020

    New changeset 51ae31e by Victor Stinner in branch 'master':
    bpo-40684: Fix make install for platlibdir=lib64 (GH-20736)
    51ae31e

    @miss-islington
    Copy link
    Contributor

    New changeset 6cb24a0 by Miss Islington (bot) in branch '3.9':
    bpo-40684: Fix make install for platlibdir=lib64 (GH-20736)
    6cb24a0

    @vstinner vstinner closed this as completed Jun 9, 2020
    @vstinner
    Copy link
    Member Author

    vstinner commented Jun 9, 2020

    make install writes into /opt/py39b1/lib/python3.9/lib-dynload/ ("lib")

    I tested manually my fix: it works as expected.

    Install:

    ./configure --prefix /opt/py39_lib64 --with-platlibdir=lib64
    make
    make install

    Test:

    $ /opt/py39_lib64/bin/python3.9 -m site
    sys.path = [
        '/',
        '/opt/py39_lib64/lib64/python39.zip',
        '/opt/py39_lib64/lib64/python3.9',
        '/opt/py39_lib64/lib64/python3.9/lib-dynload',
        '/home/vstinner/.local/lib/python3.9/site-packages',
        '/opt/py39_lib64/lib64/python3.9/site-packages',
    ]
    USER_BASE: '/home/vstinner/.local' (exists)
    USER_SITE: '/home/vstinner/.local/lib/python3.9/site-packages' (exists)
    ENABLE_USER_SITE: True
    
    $ /opt/py39_lib64/bin/python3.9 
    Python 3.9.0b2+ (heads/3.9:6cb24a035c, Jun  9 2020, 16:43:12) 
    [GCC 10.1.1 20200507 (Red Hat 10.1.1-1)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import _asyncio
    >>> _asyncio
    <module '_asyncio' from '/opt/py39_lib64/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'>

    @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
    3.9 only security fixes 3.10 only security fixes build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants