-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
bpo-43795: Remove Py_FrozenMain from the Limited API & Stable ABI #26241
Conversation
215efd4
to
dac5c8c
Compare
See also the discussion at capi-sig: https://mail.python.org/archives/list/[email protected]/thread/5QLI3NUP3OSGLCCIBAQOTX4GEJQBWJ6F/ |
Include/pylifecycle.h
Outdated
|
||
/* Py_FrozenMain is kept out of the Limited API until documented and present | ||
in all builds of Python */ | ||
#ifndef Py_LIMITED_API | ||
PyAPI_FUNC(int) Py_FrozenMain(int argc, char **argv); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move it into Include/cpython/pylifecycle.h instead.
@@ -0,0 +1,2 @@ | |||
:c:func:`Py_FrozenMain`, is no longer considered part of the Limited API and Stable ABI, | |||
to which it was added in 3.10.0a4 (bpo-23730). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Py_FrozenMain was part of the limited C API in Python 3.9 and before, I don't get "to which it was added in 3.10.0a4", I understand that you're talking about the stable ABI. Since Python 3.10 is not released yet, maybe remove the Stable ABI part and only mention that you remove Py_FrozenMain from the limited C API? Or just write two sentences to clarify the change ;-)
Also, bpo-23730 is unrelated to Py_FrozenMain.
I like to document changes in the limited C API in https://docs.python.org/dev/whatsnew/3.10.html#c-api-changes (in the Removed section).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I find this sentence from PEP-0384: This PEP proposes to define a stable set of API functions which are guaranteed to be available for the lifetime of Python 3. Do we effect any user when the 3.10 version isn't released?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vstinner, I updated to just a single sentence.
I see "Limited API" as not well defined before 3.10, unlike the Windows stable ABI list. But just noting that it's removed works.
@shihai1991 The trouble is that the set of APIs introduced in PEP 384 wasn't maintained the way the PEP intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for documenting the removal.
I just have a comment about the What's New entry. Feel free to change it or not.
Doc/whatsnew/3.10.rst
Outdated
@@ -1919,6 +1919,11 @@ Porting to Python 3.10 | |||
instead. | |||
(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.) | |||
|
|||
* The undocumented function ``Py_FrozenMain`` has been removed from the | |||
limited API. The function is mainly useful for custom builds of Python, | |||
and it is not always present when Python is built as a shared library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"when Python is built as a shared library" the symbol is exported, do you mean the opposite? Maybe omit this sentence since I would like this issue to be fixed :-D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll remove it. But the fix could reword this, too :)
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
…thonGH-26241) Py_FrozenMain was added to the Limited C API in [bpo-42591]() (3.10.0a4); but to fix that issue it would be enough to add it to the regular C API. The function is undocumented, tests were added very recently ([bpo-44131]()), and most importantly, it is not present in all builds of Python, as the linker sometimes omits it as unused. It should be added back when these issues are fixed. Note that this does not affect Python's regular C API. (cherry picked from commit d168569) Co-authored-by: Petr Viktorin <[email protected]>
Thanks for the review! |
GH-26353 is a backport of this pull request to the 3.10 branch. |
…-26241) (GH-26353) Py_FrozenMain was added to the Limited C API in [bpo-42591]() (3.10.0a4); but to fix that issue it would be enough to add it to the regular C API. The function is undocumented, tests were added very recently ([bpo-44131]()), and most importantly, it is not present in all builds of Python, as the linker sometimes omits it as unused. It should be added back when these issues are fixed. Note that this does not affect Python's regular C API. (cherry picked from commit d168569) Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
Py_FrozenMain was added to the Limited C API in bpo-42591 (3.10.0a4);
but to fix that issue it would be enough to add it to the regular C API.
The function is undocumented, tests were added very recently (bpo-44131),
and most importantly, it is not present in all builds of Python, as
the linker sometimes omits it as unused.
It should be added back when these issues are fixed.
Note that this does not affect Python's regular C API.
https://bugs.python.org/issue43795
Automerge-Triggered-By: GH:encukou