Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd9fd33a

Browse files
authored
gh-112088: Run autoreconf in GHA check_generated_files (#112090)
The "Check if generated files are up to date" job of GitHub Actionsnow runs the "autoreconf -ivf -Werror" command instead of the "makeregen-configure" command to avoid depending on the external quay.ioserver.Add Tools/build/regen-configure.sh script to regenerate the configurewith an Ubuntu container image. The"quay.io/tiran/cpython_autoconf:271" container image(https://github.com/tiran/cpython_autoconf) is no longer used.
1 parent7e2308a commitd9fd33a

File tree

9 files changed

+131
-160
lines changed

9 files changed

+131
-160
lines changed

‎.github/workflows/build.yml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ jobs:
120120

121121
check_generated_files:
122122
name:'Check if generated files are up to date'
123-
runs-on:ubuntu-latest
123+
# Don't use ubuntu-latest but a specific version to make the job
124+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
125+
runs-on:ubuntu-22.04
124126
timeout-minutes:60
125127
needs:check_source
126128
if:needs.check_source.outputs.run_tests == 'true'
@@ -143,15 +145,16 @@ jobs:
143145
-name:Check Autoconf and aclocal versions
144146
run:|
145147
grep "Generated by GNU Autoconf 2.71" configure
146-
grep "aclocal 1.16.4" aclocal.m4
148+
grep "aclocal 1.16.5" aclocal.m4
147149
grep -q "runstatedir" configure
148150
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
149151
-name:Configure CPython
150152
run:|
151153
# Build Python with the libpython dynamic library
152154
./configure --config-cache --with-pydebug --enable-shared
153-
-name:Regenerate autoconf files with container image
154-
run:make regen-configure
155+
-name:Regenerate autoconf files
156+
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
157+
run:autoreconf -ivf -Werror
155158
-name:Build CPython
156159
run:|
157160
make -j4 regen-all

‎.github/workflows/posix-deps-apt.sh‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#!/bin/sh
22
apt-get update
33

4+
# autoconf-archive is needed by autoreconf (check_generated_files job)
45
apt-get -yq install \
56
build-essential \
67
pkg-config \
8+
autoconf-archive \
79
ccache \
810
gdb \
911
lcov \

‎Doc/using/configure.rst‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,21 @@ files. Commands to regenerate all generated files::
7474
The ``Makefile.pre.in`` file documents generated files, their inputs, and tools used
7575
to regenerate them. Search for ``regen-*`` make targets.
7676

77-
The ``make regen-configure`` command runs `tiran/cpython_autoconf
78-
<https://github.com/tiran/cpython_autoconf>`_ container for reproducible build;
79-
see container ``entry.sh`` script. The container is optional, the following
80-
command can be run locally, the generated files depend on autoconf and aclocal
81-
versions::
77+
configure script
78+
----------------
79+
80+
The ``make regen-configure`` command regenerates the ``aclocal.m4`` file and
81+
the ``configure`` script using the ``Tools/build/regen-configure.sh`` shell
82+
script which uses an Ubuntu container to get the same tools versions and have a
83+
reproducible output.
84+
85+
The container is optional, the following command can be run locally::
8286

8387
autoreconf -ivf -Werror
8488

89+
The generated files can change depending on the exact ``autoconf-archive``,
90+
``aclocal`` and ``pkg-config`` versions.
91+
8592

8693
.. _configure-options:
8794

‎Makefile.pre.in‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,15 +2642,9 @@ recheck:
26422642
autoconf:
26432643
(cd $(srcdir); autoreconf -ivf -Werror)
26442644

2645-
# See https://github.com/tiran/cpython_autoconf container
26462645
.PHONY: regen-configure
26472646
regen-configure:
2648-
@if command -v podman >/dev/null; then RUNTIME="podman"; else RUNTIME="docker"; fi; \
2649-
if ! command -v $$RUNTIME; then echo "$@ needs either Podman or Docker container runtime." >&2; exit 1; fi; \
2650-
if command -v selinuxenabled >/dev/null && selinuxenabled; then OPT=":Z"; fi; \
2651-
CMD="$$RUNTIME run --rm --pull=always -v $(abs_srcdir):/src$$OPT quay.io/tiran/cpython_autoconf:271"; \
2652-
echo $$CMD; \
2653-
$$CMD || exit $?
2647+
$(srcdir)/Tools/build/regen-configure.sh
26542648

26552649
# Create a tags file for vi
26562650
tags::
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Add ``Tools/build/regen-configure.sh`` script to regenerate the ``configure``
2+
with an Ubuntu container image. The ``quay.io/tiran/cpython_autoconf:271``
3+
container image (`tiran/cpython_autoconf
4+
<https://github.com/tiran/cpython_autoconf>`_) is no longer used. Patch by
5+
Victor Stinner.

‎Tools/build/regen-configure.sh‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -x
4+
5+
# The check_generated_files job of .github/workflows/build.yml must kept in
6+
# sync with this script. Use the same container image than the job so the job
7+
# doesn't need to run autoreconf in a container.
8+
IMAGE="ubuntu:22.04"
9+
DEPENDENCIES="autotools-dev autoconf autoconf-archive pkg-config"
10+
AUTORECONF="autoreconf -ivf -Werror"
11+
12+
WORK_DIR="/src"
13+
SHELL_CMD="apt-get update && apt-get -yq install$DEPENDENCIES && cd$WORK_DIR &&$AUTORECONF"
14+
15+
abs_srcdir=$(cd$(dirname$0)/../..; pwd)
16+
17+
if podman --version&>/dev/null;then
18+
RUNTIME="podman"
19+
elif docker --version&>/dev/null;then
20+
RUNTIME="docker"
21+
else
22+
echo"$@ needs either Podman or Docker container runtime.">&2
23+
exit 1
24+
fi
25+
26+
PATH_OPT=""
27+
ifcommand -v selinuxenabled>/dev/null&& selinuxenabled;then
28+
PATH_OPT=":Z"
29+
fi
30+
31+
"$RUNTIME" run --rm -v"$abs_srcdir:$WORK_DIR$PATH_OPT""$IMAGE" /usr/bin/bash -c"$SHELL_CMD"

‎aclocal.m4‎

Lines changed: 7 additions & 75 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp