Skip to content

[3.11] gh-112160: Backport 'Tools/build/regen-configure.sh' script #114333

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -2404,17 +2404,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; \
# 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 $?
$(srcdir)/Tools/build/regen-configure.sh

# Create a tags file for vi
tags::
Expand Down
25 changes: 25 additions & 0 deletions Tools/build/regen-configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -e -x

# Manifest corresponds with tag '269'
# See https://github.com/tiran/cpython_autoconf container
CPYTHON_AUTOCONF_MANIFEST="sha256:f370fee95eefa3d57b00488bce4911635411fa83e2d293ced8cf8a3674ead939"

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 --pull=missing -v "$abs_srcdir:/src$PATH_OPT" "quay.io/tiran/cpython_autoconf@$CPYTHON_AUTOCONF_MANIFEST"