From 17fba8f61d22611e799797546b900ee51ac23efb Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 4 Dec 2026 10:36:29 -0800 Subject: [PATCH] [Tests] Alpine: keep testing arm64 dash 0.5.13.5 It corrupts some non-ASCII bytes stored in variables, so build it from the source Alpine shipped, to keep testing it after Alpine updates dash. --- .github/workflows/tests-alpine.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests-alpine.yml b/.github/workflows/tests-alpine.yml index abd0cf8b..c6c37270 100644 --- a/.github/workflows/tests-alpine.yml +++ b/.github/workflows/tests-alpine.yml @@ -11,7 +11,7 @@ jobs: contents: read # Native runners per arch (no QEMU): arm64 uses the ubuntu-24.04-arm image. - name: 'fast ${{ matrix.arch }} (alpine ${{ matrix.alpine }}, ${{ matrix.shell }})' + name: "fast ${{ matrix.arch }} (alpine ${{ matrix.alpine }}, ${{ matrix.shell }}${{ matrix.dash && format(' {0}', matrix.dash) || '' }})" runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} # a passing run takes a few minutes; a hang otherwise runs to GitHub's 6-hour limit timeout-minutes: 15 @@ -32,6 +32,13 @@ jobs: - dash - zsh # - ksh (#574) + include: + # on arm64, this dash corrupts some non-ASCII bytes it stores in variables + - alpine: '3.25' + arch: arm64 + shell: dash + dash: 0.5.13.5 + dash_sha512: ae326c110713a9da6b7afb977ca6fd931793b03011f0a7aa2c42e873f116ed09448deea9ef5ca4515fe3afe24e210e0aaa580f7de89934edda9cf31ee44c94dd steps: - name: Harden Runner @@ -48,6 +55,7 @@ jobs: dl-cdn.alpinelinux.org:80 cdn.alpinelinux.org:443 cdn.alpinelinux.org:80 + distfiles.alpinelinux.org:443 registry-1.docker.io:443 auth.docker.io:443 mirror.gcr.io:443 @@ -91,6 +99,9 @@ jobs: -v "${{ github.workspace }}:/workspace" \ -w /workspace \ -e "TEST_SHELL=${{ matrix.shell }}" \ + -e "DASH_VERSION=${{ matrix.dash }}" \ + -e "DASH_SHA512=${{ matrix.dash_sha512 }}" \ + -e "ALPINE_VERSION=${{ matrix.alpine }}" \ -e "TERM=xterm-256color" \ -e "GITHUB_ACTIONS=true" \ mirror.gcr.io/library/alpine:${{ matrix.alpine }} \ @@ -105,6 +116,16 @@ jobs: sudo su-exec libstdc++ libgcc && break echo "apk add failed, attempt $i/5"; sleep $((i * 5)) done + if [ -n "$DASH_VERSION" ]; then + # Build a pinned dash from the source tarball Alpine shipped; /usr/local/bin precedes the packaged one in PATH. + apk add --no-cache build-base + wget -q -O /tmp/dash.tar.gz "https://distfiles.alpinelinux.org/distfiles/v$ALPINE_VERSION/dash-$DASH_VERSION.tar.gz" + echo "$DASH_SHA512 /tmp/dash.tar.gz" | sha512sum -c - + mkdir /tmp/dash + tar -xzf /tmp/dash.tar.gz -C /tmp/dash --strip-components=1 + (cd /tmp/dash && ./configure --prefix=/usr/local && make && make install) + [ "$(command -v dash)" = /usr/local/bin/dash ] + fi # Mirror the ubuntu runner: run the suite as a non-root user with # passwordless sudo and a PTY so the permission/terminal tests # behave the same. The user takes the mounted checkout uid so