From 28f586d2076a870043f8167eae2fdb65eedb90c4 Mon Sep 17 00:00:00 2001 From: James Griffin Date: Mon, 24 Aug 2026 22:15:40 -0300 Subject: [PATCH] Install GNU tar in the CI image so actions/cache works MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit actions/cache shells out to `tar --posix -P`. Alpine's busybox tar rejects both flags, so the cache step would fail in every job that runs inside these images — which is all of them once ci.yml switches over. coreutils does not cover this: tar is its own Alpine package. Add it, add zstd (which actions/cache prefers over gzip when present), and assert GNU tar in the image's smoke test so a future base-image change cannot quietly drop it again. Part of #187 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01D9acV1mHktGAb1uyvNmrR2 --- .gitea/ci/Dockerfile | 10 ++++++++-- docs/ci.md | 8 ++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitea/ci/Dockerfile b/.gitea/ci/Dockerfile index 708a831..42503b3 100644 --- a/.gitea/ci/Dockerfile +++ b/.gitea/ci/Dockerfile @@ -16,8 +16,11 @@ FROM php:${PHP_VERSION}-cli-alpine # (actions/checkout, actions/cache, actions/upload-artifact) *inside* the job # container, and shells `run:` steps through bash. # -# coreutils, gawk, grep and sed replace the busybox applets with the GNU ones -# the workflow scripts are written against (`tac`, `grep --include`). +# coreutils, gawk, grep, sed and tar replace the busybox applets with the GNU +# ones the workflow scripts are written against (`tac`, `grep --include`). +# tar is not optional: actions/cache shells out to `tar --posix -P`, which +# busybox rejects outright, so every cache step fails without it. zstd is what +# actions/cache prefers over gzip when it is present. # # jq, curl, git and zip/unzip are used by release.yml and bin/build-zip.sh. RUN apk add --no-cache \ @@ -30,8 +33,10 @@ RUN apk add --no-cache \ jq \ nodejs \ sed \ + tar \ unzip \ zip \ + zstd \ icu-libs \ libzip \ && apk add --no-cache --virtual .build-deps \ @@ -52,6 +57,7 @@ ENV COMPOSER_ALLOW_SUPERUSER=1 \ COMPOSER_HOME=/composer RUN mkdir -p "$COMPOSER_HOME" \ + && tar --version | head -1 | grep -q 'GNU tar' \ && php -v \ && php -m | grep -qx intl \ && php -m | grep -qx mbstring \ diff --git a/docs/ci.md b/docs/ci.md index 1822194..2c97eef 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -30,8 +30,12 @@ inside the cluster replaces the whole thing (#187). (`actions/checkout`, `actions/cache`, `actions/upload-artifact`) *inside* the job container and shells `run:` steps through bash. Without these, the first step of every job fails. -- **`coreutils`, `gawk`, `grep`, `sed`** — GNU versions, because the workflow - scripts use `tac` and `grep --include`, which busybox does not provide. +- **`coreutils`, `gawk`, `grep`, `sed`, `tar`** — GNU versions, because the + workflow scripts use `tac` and `grep --include`, which busybox does not + provide. GNU `tar` matters most: `actions/cache` shells out to + `tar --posix -P`, and busybox rejects those flags, so every cache step fails + without it. `zstd` is what `actions/cache` reaches for over gzip when it is + installed. - **`curl`, `jq`, `git`, `zip`, `unzip`** — used by `release.yml` and `bin/build-zip.sh`. - **`intl` and `zip` PHP extensions**, plus Composer 2. `mbstring` is already -- 2.54.0