From b514b186b16cfcb8fc9445b42c8fff53312b8466 Mon Sep 17 00:00:00 2001 From: Chris Banks Date: Thu, 22 Feb 2024 13:22:59 +0000 Subject: [PATCH] Work around inconsistent -mbranch-protection in Ruby 3.3.0. https://bugs.ruby-lang.org/issues/20085 --- base.Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/base.Dockerfile b/base.Dockerfile index 455aa6a..ff847ab 100644 --- a/base.Dockerfile +++ b/base.Dockerfile @@ -1,4 +1,5 @@ FROM --platform=$TARGETPLATFORM public.ecr.aws/lts/ubuntu:22.04_stable AS builder +ARG TARGETARCH SHELL ["/bin/bash", "-euo", "pipefail", "-c"] @@ -36,6 +37,10 @@ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dear WORKDIR /usr/src/ruby RUN set -x; \ MAKEFLAGS=-j"$(nproc)"; export MAKEFLAGS; \ + if [[ "$RUBY_VERSION" = "3.3.0" && "$TARGETARCH" = "arm64" ]]; then; \ + : "workaround for https://bugs.ruby-lang.org/issues/20085"; \ + ASFLAGS="-mbranch-protection=pac-ret"; export ASFLAGS; \ + fi; \ ruby_tarball="ruby-${RUBY_VERSION}.tar.gz"; \ curl -fsSLO "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR}/${ruby_tarball}"; \ echo "${RUBY_CHECKSUM} ${ruby_tarball}" | sha256sum --check --strict --status; \