From 7ac7122778cc764cd50271807efe2e94775b2c21 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 29 Feb 2024 13:45:14 -0800 Subject: [PATCH] Apply arm64 patch sooner so `autoconf` regenerates `configure` correctly --- 3.3/alpine3.18/Dockerfile | 3 ++- 3.3/alpine3.19/Dockerfile | 3 ++- 3.3/bookworm/Dockerfile | 3 ++- 3.3/bullseye/Dockerfile | 3 ++- 3.3/slim-bookworm/Dockerfile | 3 ++- 3.3/slim-bullseye/Dockerfile | 3 ++- Dockerfile.template | 19 ++++++++++--------- 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/3.3/alpine3.18/Dockerfile b/3.3/alpine3.18/Dockerfile index 01c0153f1..691fd0294 100644 --- a/3.3/alpine3.18/Dockerfile +++ b/3.3/alpine3.18/Dockerfile @@ -116,7 +116,6 @@ RUN set -eux; \ } > file.c.new; \ mv file.c.new file.c; \ \ - autoconf; \ # workaround crash on arm64 # https://bugs.ruby-lang.org/issues/20085 # https://github.com/ruby/ruby/pull/9385 <- https://github.com/ruby/ruby/pull/9371 @@ -124,6 +123,8 @@ RUN set -eux; \ echo '86bc65415fd62cb2272a4df249f39fb79db15617ad05c540e05a22f02eae73b3 *arm64-fix.patch' | sha256sum --check --strict; \ patch -p1 -i arm64-fix.patch; \ rm arm64-fix.patch; \ + \ + autoconf; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/3.3/alpine3.19/Dockerfile b/3.3/alpine3.19/Dockerfile index e3ad15bee..3c2de30c4 100644 --- a/3.3/alpine3.19/Dockerfile +++ b/3.3/alpine3.19/Dockerfile @@ -116,7 +116,6 @@ RUN set -eux; \ } > file.c.new; \ mv file.c.new file.c; \ \ - autoconf; \ # workaround crash on arm64 # https://bugs.ruby-lang.org/issues/20085 # https://github.com/ruby/ruby/pull/9385 <- https://github.com/ruby/ruby/pull/9371 @@ -124,6 +123,8 @@ RUN set -eux; \ echo '86bc65415fd62cb2272a4df249f39fb79db15617ad05c540e05a22f02eae73b3 *arm64-fix.patch' | sha256sum --check --strict; \ patch -p1 -i arm64-fix.patch; \ rm arm64-fix.patch; \ + \ + autoconf; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/3.3/bookworm/Dockerfile b/3.3/bookworm/Dockerfile index 79801b37f..e66e1a392 100644 --- a/3.3/bookworm/Dockerfile +++ b/3.3/bookworm/Dockerfile @@ -74,7 +74,6 @@ RUN set -eux; \ } > file.c.new; \ mv file.c.new file.c; \ \ - autoconf; \ # workaround crash on arm64 # https://bugs.ruby-lang.org/issues/20085 # https://github.com/ruby/ruby/pull/9385 <- https://github.com/ruby/ruby/pull/9371 @@ -82,6 +81,8 @@ RUN set -eux; \ echo '86bc65415fd62cb2272a4df249f39fb79db15617ad05c540e05a22f02eae73b3 *arm64-fix.patch' | sha256sum --check --strict; \ patch -p1 -i arm64-fix.patch; \ rm arm64-fix.patch; \ + \ + autoconf; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/3.3/bullseye/Dockerfile b/3.3/bullseye/Dockerfile index 70b0fd66d..33b18b722 100644 --- a/3.3/bullseye/Dockerfile +++ b/3.3/bullseye/Dockerfile @@ -74,7 +74,6 @@ RUN set -eux; \ } > file.c.new; \ mv file.c.new file.c; \ \ - autoconf; \ # workaround crash on arm64 # https://bugs.ruby-lang.org/issues/20085 # https://github.com/ruby/ruby/pull/9385 <- https://github.com/ruby/ruby/pull/9371 @@ -82,6 +81,8 @@ RUN set -eux; \ echo '86bc65415fd62cb2272a4df249f39fb79db15617ad05c540e05a22f02eae73b3 *arm64-fix.patch' | sha256sum --check --strict; \ patch -p1 -i arm64-fix.patch; \ rm arm64-fix.patch; \ + \ + autoconf; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/3.3/slim-bookworm/Dockerfile b/3.3/slim-bookworm/Dockerfile index 183503cb9..c69e19331 100644 --- a/3.3/slim-bookworm/Dockerfile +++ b/3.3/slim-bookworm/Dockerfile @@ -100,7 +100,6 @@ RUN set -eux; \ } > file.c.new; \ mv file.c.new file.c; \ \ - autoconf; \ # workaround crash on arm64 # https://bugs.ruby-lang.org/issues/20085 # https://github.com/ruby/ruby/pull/9385 <- https://github.com/ruby/ruby/pull/9371 @@ -108,6 +107,8 @@ RUN set -eux; \ echo '86bc65415fd62cb2272a4df249f39fb79db15617ad05c540e05a22f02eae73b3 *arm64-fix.patch' | sha256sum --check --strict; \ patch -p1 -i arm64-fix.patch; \ rm arm64-fix.patch; \ + \ + autoconf; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/3.3/slim-bullseye/Dockerfile b/3.3/slim-bullseye/Dockerfile index 6ed757bea..020ba6571 100644 --- a/3.3/slim-bullseye/Dockerfile +++ b/3.3/slim-bullseye/Dockerfile @@ -100,7 +100,6 @@ RUN set -eux; \ } > file.c.new; \ mv file.c.new file.c; \ \ - autoconf; \ # workaround crash on arm64 # https://bugs.ruby-lang.org/issues/20085 # https://github.com/ruby/ruby/pull/9385 <- https://github.com/ruby/ruby/pull/9371 @@ -108,6 +107,8 @@ RUN set -eux; \ echo '86bc65415fd62cb2272a4df249f39fb79db15617ad05c540e05a22f02eae73b3 *arm64-fix.patch' | sha256sum --check --strict; \ patch -p1 -i arm64-fix.patch; \ rm arm64-fix.patch; \ + \ + autoconf; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/Dockerfile.template b/Dockerfile.template index 3387f9cb3..a01ca4934 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -238,6 +238,16 @@ RUN set -eux; \ cat file.c; \ } > file.c.new; \ mv file.c.new file.c; \ +{{ if .version == "3.3.0" then ( -}} + \ + # workaround crash on arm64 + # https://bugs.ruby-lang.org/issues/20085 + # https://github.com/ruby/ruby/pull/9385 <- https://github.com/ruby/ruby/pull/9371 + wget -O 'arm64-fix.patch' 'https://github.com/ruby/ruby/commit/7f97e3540ce448b501bcbee15afac5f94bb22dd9.patch?full_index=1'; \ + echo '86bc65415fd62cb2272a4df249f39fb79db15617ad05c540e05a22f02eae73b3 *arm64-fix.patch' | sha256sum --check --strict; \ + patch -p1 -i arm64-fix.patch; \ + rm arm64-fix.patch; \ +{{ ) else "" end -}} \ autoconf; \ {{ if is_alpine and "3.0" == (env.version | rtrimstr("-rc")) then ( -}} @@ -252,15 +262,6 @@ RUN set -eux; \ export LIBS='-lucontext'; \ ;; \ esac; \ -{{ ) else "" end -}} -{{ if .version == "3.3.0" then ( -}} - # workaround crash on arm64 - # https://bugs.ruby-lang.org/issues/20085 - # https://github.com/ruby/ruby/pull/9385 <- https://github.com/ruby/ruby/pull/9371 - wget -O 'arm64-fix.patch' 'https://github.com/ruby/ruby/commit/7f97e3540ce448b501bcbee15afac5f94bb22dd9.patch?full_index=1'; \ - echo '86bc65415fd62cb2272a4df249f39fb79db15617ad05c540e05a22f02eae73b3 *arm64-fix.patch' | sha256sum --check --strict; \ - patch -p1 -i arm64-fix.patch; \ - rm arm64-fix.patch; \ {{ ) else "" end -}} gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \