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

In debug build, load also C extensions compiled in release mode or compiled using the stable ABI #80903

Closed
vstinner opened this issue Apr 25, 2019 · 6 comments
Labels
3.8 (EOL) end of life build The build process and cross-build

Comments

@vstinner
Copy link
Member

BPO 36722
Nosy @vstinner
PRs
  • bpo-36722: Debug build loads libraries built in release mode #12952
  • bpo-36722: Add What's New entry for debug ABI #12957
  • bpo-36722: Don't define ALT_SOABI for Py_TRACE_REFS build #12973
  • bpo-36722: Style and grammar edits for ABI entry #12979
  • 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 2019-04-26.18:04:59.154>
    created_at = <Date 2019-04-25.19:00:47.828>
    labels = ['build', '3.8']
    title = 'In debug build, load also C extensions compiled in release mode or compiled using the stable ABI'
    updated_at = <Date 2019-04-27.18:14:38.149>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2019-04-27.18:14:38.149>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-04-26.18:04:59.154>
    closer = 'vstinner'
    components = ['Build']
    creation = <Date 2019-04-25.19:00:47.828>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36722
    keywords = ['patch']
    message_count = 6.0
    messages = ['340856', '340869', '340874', '340928', '340935', '341007']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = ['12952', '12957', '12973', '12979']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36722'
    versions = ['Python 3.8']

    @vstinner
    Copy link
    Member Author

    bpo-36465 modified the ABI of debug build so release and debug build now have the same ABI.

    bpo-21536 modified how C extensions are built: they are no longer linked to libpython.

    In a debug build, it becomes possible to load a C extension built in release mode:
    https://bugs.python.org/issue21536#msg340821

    But I had to modify SOABI for that.

    I propose to modify how Python looks for C extensions: look also for dynamic libraries without the "d" SOABI flag and for C extensions built using the stable ABI.

    Release build:

    $ ./python -c 'import _imp; print(_imp.extension_suffixes())'
    ['.cpython-38-x86_64-linux-gnu.so', '.abi3.so', '.so']

    Debug build, *WITHOUT* my change:

    $ ./python -c 'import _imp; print(_imp.extension_suffixes())'
    ['.cpython-38d-x86_64-linux-gnu.so', '.so']

    Debug build, *WITH* my change:

    $ ./python -c 'import _imp; print(_imp.extension_suffixes())'
    ['.cpython-38d-x86_64-linux-gnu.so', '.cpython-38-x86_64-linux-gnu.so', '.abi3.so', '.so']

    @vstinner vstinner added 3.8 (EOL) end of life build The build process and cross-build labels Apr 25, 2019
    @vstinner
    Copy link
    Member Author

    New changeset 5422e3c by Victor Stinner in branch 'master':
    bpo-36722: Debug build loads libraries built in release mode (GH-12952)
    5422e3c

    @vstinner
    Copy link
    Member Author

    Oh, there is an issue: --with-trace-refs has a different ABI and so should not do that.

    @vstinner
    Copy link
    Member Author

    New changeset 4046069 by Victor Stinner in branch 'master':
    bpo-36722: Add What's New entry for debug ABI (GH-12957)
    4046069

    @vstinner
    Copy link
    Member Author

    New changeset 6d13e5b by Victor Stinner in branch 'master':
    bpo-36722: Don't define ALT_SOABI for Py_TRACE_REFS build (GH-12973)
    6d13e5b

    @vstinner
    Copy link
    Member Author

    New changeset 5c403b2 by Victor Stinner (Paul Ganssle) in branch 'master':
    bpo-36722: Style and grammar edits for ABI news entries (GH-12979)
    5c403b2

    @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.8 (EOL) end of life build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant