-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
bpo-38326: Use Python API version as config version #16496
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-38326: Use Python API version as config version #16496
Conversation
This allows the config APIs to detect attempts to embed all potentially ABI incompatible runtime versions, rather than only being able to detect incompatibilities in the size of the PyPreConfig and PyConfig structures.
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.
I think this is an improvement. I'd like @vstinner to merge so we're clear there's mutual understanding.
/* Version of the CPython header files used to compile the embedding | ||
application. Expected to be set to PY_VERSION_HEX. | ||
Field is used to check for API and ABI compatibility. */ | ||
uint32_t header_version; |
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.
Why uint32_t
? Your PEP changes say size_t
.
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.
Typo on the PEP PR side (I renamed struct_size without fixing the type).
I proposed PR #16500 to remove struct_size. |
Closing in favour of #16500 Edit to save a click: #16500 reverts the struct_size change entirely for now. It does mean version mismatches may segfault rather than produce a nice error message, but there are other less intrusive ways for us to help with that (e.g. provide a public variant of the ABI compatibility checking function in this PR) |
This allows the config APIs to detect attempts to embed
all potentially ABI incompatible runtime versions, rather
than only being able to detect incompatibilities in the
size of the PyPreConfig and PyConfig structures.
https://bugs.python.org/issue38326