Skip to content

Commit 9f488f9

Browse files
Yhg1shugovk
andauthored
[3.13] Add the Python 3.13 abidump, and enable the ABI check. (#122583)
dd the Python 3.13 abidump, and enable the ABI check. Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent bc1e522 commit 9f488f9

File tree

3 files changed

+29613
-2
lines changed

3 files changed

+29613
-2
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,49 @@ jobs:
4040
if: fromJSON(needs.check_source.outputs.run-docs)
4141
uses: ./.github/workflows/reusable-docs.yml
4242

43+
check_abi:
44+
name: 'Check if the ABI has changed'
45+
runs-on: ubuntu-latest
46+
needs: check_source
47+
if: needs.check_source.outputs.run_tests == 'true'
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: actions/setup-python@v5
51+
- name: Install dependencies
52+
run: |
53+
sudo ./.github/workflows/posix-deps-apt.sh
54+
sudo apt-get install -yq abigail-tools
55+
- name: Build CPython
56+
env:
57+
CFLAGS: -g3 -O0
58+
run: |
59+
# Build Python with the libpython dynamic library
60+
./configure --enable-shared
61+
make -j4
62+
- name: Check for changes in the ABI
63+
id: check
64+
run: |
65+
if ! make check-abidump; then
66+
echo "Generated ABI file is not up to date."
67+
echo "Please add the release manager of this branch as a reviewer of this PR."
68+
echo ""
69+
echo "The up to date ABI file should be attached to this build as an artifact."
70+
echo ""
71+
echo "To learn more about this check: https://devguide.python.org/getting-started/setup-building/index.html#regenerate-the-abi-dump"
72+
echo ""
73+
exit 1
74+
fi
75+
- name: Generate updated ABI files
76+
if: ${{ failure() && steps.check.conclusion == 'failure' }}
77+
run: |
78+
make regen-abidump
79+
- uses: actions/upload-artifact@v4
80+
name: Publish updated ABI files
81+
if: ${{ failure() && steps.check.conclusion == 'failure' }}
82+
with:
83+
name: abi-data
84+
path: ./Doc/data/*.abi
85+
4386
check_generated_files:
4487
name: 'Check if generated files are up to date'
4588
# Don't use ubuntu-latest but a specific version to make the job

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,3 @@ Python/frozen_modules/MANIFEST
169169
/python
170170
!/Python/
171171

172-
# main branch only: ABI files are not checked/maintained.
173-
Doc/data/python*.abi

0 commit comments

Comments
 (0)