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

Support Python 3.8 in python3-sys. #187

Merged
merged 1 commit into from
Nov 13, 2019
Merged

Support Python 3.8 in python3-sys. #187

merged 1 commit into from
Nov 13, 2019

Conversation

dgrunwald
Copy link
Owner

@dgrunwald dgrunwald commented Nov 3, 2019

This time around the diff between the Python 3.7.0 and Python 3.8.0 headers was non-trivial; because several parts of the non-limited API were moved around (mostly to the new internal Include/cpython/*.h headers).
So it's quite possible that I missed some relevant changes.

It turned out that rust-cpython mostly already works without these changes (enough that all our tests except for check_symbols.py pass on Python 3.8 without this PR!).
PyCodeObject is obviously broken without this PR, but it's unused in rust-cpython.
PyTypeObject is a bit more tricky, but in the usual case we're saved because we don't set _Py_TPFLAGS_HAVE_VECTORCALL, so an out-of-bounds read should not happen. Only in the rare case when compiling against a Python interpreter using the COUNT_ALLOCS mode it's important to have exactly the correct PyTypeObject definition.

@dgrunwald
Copy link
Owner Author

Going forward we should consider using only the PY_LIMITED_API in the cpython crate. This would allow building extension modules where a single binary is compatible with multiple major Python versions.
A blocker here was that some important functionality like PyIter_Check was only available via macros that required the full API; but at least this particular case was finally fixed in Python 3.8.
I haven't checked yet if there are any other problematic cases.

@dgrunwald dgrunwald merged commit 76cc1ff into master Nov 13, 2019
@dgrunwald dgrunwald deleted the py38 branch October 12, 2020 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant