Skip to content
Open
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
13 changes: 11 additions & 2 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# CI matrix is auto-generated from any directory containing a Dockerfile via
# `dirname */Dockerfile`. Adding a new variant directory (debian or alpine)
# requires no edits here — the matrix picks it up on the next push.
#
# The slim-gating logic in the cpanm/cpm/Net::DNS test steps (predicated on
# `[[ "$dir" == *"slim"* ]]`) correctly skips slim variants and includes
# alpine variants (alpine retains the full build toolchain at runtime,
# parallel to debian-main).
name: Build and Test

on:
pull_request:
paths:
- '**/Dockerfile'
- '!.devcontainer/Dockerfile'
- '**/DevelPatchPerl.patch'
- '**/*.patch'

defaults:
run:
Expand All @@ -31,6 +39,7 @@ jobs:
needs: generate-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
name: ${{ matrix.directory }}

Expand Down Expand Up @@ -82,7 +91,7 @@ jobs:
dir='${{ matrix.directory }}'
img="perl:${dir//,/-}"
if [[ "$dir" != *"slim"* ]]; then
docker run "$img" bash -c "cpanm -v -n LWP && cpanm -v -n local::lib"
docker run "$img" sh -c "cpanm -v -n LWP && cpanm -v -n local::lib"
fi

- name: Run cpm install test
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/generate-dockerfiles-patches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
- cpanfile
- config.yml
- generate.pl
- library.pl
- Dockerfile.alpine.template
- Dockerfile.debian.template
- musl-stack-size.patch
- t/**
- .github/workflows/generate-dockerfiles-patches.yml

jobs:
Expand Down Expand Up @@ -38,19 +43,27 @@ jobs:
run: |
export DOCKER_PERL_DOWNLOADS_DIR=/tmp/docker-perl-downloads
perl ./generate.pl
/usr/bin/git --no-pager diff --stat > diffstat.txt
if [[ -s diffstat.txt ]]; then
/usr/bin/git --no-pager diff --stat > /tmp/diffstat.txt
/usr/bin/git status --porcelain > /tmp/status.txt
if [[ -s /tmp/diffstat.txt || -s /tmp/status.txt ]]; then
echo has_extra_diffs=1 >> $GITHUB_OUTPUT
fi

- name: Fail if there are extra diffs
if: steps.generate.outputs.has_extra_diffs
run: |
echo "::error title=generate::Extra diffs found during generate"
echo "Additional changes found during generate - check diffstat below:"
echo "::group::diffstat"
cat diffstat.txt
echo "::error title=generate::Extra diffs or untracked files found during generate"
echo "Additional changes found during generate. Committed content must match a fresh generate.pl run exactly, including new files. Check below:"
echo "::group::diffstat (modified tracked files)"
cat /tmp/diffstat.txt
echo "::endgroup::"
echo "::group::status (untracked/uncommitted files, e.g. missing git add)"
cat /tmp/status.txt
echo "::endgroup::"
echo

exit 1

- name: Run alpine regression checks
run: |
prove -v t/*.t
15 changes: 15 additions & 0 deletions 5.040.005-main,threaded-alpine3.23/DevelPatchPerl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/hints/linux.sh b/hints/linux.sh
index 83ba0c5..d5a7f25 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -486,3 +486,10 @@ case "$libdb_needs_pthread" in
libswanted="$libswanted pthread"
;;
esac
+
+# Detect case-insensitive file systems
+echo X >UU/casesense.tmp
+if test -f UU/CASESENSE.TMP && test -f UU/CaSeSeNsE.tMp; then
+ firstmakefile='GNUmakefile'
+fi
+rm -f UU/casesense.tmp
71 changes: 71 additions & 0 deletions 5.040.005-main,threaded-alpine3.23/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
FROM alpine:3.23

# This image deliberately retains the build toolchain at runtime (parallel
# to debian-main's buildpack-deps-based image), so cpanm/cpm installs of
# XS modules Just Work. This diverges from python:3-alpine / ruby:3-alpine
# which strip everything via scanelf-based runDeps pruning. Two virtual
# package sets: a permanent keeper, and a transient `.build-deps` purged
# at the end.

COPY *.patch /usr/src/perl/
WORKDIR /usr/src/perl

RUN set -eux \
&& apk add --no-cache \
build-base \
bzip2-dev \
ca-certificates \
curl \
libc-dev \
linux-headers \
make \
openssl \
openssl-dev \
pkgconf \
tzdata \
zlib-dev \
&& apk add --no-cache --virtual .build-deps \
dpkg \
dpkg-dev \
patch \
procps \
tar \
xz \
&& curl -fL https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.40.5.tar.gz -o perl-5.40.5.tar.gz \
# busybox sha256sum does not support --strict; -c alone is sufficient here
&& echo '09d926ae2d1b277c3bce62054c41da47c981380d719c41cf980b67945cc581ed *perl-5.40.5.tar.gz' | sha256sum -c - \
&& tar --strip-components=1 -xaf perl-5.40.5.tar.gz -C /usr/src/perl \
&& rm perl-5.40.5.tar.gz \
&& cat *.patch | patch -p1 \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& archBits="$(dpkg-architecture --query DEB_BUILD_ARCH_BITS)" \
&& archFlag="$([ "$archBits" = '64' ] && echo '-Duse64bitall' || echo '-Duse64bitint')" \
&& ./Configure -Darchname="$gnuArch" "$archFlag" -Dusethreads -Duseshrplib -Dvendorprefix=/usr/local -des \
&& make -j$(nproc) \
&& TEST_JOBS=$(nproc) make test_harness_notty \
&& make install \
&& cd /usr/src \
&& curl -fLO https://www.cpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7049.tar.gz \
&& echo 'b9ffb88e62a06aa91bd7d5a28ef6bdbb942608aea90e3969aa29b33640035214 *App-cpanminus-1.7049.tar.gz' | sha256sum -c - \
&& tar -xzf App-cpanminus-1.7049.tar.gz && cd App-cpanminus-1.7049 \
&& perl -pi -E 's{http://(www\.cpan\.org|backpan\.perl\.org|cpan\.metacpan\.org|fastapi\.metacpan\.org|cpanmetadb\.plackperl\.org)}{https://$1}g' bin/cpanm \
&& perl -pi -E 's{try_lwp=>1}{try_lwp=>0}g' bin/cpanm \
&& perl -pi -E 's{try_wget=>1}{try_wget=>0}g' bin/cpanm \
&& perl bin/cpanm . && cd /root \
&& curl -fLO 'https://www.cpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.96.tar.gz' \
&& echo 'ab213691685fb2a576c669cbc8d9266f8165a31563ad15b7c4030b94adfc0753 *Net-SSLeay-1.96.tar.gz' | sha256sum -c - \
&& cpanm --notest --from $PWD Net-SSLeay-1.96.tar.gz \
&& curl -fLO 'https://www.cpan.org/authors/id/S/SU/SULLR/IO-Socket-SSL-2.099.tar.gz' \
&& echo 'a0be800ff4852b1567ee5500e772417ad7a360abff80c01b5b875c15d44be832 *IO-Socket-SSL-2.099.tar.gz' | sha256sum -c - \
&& SSL_CERT_DIR=/etc/ssl/certs cpanm --notest --from $PWD IO-Socket-SSL-2.099.tar.gz \
&& curl -fL https://raw.githubusercontent.com/skaji/cpm/v1.1.4/cpm -o /usr/local/bin/cpm \
# sha256 checksum is from docker-perl team, cf https://github.com/docker-library/official-images/pull/12612#issuecomment-1158288299
&& echo '6f5ae6d0e25ba20f768b8856ea61481da9d142a04629d658025011c76d3bbc3f */usr/local/bin/cpm' | sha256sum -c - \
&& chmod +x /usr/local/bin/cpm \
&& apk del --no-network .build-deps \
&& rm -fr /root/.cpanm /root/Net-SSLeay-1.96* /root/IO-Socket-SSL-2.099* /usr/src/perl /usr/src/App-cpanminus-1.7049* /tmp/* \
&& cpanm --version && cpm --version

WORKDIR /usr/src/app

CMD ["perl5.40.5","-de0"]
16 changes: 16 additions & 0 deletions 5.040.005-main,threaded-alpine3.23/musl-stack-size.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Tests fails on s390x due to low thread stack size
upstream report: https://github.com/Perl/perl5/issues/18160

