GeezerVison is showing github.com — gh-112088: Run autoreconf in GHA check_generated_files by vstinner · Pull Request #112090 · python/cpython
gh-112088: Run autoreconf in GHA check_generated_files
#112090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement . We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Uh oh!
There was an error while loading. Please reload this page.
Show file tree
Hide file tree
Changes from all commits
Commits
File filter
Filter by extension
.ac
(1)
.in
(1)
.m4
(1)
.rst
(2)
.sh
(2)
.yml
(1)
No extension
(1)
All 7 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Hide whitespace
Diff view
Hide whitespace
There are no files selected for viewing
Original file line number
Diff line number
Diff line change
Expand Up
@@ -120,7 +120,9 @@ jobs:
check_generated_files :
name : ' Check if generated files are up to date'
runs-on : ubuntu-latest
# 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'
Expand All
@@ -143,15 +145,16 @@ jobs:
- name : Check Autoconf and aclocal versions
run : |
grep "Generated by GNU Autoconf 2.71" configure
grep "aclocal 1.16.4 " aclocal.m4
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 with container image
run : make regen-configure
- 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
Expand Down
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,11 @@
#! /bin/sh
apt-get update
# autoconf-archive is needed by autoreconf (check_generated_files job)
apt-get -yq install \
build-essential \
pkg-config \
autoconf-archive \
ccache \
gdb \
lcov \
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -74,14 +74,21 @@ files. Commands to regenerate all generated files::
The ``Makefile.pre.in `` file documents generated files, their inputs, and tools used
to regenerate them. Search for ``regen-* `` make targets.
The ``make regen-configure `` command runs `tiran/cpython_autoconf
<https://github.com/tiran/cpython_autoconf> `_ container for reproducible build;
see container ``entry.sh `` script. The container is optional, the following
command can be run locally, the generated files depend on autoconf and aclocal
versions::
configure script
----------------
The ``make regen-configure `` command regenerates the ``aclocal.m4 `` file and
the ``configure `` script using the ``Tools/build/regen-configure.sh `` shell
script which uses an Ubuntu container to get the same tools versions and have a
reproducible output.
The container is optional, the following command can be run locally::
autoreconf -ivf -Werror
The generated files can change depending on the exact ``autoconf-archive ``,
``aclocal `` and ``pkg-config `` versions.
.. _configure-options :
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -2642,15 +2642,9 @@ recheck:
autoconf:
(cd $(srcdir); autoreconf -ivf -Werror)
# See https://github.com/tiran/cpython_autoconf container
.PHONY: regen-configure
regen-configure:
@if command -v podman >/dev/null; then RUNTIME="podman"; else RUNTIME="docker"; fi; \
if ! command -v $$RUNTIME; then echo "$@ needs either Podman or Docker container runtime." >&2; exit 1; fi; \
if command -v selinuxenabled >/dev/null && selinuxenabled; then OPT=":Z"; fi; \
CMD="$$RUNTIME run --rm --pull=always -v $(abs_srcdir):/src$$OPT quay.io/tiran/cpython_autoconf:271"; \
echo $$CMD; \
$$CMD || exit $?
$(srcdir)/Tools/build/regen-configure.sh
# Create a tags file for vi
tags::
Expand Down
Original file line number
Diff line number
Diff line change
@@ -0,0 +1,5 @@
Add ``Tools/build/regen-configure.sh `` script to regenerate the ``configure ``
with an Ubuntu container image. The ``quay.io/tiran/cpython_autoconf:271 ``
container image (`tiran/cpython_autoconf
<https://github.com/tiran/cpython_autoconf> `_) is no longer used. Patch by
Victor Stinner.
Original file line number
Diff line number
Diff line change
@@ -0,0 +1,31 @@
#! /usr/bin/env bash
set -e -x
# The check_generated_files job of .github/workflows/build.yml must kept in
# sync with this script. Use the same container image than the job so the job
# doesn't need to run autoreconf in a container.
IMAGE=" ubuntu:22.04"
DEPENDENCIES=" autotools-dev autoconf autoconf-archive pkg-config"
AUTORECONF=" autoreconf -ivf -Werror"
WORK_DIR=" /src"
SHELL_CMD=" apt-get update && apt-get -yq install $DEPENDENCIES && cd $WORK_DIR && $AUTORECONF "
abs_srcdir=$( cd $( dirname $0 ) /../..; pwd)
if podman --version & > /dev/null; then
RUNTIME=" podman"
elif docker --version & > /dev/null; then
RUNTIME=" docker"
else
echo " $@ needs either Podman or Docker container runtime." >&2
exit 1
fi
PATH_OPT=" "
if command -v selinuxenabled > /dev/null && selinuxenabled; then
PATH_OPT=" :Z"
fi
" $RUNTIME " run --rm -v " $abs_srcdir :$WORK_DIR$PATH_OPT " " $IMAGE " /usr/bin/bash -c " $SHELL_CMD "
82 changes: 7 additions & 75 deletions
82
aclocal.m4
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.