From 50f371951f7557c4a953fae90fa39396165eeed1 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sun, 20 Oct 2024 10:40:17 +0900 Subject: [PATCH 1/7] gh-125741: Update check_generated_files CI to use our published container image --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec7904c2e2cc73..5a494e42aea9cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,8 @@ jobs: name: 'Check if generated files are up to date' # Don't use ubuntu-latest but a specific version to make the job # reproducible: to get the same tools versions (autoconf, aclocal, ...) - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 + container: ghcr.io/python/autoconf:2024.10.11.11293396815 timeout-minutes: 60 needs: check_source if: needs.check_source.outputs.run_tests == 'true' From 55839aa7c566ba77b23e704ea12ab3fc805b0d0b Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sun, 20 Oct 2024 10:44:45 +0900 Subject: [PATCH 2/7] Remove sudo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a494e42aea9cf..a3ea9b4da75b2e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,7 +63,7 @@ jobs: # Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }} - name: Install Dependencies - run: sudo ./.github/workflows/posix-deps-apt.sh + run: ./.github/workflows/posix-deps-apt.sh - name: Add ccache to PATH run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV - name: Configure ccache action From 3a548720f0eff16f9092c035546132e9bc1e8366 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sun, 20 Oct 2024 10:52:48 +0900 Subject: [PATCH 3/7] Test ENV DEBIAN_FRONTEND noninteractive --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3ea9b4da75b2e..81c47eec9a5c91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,10 @@ jobs: # Don't use ubuntu-latest but a specific version to make the job # reproducible: to get the same tools versions (autoconf, aclocal, ...) runs-on: ubuntu-24.04 - container: ghcr.io/python/autoconf:2024.10.11.11293396815 + container: + image: ghcr.io/python/autoconf:2024.10.11.11293396815 + env: + DEBIAN_FRONTEND: noninteractive timeout-minutes: 60 needs: check_source if: needs.check_source.outputs.run_tests == 'true' From 43969560dbf5782f5dd6a1ef7065f41d4482a77d Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sun, 20 Oct 2024 10:59:46 +0900 Subject: [PATCH 4/7] Separate workflow for autoconf temporary --- .github/workflows/build.yml | 59 ++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81c47eec9a5c91..546a0dc6b44228 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,15 +40,55 @@ jobs: if: fromJSON(needs.check_source.outputs.run-docs) uses: ./.github/workflows/reusable-docs.yml - check_generated_files: - name: 'Check if generated files are up to date' + check_autoconf_regen: + name: 'Check if Autoconf files are up to date' # Don't use ubuntu-latest but a specific version to make the job # reproducible: to get the same tools versions (autoconf, aclocal, ...) runs-on: ubuntu-24.04 container: image: ghcr.io/python/autoconf:2024.10.11.11293396815 - env: - DEBIAN_FRONTEND: noninteractive + timeout-minutes: 60 + needs: check_source + if: needs.check_source.outputs.run_tests == 'true' + steps: + - name: Install git + run: | + apt install git -yq + git config --global --add safe.directory "$GITHUB_WORKSPACE" + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Runner image version + run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV + - name: Check Autoconf and aclocal versions + run: | + grep "Generated by GNU Autoconf 2.71" configure + grep "aclocal 1.16.5" aclocal.m4 + grep -q "runstatedir" configure + grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4 + - name: Regenerate autoconf files + # Same command used by Tools/build/regen-configure.sh ($AUTORECONF) + run: autoreconf -ivf -Werror + - name: Check for changes + run: | + git add -u + changes=$(git status --porcelain) + # Check for changes in regenerated files + 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 version of autoconf." + echo "$changes" + echo "" + git diff --staged || true + exit 1 + fi + + check_generated_files: + name: 'Check if generated files are up to date' + # Don't use ubuntu-latest but a specific version to make the job + # reproducible: to get the same tools versions (autoconf, aclocal, ...) + runs-on: ubuntu-22.04 timeout-minutes: 60 needs: check_source if: needs.check_source.outputs.run_tests == 'true' @@ -66,26 +106,17 @@ jobs: # Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }} - name: Install Dependencies - run: ./.github/workflows/posix-deps-apt.sh + 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.2 with: save: false - - name: Check Autoconf and aclocal versions - run: | - grep "Generated by GNU Autoconf 2.71" configure - grep "aclocal 1.16.5" aclocal.m4 - grep -q "runstatedir" configure - grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4 - name: Configure CPython run: | # Build Python with the libpython dynamic library ./configure --config-cache --with-pydebug --enable-shared - - name: Regenerate autoconf files - # Same command used by Tools/build/regen-configure.sh ($AUTORECONF) - run: autoreconf -ivf -Werror - name: Build CPython run: | make -j4 regen-all From ecb52999dcd0f53c96dc643852c7127ac2d9cbc8 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sun, 20 Oct 2024 11:31:36 +0900 Subject: [PATCH 5/7] Verify different image files --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 546a0dc6b44228..194483b019d20f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,7 @@ jobs: # reproducible: to get the same tools versions (autoconf, aclocal, ...) runs-on: ubuntu-24.04 container: - image: ghcr.io/python/autoconf:2024.10.11.11293396815 + image: ghcr.io/python/autoconf:2024.10.19.11417401087 timeout-minutes: 60 needs: check_source if: needs.check_source.outputs.run_tests == 'true' From f84402b79290708eb7b3a81fd8326ec8a614efa8 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sun, 20 Oct 2024 11:33:19 +0900 Subject: [PATCH 6/7] Revert "Verify different image files" This reverts commit ecb52999dcd0f53c96dc643852c7127ac2d9cbc8. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 194483b019d20f..546a0dc6b44228 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,7 @@ jobs: # reproducible: to get the same tools versions (autoconf, aclocal, ...) runs-on: ubuntu-24.04 container: - image: ghcr.io/python/autoconf:2024.10.19.11417401087 + image: ghcr.io/python/autoconf:2024.10.11.11293396815 timeout-minutes: 60 needs: check_source if: needs.check_source.outputs.run_tests == 'true' From 91a4f55de66f067db3dba97be015bfb97663df64 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sun, 20 Oct 2024 16:30:16 +0900 Subject: [PATCH 7/7] Update .github/workflows/build.yml Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 546a0dc6b44228..a72d4a1bb97cb9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,7 @@ jobs: needs: check_source if: needs.check_source.outputs.run_tests == 'true' steps: - - name: Install git + - name: Install Git run: | apt install git -yq git config --global --add safe.directory "$GITHUB_WORKSPACE"