[Python-Dev] What version is an extension module binary compatible with

Miro Hrončok mhroncok at redhat.com
Tue Mar 28 07:24:55 EDT 2017


as per [0], ABI of the C API is generally not stable and the binary 
compatibility may break between versions. It is hard from the text to 
know whether it talks about minor versions (such as 3.6 vs 3.5) or patch 
versions (such as 3.6.1 vs 3.6.0).

In Fedora we currently only keep track about the minor version 
dependency. I.e. an RPM package with a Python module depends on Python 
3.6, not specifically on Python 3.6.1.

However, recently we found an issue with this approach [1]: an extension 
module built against Python 3.6.1 cannot be run on Python 3.6.0, because 
it uses a macro that, in 3.6.1, uses the new PySlice_AdjustIndices function.

I'd like some clarification on what ABI compatibility we can expect.
  * Should the ABI be stable across patch releases (so calling 
PySlice_AdjustIndices from an existing macro would be a bug)?
  * Should the ABI be forward-compatible within a minor release (so 
modules built for 3.6.0 should be usable with 3.6.1, but not vice versa)?
  * Or should we expect the ABI to change even across patch releases?

It would be nice to say this explicitly in the docs ([0] or another 
suitable place).

[0] https://docs.python.org/3/c-api/stable.html
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1435135

Thanks for clarification,
On behalf of the Fedora Python SIG,
Miro Hrončok
Phone: +420777974800
IRC: mhroncok

More information about the Python-Dev mailing list