GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Create a release branch ABI stability regression test · Issue #87891 · python/cpython

Create a release branch ABI stability regression test #87891

New issue
Copy link
New issue
Copy link
Closed
Closed
Create a release branch ABI stability regression test#87891
Copy link
Labels
3.10 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifebuildThe build process and cross-buildThe build process and cross-buildinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)testsTests in the Lib/test dirTests in the Lib/test dirtopic-C-APItype-featureA feature request or enhancementA feature request or enhancement

Description

@gpshead
gpshead
opened on Apr 4, 2021
Issue body actions
BPO 43725
Nosy @gpshead, @vstinner, @tiran, @ned-deily, @encukou, @ambv, @zooba, @pablogsal
PRs
  • bpo-43725: Add CI step to check changes in the exported ABI #25188
  • [3.9] bpo-43725: Add CI step to check changes in the exported ABI #25230
  • [3.8] bpo-43725: Add CI step to check changes in the exported ABI #25232
  • [3.8] bpo-43725: Add ignore file for the abidump check #25322
  • [3.9] bpo-43725: Add ignore file for the abidump check #25323
  • [3.9] Revert "[3.9] bpo-43725: Add ignore file for the abidump check" #25394
  • Files
  • compat_report.html
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2021-04-04.04:35:13.558>
    labels = ['build', '3.8', '3.9', 'expert-C-API', 'type-feature', 'tests', 'interpreter-core', '3.10']
    title = 'Create a release branch ABI stability regression test'
    updated_at = <Date 2021-10-15.14:16:28.469>
    user = 'https://github.com/gpshead'

    bugs.python.org fields:

    activity = <Date 2021-10-15.14:16:28.469>
    actor = 'pablogsal'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Build', 'Interpreter Core', 'Tests', 'C API']
    creation = <Date 2021-04-04.04:35:13.558>
    creator = 'gregory.p.smith'
    dependencies = []
    files = ['49935']
    hgrepos = []
    issue_num = 43725
    keywords = ['patch']
    message_count = 36.0
    messages = ['390173', '390184', '390203', '390205', '390207', '390208', '390213', '390214', '390310', '390311', '390312', '390313', '390315', '390316', '390319', '390325', '390372', '390374', '390382', '390660', '390668', '390670', '390985', '390986', '390987', '390994', '391007', '391008', '391009', '391010', '391011', '392205', '392207', '392208', '404019', '404022']
    nosy_count = 8.0
    nosy_names = ['gregory.p.smith', 'vstinner', 'christian.heimes', 'ned.deily', 'petr.viktorin', 'lukasz.langa', 'steve.dower', 'pablogsal']
    pr_nums = ['25188', '25230', '25232', '25322', '25323', '25394']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue43725'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    Linked PRs

    • [3.12] gh-87891: Add ABI check to CI #104793

    Activity

    Next
    1. gpshead commented on Apr 4, 2021

      @gpshead
      gpshead
      on Apr 4, 2021
      MemberAuthor
      More actions

      In order to automate prevention of ABI regressions in stable releases, we could create an automated ABI stability test generator and check the specific ABI test it generates into each specific release branch.

      I'm envisioning the main branch only having a code generator that creates such a test, and the release branches only having the output of that as Lib/tests/release_X_Y_ABI_stability_test.py and a policy of never updating that within a release branch without *extreme* attention to detail.

      Such updates wouldn't happen by default in our current workflow as they're unique and versioned in every release branch so automated backport PRs wouldn't touch them - leaving CI to run them and highlight failures on attempted backports to do inadvertently cause an ABI shift.

    2. gpshead
      added
      3.8 (EOL)end of lifeend of life
      3.9 (EOL)end of lifeend of life
      3.10 (EOL)end of lifeend of life
      buildThe build process and cross-buildThe build process and cross-build
      interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
      testsTests in the Lib/test dirTests in the Lib/test dir
      topic-C-API
      type-featureA feature request or enhancementA feature request or enhancement
      on Apr 4, 2021
    3. 26 remaining items

    4. pablogsal commented on Apr 13, 2021

      @pablogsal
      pablogsal
      on Apr 13, 2021
      Member
      More actions

      Ok, then we need to revert by latest 2 PRs and add a new label or something to skip

    5. vstinner commented on Apr 13, 2021

      @vstinner
      vstinner
      on Apr 13, 2021
      Member
      More actions

      Ok, then we need to revert by latest 2 PRs and add a new label or something to skip

      To skip ABI tests? I proposed to ignore ABI changes if they can be ignored safely. But I don't know right now which changes can be ignored or not.

    6. pablogsal commented on Apr 13, 2021

      @pablogsal
      pablogsal
      on Apr 13, 2021
      Member
      More actions

      To skip ABI tests? I proposed to ignore ABI changes if they can be ignored safely. But I don't know right now which changes can be ignored or not.

      As the situation stands we need to choose on keeping my changes to ignore _Py function changes or revert it. Further than that is unexplored land

    7. pablogsal commented on Apr 13, 2021

      @pablogsal
      pablogsal
      on Apr 13, 2021
      Member
      More actions

      $ objdump -T /lib64/libpython3.10.so.1.0|grep _Py_M__importlib_bootstrap_external
      # empty output

      This was happening on 3.8 Victor:

      root@d9c5942e274b:/src# objdump -T libpython3.8.so | grep _Py_M__importlib_bootstrap_external
      0000000000335740 g DO .rodata 000000000000b062 Base _Py_M__importlib_bootstrap_external

    8. pablogsal commented on Apr 13, 2021

      @pablogsal
      pablogsal
      on Apr 13, 2021
      Member
      More actions

      I am going to revert the 3.9 PR as 3.9+ is hiding symbols by default.

    9. vstinner commented on Apr 13, 2021

      @vstinner
      vstinner
      on Apr 13, 2021
      Member
      More actions

      I got a false positive on my PR at https://github.com/python/cpython/pull/25318/checks?check_run_id=2308871807

      Oh, this CI failure was on Python 3.8.

      Since Python 3.9, Python is now built with -fvisibility=hidden to avoid exporting symbols which are not explicitly exported. So in 3.9, we no longer have to ignore all symbols prefixed by "_Py".

    10. vstinner commented on Apr 28, 2021

      @vstinner
      vstinner
      on Apr 28, 2021
      Member
      More actions

      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@v2
      - uses: actions/setup-python@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'
      (...)
      ---

    11. pablogsal commented on Apr 28, 2021

      @pablogsal
      pablogsal
      on Apr 28, 2021
      Member
      More actions

      As I mentioned here:

      https://bugs.python.org/msg390213

      the dump needs to be generated in a docker container using the same compiler version that is used in the CI

    12. pablogsal commented on Apr 28, 2021

      @pablogsal
      pablogsal
      on Apr 28, 2021
      Member
      More actions

      You are using Fedora, which is not the same docker container and likely the same compiler version that is used to check the dump

    13. vstinner commented on Oct 15, 2021

      @vstinner
      vstinner
      on Oct 15, 2021
      Member
      More actions

      the dump needs to be generated in a docker container using the same compiler version that is used in the CI

      I'm not used to docker and I don't know how to get a docker similar than the one used by GitHub Action. Is there a documentation somewhere giving commands to get the docker image and how to run it?

    14. pablogsal commented on Oct 15, 2021

      @pablogsal
      pablogsal
      on Oct 15, 2021
      Member
      More actions

      I will add something to the devguide explaining how to do it. In any case, the RM should be ideally the one doing this because every potential ABI breakage need to be supervised by the RM (even if is a false positive).

    15. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    16. CAM-Gerlach commented on May 23, 2023

      @CAM-Gerlach
      CAM-Gerlach
      on May 23, 2023
      Member
      More actions

      Can this be closed now? Seems like this was implemented (came across this seeing that it apparently needs to be added for 3.12 just now).

    17. Yhg1s
      added a commit that references this issue on May 23, 2023

      [3.12] gh-87891: Add ABI check to CI (#104793)

      b44beac
    18. pablogsal
      closed this as completedon May 23, 2023
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifebuildThe build process and cross-buildThe build process and cross-buildinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)testsTests in the Lib/test dirTests in the Lib/test dirtopic-C-APItype-featureA feature request or enhancementA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        You are visitor 01402503 — GeezerVison does not store the pages you look up.
        Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.