On 6/3/2018 10:55 AM, Christian Tismer wrote:
On 03.06.18 13:18, Ronald Oussoren wrote:I think Ronald is saying we're trying to answer a few questions:1. Did we accidentally drop anything from the stable ABI?2. Did we add anything to the stable ABI that we didn't mean to?3. (and one of mine): Does the stable ABI already contain things that we don't expect it to?
On 3 Jun 2018, at 12:03, Christian Tismer <firstname.lastname@example.org> wrote:
What do you mean?
I have written a script that scans all relevant header files
and analyses all sections which are reachable in the limited API
All macros that don't begin with an underscore which contain
a "->tp_" string are the locations which will break.
I found exactly 7 locations where this is the case.
My PR will contain the 7 fixes plus the analysis script
to go into tools. Preparind that in the evening.
Having tests would still be nice to detect changes to the stable ABI when they are made.
Writing those tests is quite some work though, especially if those at least smoke test the limited ABI by compiling snippets the use all symbols that should be exposed by the limited ABI. Writing those tests should be fairly simple for someone that knows how to write C extensions, but is some work.
Writing a tests that complain when the headers expose symbols that shouldn’t be exposed is harder, due to the need to parse headers (either by hacking something together using regular expressions, or by using tools like gccxml or clang’s C API).
My script does that with all "tp_*" type fields.
What else would you want to check?
That’s correct. There have been instances of the second item over the year, and not all of them have been caught before releases. What doesn’t help for all of these is that the stable ABI documentation says that every documented symbol is part of the stable ABI unless there’s explicit documentation to the contrary. This makes researching if functions are intended to be part of the stable ABI harder.
4. Does the stable ABI actually work?
Christian’s script finds cases where exposed names don’t actually work when you try to use them.