classification
Title: In debug build, load also C extensions compiled in release mode or compiled using the stable ABI
Type: Stage: resolved
Components: Build Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords: patch

Created on 2019-04-25 19:00 by vstinner, last changed 2019-04-27 18:14 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 12952 merged vstinner, 2019-04-25 19:31
PR 12957 merged vstinner, 2019-04-25 23:45
PR 12973 merged vstinner, 2019-04-26 16:13
PR 12979 merged p-ganssle, 2019-04-27 01:10
Messages (6)
msg340856 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-04-25 19:00
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']
msg340869 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-04-25 23:40
New changeset 5422e3cfb7ffc50b147b4662d6f596cd61533754 by Victor Stinner in branch 'master':
bpo-36722: Debug build loads libraries built in release mode (GH-12952)
https://github.com/python/cpython/commit/5422e3cfb7ffc50b147b4662d6f596cd61533754
msg340874 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-04-26 00:41
Oh, there is an issue: --with-trace-refs has a different ABI and so should not do that.
msg340928 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-04-26 15:56
New changeset 404606974051c5ec093312aa57cf1bcbc52e1d85 by Victor Stinner in branch 'master':
bpo-36722: Add What's New entry for debug ABI (GH-12957)
https://github.com/python/cpython/commit/404606974051c5ec093312aa57cf1bcbc52e1d85
msg340935 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-04-26 16:56
New changeset 6d13e5b35ba7165db3f38fccdd6e1e5283f96a74 by Victor Stinner in branch 'master':
bpo-36722: Don't define ALT_SOABI for Py_TRACE_REFS build (GH-12973)
https://github.com/python/cpython/commit/6d13e5b35ba7165db3f38fccdd6e1e5283f96a74
msg341007 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-04-27 18:14
New changeset 5c403b203510549a3f89d138d3265c5cc0cc12af by Victor Stinner (Paul Ganssle) in branch 'master':
bpo-36722: Style and grammar edits for ABI news entries (GH-12979)
https://github.com/python/cpython/commit/5c403b203510549a3f89d138d3265c5cc0cc12af
History
Date User Action Args
2019-04-27 18:14:38vstinnersetmessages: + msg341007
2019-04-27 01:10:44p-gansslesetpull_requests: + pull_request12905
2019-04-26 18:04:59vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-04-26 16:56:39vstinnersetmessages: + msg340935
2019-04-26 16:13:47vstinnersetpull_requests: + pull_request12900
2019-04-26 15:56:47vstinnersetmessages: + msg340928
2019-04-26 00:41:13vstinnersetmessages: + msg340874
2019-04-25 23:45:25vstinnersetpull_requests: + pull_request12883
2019-04-25 23:40:02vstinnersetmessages: + msg340869
2019-04-25 19:31:57vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request12878
2019-04-25 19:00:47vstinnercreate