[issue43725] Create a release branch ABI stability regression test

STINNER Victor report at bugs.python.org
Wed Apr 28 10:36:47 EDT 2021


STINNER Victor <vstinner at python.org> added the comment:

I cannot merge my PR 25685 because the mandatory ABI CI job fails:
---------------
abidiff "libpython3.9.so" ./Doc/data/python3.9.abi --drop-private-types --no-architecture --no-added-syms
Functions changes summary: 0 Removed, 1 Changed, 0 Added function
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

1 function with some indirect sub-type change:

  [C]'function int _PyInterpreterState_IDIncref(PyInterpreterState*)' at pystate.c:497:1 has some indirect sub-type changes:
    return type changed:
      type name changed from 'int' to 'void'
      type size changed from 32 to 0 (in bits)
---------------

It is correct that my PR changes an internal C API on purpose.


Pablo suggests me to regenerate the ABI file but I don't know how to do that.


In Python 3.9, the GitHub Action uses:
---
  check_abi:
    name: 'Check if the ABI has changed'
    runs-on: ubuntu-20.04
    needs: check_source
    if: needs.check_source.outputs.run_tests == 'true'
    steps:
      - uses: actions/checkout at v2
      - uses: actions/setup-python at v2
      - name: Install Dependencies
        run: |
            sudo ./.github/workflows/posix-deps-apt.sh
            sudo apt-get install -yq abigail-tools
      - name: Build CPython
        env:
          CFLAGS: -g3 -O0
        run: |
          # Build Python with the libpython dynamic library
          ./configure --enable-shared
          make -j4
      - name: Check for changes in the ABI
        run: make check-abidump
---

I'm using Fedora 33 with "gcc (GCC) 11.0.1 20210324 (Red Hat 11.0.1-0)".

On Fedora, I used:
---
$ sudo dnf install -y libabigail
$ ./configure --enable-shared CFLAGS="-g3 -O0" && make -j10
$ make regen-abidump
$ git diff --stat
 Doc/data/python3.9.abi | 28478 +++++++++++++++++++++++++++++++++-------------------
 1 file changed, 18306 insertions(+), 10172 deletions(-)
---

There are tons of changes!

Also, "make check-abidump" lists many changes:
---
abidiff "libpython3.9.so" ./Doc/data/python3.9.abi --drop-private-types --no-architecture --no-added-syms
Functions changes summary: 0 Removed, 13 Changed (171 filtered out), 0 Added functions
Variables changes summary: 0 Removed, 6 Changed (2 filtered out), 0 Added variables

13 functions with some indirect sub-type change:
(...)
  [C] 'function PyStatus _PyInterpreterState_Enable(_PyRuntimeState*)' at pystate.c:171:1 has some indirect sub-type changes:

  [C] 'function int _Py_DecodeLocaleEx(const char*, wchar_t**, size_t*, const char**, int, _Py_error_handler)' at fileutils.c:574:1 has some indirect sub-type changes:
    parameter 6 of type 'typedef _Py_error_handler' has sub-type changes:

  [C] 'const unsigned char _Py_ctype_tolower[256]' was changed to 'const unsigned char[256] const _Py_ctype_tolower' at pyctype.h:26:1:
    type of variable changed:
      entity changed from 'const unsigned char[256]' to 'const unsigned char[256] const'
(...)
---

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43725>
_______________________________________


More information about the Python-bugs-list mailing list