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

gh-127253: Note that Stable ABI is about ABI stability #127254

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

encukou
Copy link
Member

@encukou encukou commented Nov 25, 2024

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news labels Nov 25, 2024
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For whatever reason, this is causing Sphinx to spam reference target not found warnings. Is that related, or a known issue?

@encukou
Copy link
Member Author

encukou commented Nov 26, 2024

Known issue: the page lists all of the limited API, some of which is still undocumented.

@encukou encukou added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Nov 27, 2024
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with one small comment.

The Stable ABI prevents ABI issues, like linker errors due to missing
symbols or data corruption due to changes in structure layouts or function
signatures.
However, other changes in Python can change the *behavior* of extensions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth adding a small example here (e.g., reference counts, per the motivating issue).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think one example would do. Reference counts are less of a motivating issue and more of the straw that broke the camel's back.

@@ -66,7 +66,7 @@ Limited C API

Python 3.2 introduced the *Limited API*, a subset of Python's C API.
Extensions that only use the Limited API can be
compiled once and work with multiple versions of Python.
compiled once and be loaded on multiple versions of Python.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to use ABI Compatible here instead of loaded on as the latter means that extension module can be loaded which may not be the case if the extension uses any function which now raises error while importing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion.
This intro is meant to communicate the intent of the limited API, rather than give the precise description. I'd rather leave the term “ABI Compatible” to the sections below, which should also clear up which “multiple versions” the extension will work with.

@encukou encukou merged commit 35d37d6 into python:main Dec 3, 2024
36 checks passed
@miss-islington-app
Copy link

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@encukou encukou deleted the stable-abi-abi-only branch December 3, 2024 12:30
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 3, 2024
…H-127254)

(cherry picked from commit 35d37d6)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 3, 2024
…H-127254)

(cherry picked from commit 35d37d6)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Dec 3, 2024

GH-127557 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Dec 3, 2024
@bedevere-app
Copy link

bedevere-app bot commented Dec 3, 2024

GH-127558 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Dec 3, 2024
encukou added a commit that referenced this pull request Dec 3, 2024
) (GH-127557)

(cherry picked from commit 35d37d6)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
encukou added a commit that referenced this pull request Dec 3, 2024
) (GH-127558)

(cherry picked from commit 35d37d6)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants