]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] gh-112160: Add 'regen-configure' make target (#112163)
authorSeth Michael Larson <sethmichaellarson@gmail.com>
Mon, 20 Nov 2023 23:38:10 +0000 (17:38 -0600)
committerGitHub <noreply@github.com>
Mon, 20 Nov 2023 23:38:10 +0000 (23:38 +0000)
Add 'regen-configure' make target

.github/workflows/build.yml
Makefile.pre.in

index d7066d34ee85215c6613f3d0f9b424421cf74dcb..0d7545368d7a706234526bee2ccce46113c33a54 100644 (file)
@@ -110,8 +110,12 @@ jobs:
           grep "aclocal 1.16.3" 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
-        run: docker run --rm -v $(pwd):/src quay.io/tiran/cpython_autoconf:269
+        run: make regen-configure
       - name: Build CPython
         run: |
           # Build Python with the libpython dynamic library
index 51c31b94aea87643ea647d3fe5d932024b85ad09..fa99dd86c416edc4639f84643d1e81298cde3a86 100644 (file)
@@ -1868,6 +1868,18 @@ autoconf:
        # Regenerate pyconfig.h.in from configure.ac using autoheader
        (cd $(srcdir); autoheader -Wall)
 
+# 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; \
+       # Manifest corresponds with tag '269' \
+       CPYTHON_AUTOCONF_MANIFEST="sha256:f370fee95eefa3d57b00488bce4911635411fa83e2d293ced8cf8a3674ead939" \
+       CMD="$$RUNTIME run --rm --pull=missing -v $(abs_srcdir):/src$$OPT quay.io/tiran/cpython_autoconf@$$CPYTHON_AUTOCONF_MANIFEST"; \
+       echo $$CMD; \
+       $$CMD || exit $?
+
 # Create a tags file for vi
 tags::
        ctags -w $(srcdir)/Include/*.h $(srcdir)/Include/cpython/*.h $(srcdir)/Include/internal/*.h