diff --git a/t/thread_it.pl b/t/thread_it.pl
index f38a580..e8c450a 100644
--- a/t/thread_it.pl
+++ b/t/thread_it.pl
@@ -36,7 +36,7 @@ my $curr = threads->create({
stack_size => $^O eq 'hpux' ? 524288 :
$^O eq 'darwin' ? 2000000:
$^O eq 'VMS' ? 150000 :
- $^O eq 'aix' ? 1500000 : 0,
+ $^O eq 'aix' ? 1500000 : 256*1024,
}, sub {
run_tests();
return defined &curr_test ? curr_test() : ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/t/op/magic.t b/t/op/magic.t
index 49e39b7..289c9da 100644
--- a/t/op/magic.t
+++ b/t/op/magic.t
@@ -405,7 +405,7 @@ EOP
# argv[0] assignment and by calling prctl()
{
SKIP: {
- skip "We don't have prctl() here, or we're on Android", 2 unless $Config{d_prctl_set_name} && $^O ne 'android';
+ skip "Skip test to avoid external ps(1) dependency", 2;

# We don't really need these tests. prctl() is tested in the
# Kernel, but test it anyway for our sanity. If something doesn't
15 changes: 15 additions & 0 deletions 5.040.005-main,threaded-alpine3.24/DevelPatchPerl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/hints/linux.sh b/hints/linux.sh
index 83ba0c5..d5a7f25 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -486,3 +486,10 @@ case "$libdb_needs_pthread" in
libswanted="$libswanted pthread"
;;
esac
+
+# Detect case-insensitive file systems
+echo X >UU/casesense.tmp
+if test -f UU/CASESENSE.TMP && test -f UU/CaSeSeNsE.tMp; then
+ firstmakefile='GNUmakefile'
+fi
+rm -f UU/casesense.tmp
71 changes: 71 additions & 0 deletions 5.040.005-main,threaded-alpine3.24/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
FROM alpine:3.24

# This image deliberately retains the build toolchain at runtime (parallel
# to debian-main's buildpack-deps-based image), so cpanm/cpm installs of
# XS modules Just Work. This diverges from python:3-alpine / ruby:3-alpine
# which strip everything via scanelf-based runDeps pruning. Two virtual
# package sets: a permanent keeper, and a transient `.build-deps` purged
# at the end.

COPY *.patch /usr/src/perl/
WORKDIR /usr/src/perl

RUN set -eux \
&& apk add --no-cache \
build-base \
bzip2-dev \
ca-certificates \
curl \
libc-dev \
linux-headers \
make \
openssl \
openssl-dev \
pkgconf \
tzdata \
zlib-dev \
&& apk add --no-cache --virtual .build-deps \
dpkg \
dpkg-dev \
patch \
procps \
tar \
xz \
&& curl -fL https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.40.5.tar.gz -o perl-5.40.5.tar.gz \
# busybox sha256sum does not support --strict; -c alone is sufficient here
&& echo '09d926ae2d1b277c3bce62054c41da47c981380d719c41cf980b67945cc581ed *perl-5.40.5.tar.gz' | sha256sum -c - \
&& tar --strip-components=1 -xaf perl-5.40.5.tar.gz -C /usr/src/perl \
&& rm perl-5.40.5.tar.gz \
&& cat *.patch | patch -p1 \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& archBits="$(dpkg-architecture --query DEB_BUILD_ARCH_BITS)" \
&& archFlag="$([ "$archBits" = '64' ] && echo '-Duse64bitall' || echo '-Duse64bitint')" \
&& ./Configure -Darchname="$gnuArch" "$archFlag" -Dusethreads -Duseshrplib -Dvendorprefix=/usr/local -des \
&& make -j$(nproc) \
&& TEST_JOBS=$(nproc) make test_harness_notty \
&& make install \
&& cd /usr/src \
&& curl -fLO https://www.cpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7049.tar.gz \
&& echo 'b9ffb88e62a06aa91bd7d5a28ef6bdbb942608aea90e3969aa29b33640035214 *App-cpanminus-1.7049.tar.gz' | sha256sum -c - \
&& tar -xzf App-cpanminus-1.7049.tar.gz && cd App-cpanminus-1.7049 \
&& perl -pi -E 's{http://(www\.cpan\.org|backpan\.perl\.org|cpan\.metacpan\.org|fastapi\.metacpan\.org|cpanmetadb\.plackperl\.org)}{https://$1}g' bin/cpanm \
&& perl -pi -E 's{try_lwp=>1}{try_lwp=>0}g' bin/cpanm \
&& perl -pi -E 's{try_wget=>1}{try_wget=>0}g' bin/cpanm \
&& perl bin/cpanm . && cd /root \
&& curl -fLO 'https://www.cpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.96.tar.gz' \
&& echo 'ab213691685fb2a576c669cbc8d9266f8165a31563ad15b7c4030b94adfc0753 *Net-SSLeay-1.96.tar.gz' | sha256sum -c - \
&& cpanm --notest --from $PWD Net-SSLeay-1.96.tar.gz \
&& curl -fLO 'https://www.cpan.org/authors/id/S/SU/SULLR/IO-Socket-SSL-2.099.tar.gz' \
&& echo 'a0be800ff4852b1567ee5500e772417ad7a360abff80c01b5b875c15d44be832 *IO-Socket-SSL-2.099.tar.gz' | sha256sum -c - \
&& SSL_CERT_DIR=/etc/ssl/certs cpanm --notest --from $PWD IO-Socket-SSL-2.099.tar.gz \
&& curl -fL https://raw.githubusercontent.com/skaji/cpm/v1.1.4/cpm -o /usr/local/bin/cpm \
# sha256 checksum is from docker-perl team, cf https://github.com/docker-library/official-images/pull/12612#issuecomment-1158288299
&& echo '6f5ae6d0e25ba20f768b8856ea61481da9d142a04629d658025011c76d3bbc3f */usr/local/bin/cpm' | sha256sum -c - \
&& chmod +x /usr/local/bin/cpm \
&& apk del --no-network .build-deps \
&& rm -fr /root/.cpanm /root/Net-SSLeay-1.96* /root/IO-Socket-SSL-2.099* /usr/src/perl /usr/src/App-cpanminus-1.7049* /tmp/* \
&& cpanm --version && cpm --version

WORKDIR /usr/src/app

CMD ["perl5.40.5","-de0"]
16 changes: 16 additions & 0 deletions 5.040.005-main,threaded-alpine3.24/musl-stack-size.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Tests fails on s390x due to low thread stack size
upstream report: https://github.com/Perl/perl5/issues/18160

diff --git a/t/thread_it.pl b/t/thread_it.pl
index f38a580..e8c450a 100644
--- a/t/thread_it.pl
+++ b/t/thread_it.pl
@@ -36,7 +36,7 @@ my $curr = threads->create({
stack_size => $^O eq 'hpux' ? 524288 :
$^O eq 'darwin' ? 2000000:
$^O eq 'VMS' ? 150000 :
- $^O eq 'aix' ? 1500000 : 0,
+ $^O eq 'aix' ? 1500000 : 256*1024,
}, sub {
run_tests();
return defined &curr_test ? curr_test() : ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/t/op/magic.t b/t/op/magic.t
index 49e39b7..289c9da 100644
--- a/t/op/magic.t
+++ b/t/op/magic.t
@@ -405,7 +405,7 @@ EOP
# argv[0] assignment and by calling prctl()
{
SKIP: {
- skip "We don't have prctl() here, or we're on Android", 2 unless $Config{d_prctl_set_name} && $^O ne 'android';
+ skip "Skip test to avoid external ps(1) dependency", 2;

# We don't really need these tests. prctl() is tested in the
# Kernel, but test it anyway for our sanity. If something doesn't
15 changes: 15 additions & 0 deletions 5.040.005-main-alpine3.23/DevelPatchPerl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/hints/linux.sh b/hints/linux.sh
index 83ba0c5..d5a7f25 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -486,3 +486,10 @@ case "$libdb_needs_pthread" in
libswanted="$libswanted pthread"
;;
esac
+
+# Detect case-insensitive file systems
+echo X >UU/casesense.tmp
+if test -f UU/CASESENSE.TMP && test -f UU/CaSeSeNsE.tMp; then
+ firstmakefile='GNUmakefile'
+fi
+rm -f UU/casesense.tmp
Loading
Loading