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

OS X framework builds do not create ABI-suffixed libpython3.x #58405

Closed
shibingli mannequin opened this issue Mar 5, 2012 · 9 comments
Closed

OS X framework builds do not create ABI-suffixed libpython3.x #58405

shibingli mannequin opened this issue Mar 5, 2012 · 9 comments
Assignees
Labels
build The build process and cross-build

Comments

@shibingli
Copy link
Mannequin

shibingli mannequin commented Mar 5, 2012

BPO 14197
Nosy @birkenfeld, @ned-deily
Files
  • py32_uWSGI.txt
  • issue14197.patch
  • 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/ned-deily'
    closed_at = <Date 2012-07-24.10:50:26.517>
    created_at = <Date 2012-03-05.04:57:08.299>
    labels = ['build']
    title = 'OS X framework builds do not create ABI-suffixed libpython3.x'
    updated_at = <Date 2012-07-24.10:50:26.484>
    user = 'https://bugs.python.org/shibingli'

    bugs.python.org fields:

    activity = <Date 2012-07-24.10:50:26.484>
    actor = 'ned.deily'
    assignee = 'ned.deily'
    closed = True
    closed_date = <Date 2012-07-24.10:50:26.517>
    closer = 'ned.deily'
    components = ['Build']
    creation = <Date 2012-03-05.04:57:08.299>
    creator = 'shibingli'
    dependencies = []
    files = ['24733', '26496']
    hgrepos = []
    issue_num = 14197
    keywords = ['patch']
    message_count = 9.0
    messages = ['154921', '154923', '154925', '154926', '154930', '166270', '166271', '166273', '166274']
    nosy_count = 4.0
    nosy_names = ['georg.brandl', 'ned.deily', 'python-dev', 'shibingli']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue14197'
    versions = ['Python 3.2', 'Python 3.3']

    @shibingli
    Copy link
    Mannequin Author

    shibingli mannequin commented Mar 5, 2012

    Artificial libpython3.2.a soft links to libpython3.2m.a

    @shibingli shibingli mannequin added the build The build process and cross-build label Mar 5, 2012
    @ned-deily
    Copy link
    Member

    Sorry, can you explain better what problem you are seeing including specific error messages?

    @shibingli
    Copy link
    Mannequin Author

    shibingli mannequin commented Mar 5, 2012

    Use the Mac OS 10.7 compiler uWSGI Makefile.Py32 (make-f), will report a compile error. Information in the annex.Artificially will the soft libpython3.2.a / Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config-3.2m under connection to a libpython3.2m.a, the problem-solving.

    @shibingli
    Copy link
    Mannequin Author

    shibingli mannequin commented Mar 5, 2012

    Has been revised to permit BUG Description

    在 2012-3-5,下午1:18, Ned Deily 写道:

    Ned Deily <nad@acm.org> added the comment:

    Sorry, can you explain better what problem you are seeing including specific error messages?

    ----------
    nosy: +ned.deily


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue14197\>


    @ned-deily
    Copy link
    Member

    Thank you for the additional information. It appears the problem is that, for OS X framework builds, the ABI suffix (added in PEP-3149) is not used to create the shared library dylib name in the framework lib directory. For example,

    $ cd Library/Frameworks/Python.framework/Versions/3.2
    $ ./bin/python3.2-config --libs
    -ldl -framework CoreFoundation -lpython3.2m
    $ ls -l ./lib
    total 8
    lrwxr-xr-x   1 root  wheel     9 Feb 24 09:44 libpython3.2.dylib@ -> ../Python
    drwxrwxr-x   2 root  admin   170 Feb 24 08:49 pkgconfig/
    drwxrwxr-x  32 root  admin  6290 Feb 24 08:49 python3.2/

    But in an --enable-shared --with-pydebug build:

    $ ./bin/python3.2-config --libs
    -ldl -framework CoreFoundation -lpython3.2dm
    $ ls -l ./lib
    total 6920
    -r-xr-xr-x   1 nad  pyd  3541320 Mar  4 23:40 libpython3.2dm.dylib*
    drwxr-xr-x   2 nad  pyd      170 Mar  4 23:40 pkgconfig/
    drwxr-xr-x  32 nad  pyd     6290 Mar  4 23:40 python3.2/

    Looks like target frameworkinstallmaclib in Makefile.pre.in needs to be changed to include SOABI in the name for the lib symlink.

    @ned-deily ned-deily changed the title MacOS10.7 compiled uWSGI the issue. OS X framework builds do not create ABI-suffixed libpython3.x Mar 5, 2012
    @ned-deily ned-deily self-assigned this Mar 5, 2012
    @ned-deily
    Copy link
    Member

    The attached patch ensures that additional SOABI-suffixed symlinks are created in the framework lib and lib/pythonx.x/config-yy directories and fixes pythons.x-config to not return garbage data for the --ldflags option.

    # current
    $ ls -l /Library/Frameworks/Python.framework/Versions/3.2/lib
    total 8
    lrwxr-xr-x 1 root wheel 9 Jul 15 17:40 libpython3.2.dylib@ -> ../Python
    drwxrwxr-x 2 root admin 170 Apr 10 11:27 pkgconfig/
    drwxrwxr-x 32 root admin 6290 Apr 10 11:27 python3.2/

    # with patch
    $ ls -l /Library/Frameworks/Python.framework/Versions/3.2/lib
    total 16
    lrwxr-xr-x 1 root wheel 9 Jul 24 02:43 libpython3.2.dylib@ -> ../Python
    lrwxr-xr-x 1 root wheel 9 Jul 24 02:43 libpython3.2m.dylib@ -> ../Python
    drwxrwxr-x 2 root admin 170 Jul 24 02:38 pkgconfig/
    drwxrwxr-x 34 root admin 6494 Jul 24 02:38 python3.2/

    # current
    $ ls -l /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config-3.2m/
    total 256
    -rw-rw-r-- 1 root admin 51118 Apr 10 11:27 Makefile
    -rw-rw-r-- 1 root admin 15018 Apr 10 11:27 Setup
    -rw-rw-r-- 1 root admin 370 Apr 10 11:27 Setup.config
    -rw-rw-r-- 1 root admin 41 Apr 10 11:27 Setup.local
    -rw-rw-r-- 1 root admin 2902 Apr 10 11:27 config.c
    -rw-rw-r-- 1 root admin 1642 Apr 10 11:27 config.c.in
    -rwxrwxr-x 1 root admin 7122 Apr 10 11:27 install-sh*
    lrwxr-xr-x 1 root wheel 15 Jul 15 17:40 libpython3.2.a@ -> ../../../Python
    lrwxr-xr-x 1 root wheel 15 Jul 15 17:40 libpython3.2.dylib@ -> ../../../Python
    -rwxrwxr-x 1 root admin 7460 Apr 10 11:27 makesetup*
    -rw-rw-r-- 1 root admin 18776 Apr 10 11:27 python.o

    # with patch
    $ ls -l /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/config-3.3m/
    total 280
    -rw-rw-r-- 1 root admin 55198 Jul 24 02:38 Makefile
    -rw-rw-r-- 1 root admin 15009 Jul 24 02:38 Setup
    -rw-rw-r-- 1 root admin 370 Jul 24 02:38 Setup.config
    -rw-rw-r-- 1 root admin 41 Jul 24 02:38 Setup.local
    -rw-rw-r-- 1 root admin 2963 Jul 24 02:38 config.c
    -rw-rw-r-- 1 root admin 1619 Jul 24 02:38 config.c.in
    -rwxrwxr-x 1 root admin 7122 Jul 24 02:38 install-sh*
    lrwxr-xr-x 1 root wheel 15 Jul 24 02:43 libpython3.2.a@ -> ../../../Python
    lrwxr-xr-x 1 root wheel 15 Jul 24 02:43 libpython3.2.dylib@ -> ../../../Python
    lrwxr-xr-x 1 root wheel 15 Jul 24 02:43 libpython3.2m.a@ -> ../../../Python
    lrwxr-xr-x 1 root wheel 15 Jul 24 02:43 libpython3.2m.dylib@ -> ../../../Python
    -rwxrwxr-x 1 root admin 7460 Jul 24 02:38 makesetup*
    -rw-rw-r-- 1 root admin 18896 Jul 24 02:38 python.o

    # current
    $ python3.2-config --ldflags
    -L/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config-3.2m -ldl -framework CoreFoundation -lpython3.2m -framework CoreFoundation Python.framework/Versions/3.2/Python

    # with patch
    $ python3.2-config --ldflags
    -L/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.3/config-3.2m -ldl -framework CoreFoundation -lpython3.2m

    @ned-deily
    Copy link
    Member

    Georg, I'd like to apply this for both 3.2.4 and 3.3.0b2. It's a low risk bug fix but does solve a real problem for users wanting to embed Python on OS X. bpo-15353 is also fixed by this.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 24, 2012

    New changeset 2d4f290ea71c by Ned Deily in branch '3.2':
    Issue bpo-14197: For OS X framework builds, ensure links to the shared
    http://hg.python.org/cpython/rev/2d4f290ea71c

    New changeset 51ac5f06dd04 by Ned Deily in branch 'default':
    Issue bpo-14197: merge
    http://hg.python.org/cpython/rev/51ac5f06dd04

    @ned-deily
    Copy link
    Member

    Fix applied for release in 3.2.4 and (with release manager approval) for 3.3.0b2.

    @ned-deily ned-deily added build The build process and cross-build and removed OS-mac labels Jul 24, 2012
    @ned-deily ned-deily removed the build The build process and cross-build label Jul 24, 2012
    @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
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant