From f7459de0d0c06b18c03468a7b61882480f6f97a7 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 3 Mar 2024 00:36:29 +0100 Subject: [PATCH 1/4] CI: Add build matrix --- .github/workflows/ci.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 807fed3..85b995d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,13 @@ on: jobs: build: name: Build Dockerfile for amd64 and arm64 + strategy: + fail-fast: false + matrix: + autoconf_version: ["2.69", "2.71", "2.72"] runs-on: ubuntu-latest + env: + TAG: autoconf:${{ matrix.autoconf_version }}-${{ github.run_id }} steps: - name: Checkout Push to Registry action uses: actions/checkout@v4 @@ -22,7 +28,8 @@ jobs: uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64,linux/arm64 - push: false - tags: | - ghcr.io/corona10/cpython_autoconf + build-args: AUTOCONF_VERSION=${{ matrix.autoconf_version }} + load: true + tags: ${{ env.TAG }} + - name: Test + run: docker run --rm $TAG autoconf --version | grep ${{ matrix.autoconf_version }} From c8bfd664e83a4e601066ac26b0d7c449b7ce7dd0 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 3 Mar 2024 00:37:10 +0100 Subject: [PATCH 2/4] Entryscript: use explicit paths for invocation --- entry.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/entry.sh b/entry.sh index 7f81d5b..a4d0f8b 100755 --- a/entry.sh +++ b/entry.sh @@ -1,21 +1,24 @@ #!/bin/sh set -e -SRC=/src -SENTINEL=${SRC}/pyconfig.h.in +SENTINEL=/src/pyconfig.h.in if [ ! -e ${SENTINEL} ]; then echo "ERROR: ${SENTINEL} not found " echo "Did you forget to mount Python work directory with '-v.:/src'?" echo - echo " docker run -v.:/src dongheena/cpython_autoconf" - echo " podman run -v.:/src:Z dongheena/cpython_autoconf" + echo " docker run -v\$PWD:/src ghcr.io/corona10/cpython_autoconf" + echo " podman run -v\$PWD:/src:Z ghcr.io/corona10/cpython_autoconf" exit 2 fi +BIN=/usr/local/bin +AUTOCONF=$BIN/autoconf +AUTORECONF=$BIN/autoreconf + if [ "$#" = "0" ]; then - echo "Rebuilding configure script using $(autoconf --version | head -n 1)" - exec gosu autoreconf -ivf -Werror $@ + echo "Rebuilding configure script using $($AUTOCONF --version | head -n 1)" + exec gosu $AUTORECONF -ivf -Werror $@ fi -exec "$@" \ No newline at end of file +exec "$@" From d0c99af234f1888040cc040327353ce12291835a Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 3 Mar 2024 00:37:35 +0100 Subject: [PATCH 3/4] Dockerfile: add build args for versions, and install automake and autoconf-archive --- Dockerfile | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 396e41f..f2c52d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,39 @@ FROM docker.io/library/alpine:3.19 +ARG AUTOCONF_VERSION="2.71" +ARG AUTOCONF_ARCHIVE_VERSION="2023.02.20" +ARG AUTOMAKE_VERSION="1.16.5" + LABEL org.opencontainers.image.source="https://github.com/corona10/cpython_autoconf" LABEL org.opencontainers.image.base.name="docker.io/library/alpine:3.19" LABEL org.opencontainers.image.authors="Donghee Na" -LABEL org.opencontainers.image.title="autoconf 2.72 container for CPython" -LABEL org.opencontainers.image.description="Container image with autoconf 2.72 tools to regenerate Python's configure script." +LABEL org.opencontainers.image.title="GNU Autoconf ${AUTOCONF_VERSION} container for CPython" +LABEL org.opencontainers.image.description="Container image with GNU Autoconf ${AUTOCONF_VERSION}, GNU Automake ${AUTOMAKE_VERSION}, and autoconf-archive ${AUTOCONF_ARCHIVE_VERSION} for generating CPython's configure script." RUN apk upgrade && \ apk add \ alpine-sdk \ autoconf \ automake \ - autoconf-archive \ - libtool \ - pkgconfig -RUN curl https://ftp.gnu.org/gnu/autoconf/autoconf-2.72.tar.gz | tar -zxvf - -RUN cd autoconf-2.72 && ./configure && make && make install + xz +RUN set -o pipefail \ + && curl https://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.gz | tar -zxf - \ + && cd autoconf-${AUTOCONF_VERSION} \ + && ./configure --prefix=/usr/local \ + && make \ + && make install +RUN set -o pipefail \ + && curl https://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.gz | tar -xzf - \ + && cd automake-${AUTOMAKE_VERSION} \ + && ./configure --prefix=/usr/local \ + && make \ + && make install +RUN set -o pipefail \ + && curl https://ftp.gnu.org/gnu/autoconf-archive/autoconf-archive-${AUTOCONF_ARCHIVE_VERSION}.tar.xz | xz -cd - | tar -xf - \ + && cd autoconf-archive-${AUTOCONF_ARCHIVE_VERSION} \ + && ./configure --prefix=/usr/local \ + && make \ + && make install VOLUME /src WORKDIR /src From 8cbd91486fbaccccc6579ae2d48dd105602a7e70 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 3 Mar 2024 01:00:09 +0100 Subject: [PATCH 4/4] Entryscript: don't check sentinel if we're running arbitrary commands --- entry.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/entry.sh b/entry.sh index a4d0f8b..3c0b077 100755 --- a/entry.sh +++ b/entry.sh @@ -1,22 +1,22 @@ #!/bin/sh set -e -SENTINEL=/src/pyconfig.h.in - -if [ ! -e ${SENTINEL} ]; then - echo "ERROR: ${SENTINEL} not found " - echo "Did you forget to mount Python work directory with '-v.:/src'?" - echo - echo " docker run -v\$PWD:/src ghcr.io/corona10/cpython_autoconf" - echo " podman run -v\$PWD:/src:Z ghcr.io/corona10/cpython_autoconf" - exit 2 -fi - BIN=/usr/local/bin AUTOCONF=$BIN/autoconf AUTORECONF=$BIN/autoreconf if [ "$#" = "0" ]; then + local SENTINEL=/src/pyconfig.h.in + + if [ ! -e ${SENTINEL} ]; then + echo "ERROR: ${SENTINEL} not found " + echo "Did you forget to mount Python work directory with '-v.:/src'?" + echo + echo " docker run -v\$PWD:/src ghcr.io/corona10/cpython_autoconf" + echo " podman run -v\$PWD:/src:Z ghcr.io/corona10/cpython_autoconf" + exit 2 + fi + echo "Rebuilding configure script using $($AUTOCONF --version | head -n 1)" exec gosu $AUTORECONF -ivf -Werror $@ fi