Re: [Python-Dev] libpython added to ABI tracker

2014-04-03 Thread Andrey Ponomarenko

Nick Coghlan wrote:

On 3 April 2014 00:18, Andrey Ponomarenko aponomare...@rosalab.ru wrote:

Nick Coghlan wrote:

Regarding the warnings for this one - is there a way for the checker
to warn if data structures are exposed directly, rather than as opaque
types? It's fine if there isn't, it would just be cool if there was -
one of the premises of the stable ABI is that it *doesn't* expose the
type definitions directly to consuming code, just the pointers to them
(hence allowing the struct size to change without actually breaking
compatibility with the defined ABI).


The ABI of the library can be dumped by the abi-compliance-checker basic
tool to a text file in the human readable format, so anyone can analyse it
in order to find problems of any kind.

Thanks! I've now filed http://bugs.python.org/issue21142 as an RFE -
I'll definitely be looking into setting up a regular run of this to
help us avoid any new issues with managing the evolution of the stable
ABI (and the public ABI in general).


I wrote some instructions on how to setup local ABI checker in the 
comment to issue 21142.


The main idea is to create ABI dump of the reference libpython version 
(say, 3.2) and compare it with the ABI dump of the current version. The 
ABI dump of the reference version can be stored somewhere in the source 
tree.


Thanks.

--
Andrey Ponomarenko, NTC IT ROSA.

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] libpython added to ABI tracker

2014-04-02 Thread Andrey Ponomarenko


Nick Coghlan wrote:

Regarding the warnings for this one - is there a way for the checker
to warn if data structures are exposed directly, rather than as opaque
types? It's fine if there isn't, it would just be cool if there was -
one of the premises of the stable ABI is that it *doesn't* expose the
type definitions directly to consuming code, just the pointers to them
(hence allowing the struct size to change without actually breaking
compatibility with the defined ABI).


The ABI of the library can be dumped by the abi-compliance-checker basic 
tool to a text file in the human readable format, so anyone can analyse 
it in order to find problems of any kind.


Homepage of the tool: https://github.com/lvc/abi-compliance-checker

To dump the libpython ABI type:

$ abi-compliance-checker -l libpython -dump descriptor.xml

The descriptor.xml input file ({RELPATH} - path to the python install 
tree, i.e. installation prefix):


version
3.4.0
/version

headers
{RELPATH}/include
/headers

libs
{RELPATH}/lib/libpython3.4m.so.1.0
/libs

skip_including
ast.h
Python-ast.h
asdl.h
pyexpat.h
pymactoolbox.h
/skip_including

gcc_options
-DPy_LIMITED_API=0x0302
/gcc_options

I've already created the sample dump of the libpython-3.4.0 stable ABI 
here: http://upstream-tracker.org/downloads/libpython_3.4.0.abi.tar.gz


In order to analyse data types in the ABI please read 'TypeInfo' section 
of the dump.


I see several structures with exposed definition in the stable ABI v3.4.0:

struct PyStructSequence_Desc
struct grammar
struct PyStructSequence_Field
struct _node
struct cchar_t
struct PyType_Spec
struct PyType_Slot
struct dfa
struct labellist
struct PyMethodDef
struct _Py_Identifier
struct state
struct PyVarObject
struct arc
struct label
struct PyModuleDef
struct PyModuleDef_Base
struct PyMemberDef
struct PyGetSetDef
struct _object
struct PyCursesWindowObject


Thanks.

--
Andrey Ponomarenko, NTC IT ROSA.

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] libpython added to ABI tracker

2014-04-01 Thread Andrey Ponomarenko


Nick Coghlan wrote:

On 1 Apr 2014 01:38, Victor Stinner victor.stin...@gmail.com wrote:

2014-03-31 13:38 GMT+02:00 Andrey Ponomarenko aponomare...@rosalab.ru:

The public libpython API changes will be tracked here:
http://upstream-tracker.org/versions/python_public_api.html

For now I've excluded only symbols starting with an underscore. What

other

symbols should be excluded?

It's not a matter of underscore. You should define Py_LIMITED_API to
0x0302 to test the stable ABI of Python 3.2.

http://docs.python.org/dev/c-api/stable.html

Well, we have more than one ABI, with different guarantees. The no leading
underscore one we promise not to change in maintenance releases, but we
only preserve *API* compatibility in feature releases (mostly due to
structs changing size).

The stable ABI (aka Py_LIMITED_API) is the one where we promise to hide
all the memory layout details and treat it as additive only so that
binaries built with previous releases keep working. That should never break
ABI compatibility, and only get new additions if the macro definition is
bumped up to match the newer release.

Cheers,
Nick.

P.S. I understand it was Anatoly that put the process in motion to get this
set up. Thanks for doing that Anatoly, it's a genuinely good idea.


The stable libpython ABI with Py_LIMITED_API=0x0302 will be tracked 
at http://upstream-tracker.org/versions/python_stable_api.html


I also added source-compatibility reports to the public API tracker: 
http://upstream-tracker.org/versions/python_public_api.html


Thanks.

--
Andrey Ponomarenko, NTC IT ROSA.

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] libpython added to ABI tracker

2014-03-31 Thread Andrey Ponomarenko

Hi,

Victor Stinner wrote:

Hi,

2014-03-28 9:31 GMT+01:00 Andrey Ponomarenko aponomare...@rosalab.ru:

The libpython library has been added to the ABI tracker:
http://upstream-tracker.org/versions/python.html

The page lists library versions and changes in API/ABI.

Nice!

By the way, would it be possible to add a second page for the stable
ABI of Python?

Victor


The public libpython API changes will be tracked here: 
http://upstream-tracker.org/versions/python_public_api.html


For now I've excluded only symbols starting with an underscore. What 
other symbols should be excluded?


Thanks.

--
Andrey Ponomarenko, NTC IT ROSA.

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] libpython added to ABI tracker

2014-03-28 Thread Andrey Ponomarenko

Hi,

The libpython library has been added to the ABI tracker: 
http://upstream-tracker.org/versions/python.html


The page lists library versions and changes in API/ABI.

--
Andrey Ponomarenko, NTC IT ROSA.

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com