From 36b80386e12a7a644da00663c04296a72718bedb Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 6 Dec 2021 09:18:24 +0100 Subject: [PATCH 1/2] bpo-44035: Check autoconf files thoroughly Check that users don't push changes with outdated or patched autoconf. The presence of runstatedir option and aclocal 1.16.3 are good markers. Use my container image to regenerate autoconf files. "Check for changes" will fail later when any file is regenerated. Use ccache in check_generated_files to speed up testing. Signed-off-by: Christian Heimes --- .github/workflows/build.yml | 18 ++++++++++++++---- .gitignore | 2 ++ .../2021-12-06-09-31-27.bpo-44035.BiO4XC.rst | 2 ++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2021-12-06-09-31-27.bpo-44035.BiO4XC.rst diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbf7bb6fe2128a..1826f469d05040 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,6 +64,20 @@ jobs: - uses: actions/setup-python@v2 - name: Install Dependencies run: sudo ./.github/workflows/posix-deps-apt.sh + - name: Add ccache to PATH + run: | + echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV + - name: Configure ccache action + uses: hendrikmuhs/ccache-action@v1 + - name: Check Autoconf version 2.69 and aclocal 1.16.3 + run: | + set -e + grep "Generated by GNU Autoconf 2.69" configure + grep "runstatedir" configure + grep "PKG_PROG_PKG_CONFIG" aclocal.m4 + grep "aclocal 1.16.3" aclocal.m4 + - name: Regenerate autoconf files + run: docker run --rm -v $(pwd):/src quay.io/tiran/cpython_autoconf:269 - name: Build CPython run: | # Build Python with the libpython dynamic library @@ -85,10 +99,6 @@ jobs: run: make smelly - name: Check limited ABI symbols run: make check-limited-abi - - name: Check Autoconf version 2.69 - run: | - grep "Generated by GNU Autoconf 2.69" configure - grep "PKG_PROG_PKG_CONFIG" aclocal.m4 build_win32: name: 'Windows (x86)' diff --git a/.gitignore b/.gitignore index cfd3163cd1818d..39de8410200ce4 100644 --- a/.gitignore +++ b/.gitignore @@ -115,6 +115,8 @@ Tools/unicode/data/ /config.log /config.status /config.status.lineno +# hendrikmuhs/ccache-action@v1 +/.ccache /platform /profile-clean-stamp /profile-run-stamp diff --git a/Misc/NEWS.d/next/Build/2021-12-06-09-31-27.bpo-44035.BiO4XC.rst b/Misc/NEWS.d/next/Build/2021-12-06-09-31-27.bpo-44035.BiO4XC.rst new file mode 100644 index 00000000000000..7530587b73d140 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-12-06-09-31-27.bpo-44035.BiO4XC.rst @@ -0,0 +1,2 @@ +CI now verifies that autoconf files have been regenerated with a current and +unpatched autoconf package. From 5a1f0b85c181a779c8d75060dd5fc143f7a2f250 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 6 Dec 2021 11:44:04 +0100 Subject: [PATCH 2/2] Address review comments --- .github/workflows/build.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1826f469d05040..99f05f3abec936 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,17 +65,15 @@ jobs: - name: Install Dependencies run: sudo ./.github/workflows/posix-deps-apt.sh - name: Add ccache to PATH - run: | - echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV + run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV - name: Configure ccache action uses: hendrikmuhs/ccache-action@v1 - name: Check Autoconf version 2.69 and aclocal 1.16.3 run: | - set -e grep "Generated by GNU Autoconf 2.69" configure - grep "runstatedir" configure - grep "PKG_PROG_PKG_CONFIG" aclocal.m4 grep "aclocal 1.16.3" aclocal.m4 + grep -q "runstatedir" configure + grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4 - name: Regenerate autoconf files run: docker run --rm -v $(pwd):/src quay.io/tiran/cpython_autoconf:269 - name: Build CPython @@ -89,9 +87,10 @@ jobs: git add -u changes=$(git status --porcelain) # Check for changes in regenerated files - if ! test -z "$changes" - then - echo "Generated files not up to date. Perhaps you forgot to run make regen-all or build.bat --regen ;)" + if test -n "$changes"; then + echo "Generated files not up to date." + echo "Perhaps you forgot to run make regen-all or build.bat --regen. ;)" + echo "configure files must be regenerated with a specific, unpatched version of autoconf." echo "$changes" exit 1 fi