[Python-checkins] bpo-46973: Add regen-configure make target (GH-31792)

tiran webhook-mailer at python.org
Thu Mar 10 12:03:38 EST 2022


https://github.com/python/cpython/commit/434ffb7f1f86e6b0cdfad3ede59993934d86e464
commit: 434ffb7f1f86e6b0cdfad3ede59993934d86e464
branch: main
author: Christian Heimes <christian at python.org>
committer: tiran <christian at python.org>
date: 2022年03月10日T18:03:27+01:00
summary:
bpo-46973: Add regen-configure make target (GH-31792)
files:
A Misc/NEWS.d/next/Build/2022-03-10-14-30-39.bpo-46973._LEvnc.rst
M .github/workflows/build.yml
M Makefile.pre.in
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f6df74357d2f5..8b1709d37f9aa 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -74,12 +74,14 @@ jobs:
 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
+ - name: Configure CPython
 run: |
 # Build Python with the libpython dynamic library
 ./configure --with-pydebug --enable-shared
+ - name: Regenerate autoconf files with container image
+ run: make regen-configure
+ - name: Build CPython
+ run: |
 make -j4 regen-all
 make regen-stdlib-module-names
 - name: Check for changes
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 9deffadb8881d..c4034dc248c65 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1196,7 +1196,7 @@ regen-all: regen-opcode regen-opcode-targets regen-typeslots \
 	regen-pegen-metaparser regen-pegen regen-test-frozenmain \
 	regen-global-objects
 	@echo
-	@echo "Note: make regen-stdlib-module-names and make autoconf should be run manually"
+	@echo "Note: make regen-stdlib-module-names and make regen-configure should be run manually"
 
 ############################################################################
 # Special rules for object files
@@ -2294,10 +2294,16 @@ recheck:
 # Regenerate configure and pyconfig.h.in
 .PHONY: autoconf
 autoconf:
-	# Regenerate the configure script from configure.ac using autoconf
-	(cd $(srcdir); autoconf -Wall)
-	# Regenerate pyconfig.h.in from configure.ac using autoheader
-	(cd $(srcdir); autoheader -Wall)
+	(cd $(srcdir); autoreconf -ivf -Werror)
+
+.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:269"; \
+	echo $$CMD; \
+	$$CMD || exit $?
 
 # Create a tags file for vi
 tags::
diff --git a/Misc/NEWS.d/next/Build/2022-03-10-14-30-39.bpo-46973._LEvnc.rst b/Misc/NEWS.d/next/Build/2022-03-10-14-30-39.bpo-46973._LEvnc.rst
new file mode 100644
index 0000000000000..62d71d15fdcd2
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2022-03-10-14-30-39.bpo-46973._LEvnc.rst
@@ -0,0 +1,2 @@
+Add ``regen-configure`` make target to regenerate configure script with
+Christian's container image ``quay.io/tiran/cpython_autoconf:269``.


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /