Skip to content

Commit 4caee14

Browse files
authored
[3.15] Forward-port 'check-abi' CI job from 3.14 (GH-149517)
Also add the python3.15.abi file as generated by the new job and remove the 'main branch only' entry from .gitignore. (adapted from commit 0eb2291)
1 parent e81025e commit 4caee14

3 files changed

Lines changed: 33538 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,53 @@ jobs:
4949
if: fromJSON(needs.build-context.outputs.run-docs)
5050
uses: ./.github/workflows/reusable-docs.yml
5151

52+
check-abi:
53+
name: 'Check if the ABI has changed'
54+
runs-on: ubuntu-22.04 # 24.04 causes spurious errors
55+
needs: build-context
56+
if: needs.build-context.outputs.run-tests == 'true'
57+
steps:
58+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
59+
with:
60+
persist-credentials: false
61+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
62+
with:
63+
python-version: '3.x'
64+
- name: Install dependencies
65+
run: |
66+
sudo ./.github/workflows/posix-deps-apt.sh
67+
sudo apt-get install -yq --no-install-recommends abigail-tools
68+
- name: Build CPython
69+
env:
70+
CFLAGS: -g3 -O0
71+
run: |
72+
# Build Python with the libpython dynamic library
73+
./configure --enable-shared
74+
make -j4
75+
- name: Check for changes in the ABI
76+
id: check
77+
run: |
78+
if ! make check-abidump; then
79+
echo "Generated ABI file is not up to date."
80+
echo "Please add the release manager of this branch as a reviewer of this PR."
81+
echo ""
82+
echo "The up to date ABI file should be attached to this build as an artifact."
83+
echo ""
84+
echo "To learn more about this check: https://devguide.python.org/getting-started/setup-building/index.html#regenerate-the-abi-dump"
85+
echo ""
86+
exit 1
87+
fi
88+
- name: Generate updated ABI files
89+
if: ${{ failure() && steps.check.conclusion == 'failure' }}
90+
run: |
91+
make regen-abidump
92+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
93+
name: Publish updated ABI files
94+
if: ${{ failure() && steps.check.conclusion == 'failure' }}
95+
with:
96+
name: abi-data
97+
path: ./Doc/data/*.abi
98+
5299
check-autoconf-regen:
53100
name: 'Check if Autoconf files are up to date'
54101
# Don't use ubuntu-latest but a specific version to make the job

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,3 @@ Python/frozen_modules/MANIFEST
177177
# People's custom https://docs.anthropic.com/en/docs/claude-code/memory configs.
178178
/.claude/
179179
CLAUDE.local.md
180-
181-
#### main branch only stuff below this line, things to backport go above. ####
182-
# main branch only: ABI files are not checked/maintained.
183-
Doc/data/python*.abi

0 commit comments

Comments
 (0)