Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed

Conversation

ncoghlan
Copy link
Contributor

@ncoghlan ncoghlan commented Sep 30, 2019

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

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.
Copy link
Contributor

@ambv ambv left a 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;
Copy link
Member

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.

Copy link
Contributor Author

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).

@vstinner
Copy link
Member

I proposed PR #16500 to remove struct_size.

@ncoghlan
Copy link
Contributor Author

ncoghlan commented Sep 30, 2019

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)

@ncoghlan ncoghlan closed this Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants