From 464c10759de6c194e1ff3db3cbd830de237c31eb Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Mon, 30 Nov 2026 16:24:15 -0700 Subject: [PATCH] fix: pin static-php-cli to 2.8.5, 3.0.0 breaks the PHP 8.1 and 8.6 builds static-php-cli 3.0.0 was released on 2026-11-30, and the build used the latest release, so the scheduled run started failing: - PHP 8.1: 3.0.0 builds OpenSSL 4.1.0, and PHP 8.1's ext/openssl doesn't compile against it (use of undeclared identifier 'ERR_NUM_ERRORS'). - PHP 8.6: 3.0.0 names extension sources ext-apcu instead of apcu, so the -U apcu:... override is ignored and APCu 5.1.28 is built, which doesn't compile with PHP 8.6. Pin to 2.8.5 with a STATIC_PHP_CLI_VERSION build arg until the build is updated for 3.x. Failing run: https://github.com/rfay/ddev-php-patch-build/actions/runs/46517885055 Co-Authored-By: Claude Opus 5.5 --- web-build/Dockerfile.php-patch-build | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/web-build/Dockerfile.php-patch-build b/web-build/Dockerfile.php-patch-build index 74cb0cb..59cd0e3 100644 --- a/web-build/Dockerfile.php-patch-build +++ b/web-build/Dockerfile.php-patch-build @@ -1,6 +1,7 @@ #ddev-generated ARG STATIC_PHP_EXTENSIONS ARG STATIC_PHP_VERSION +ARG STATIC_PHP_CLI_VERSION=2.8.5 RUN (apt-get update || true) && DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confnew" --no-install-recommends --no-install-suggests build-essential @@ -18,14 +19,9 @@ update-alternatives --set php /usr/bin/php8.4 if update-alternatives --display php-fpm >/dev/null 2>&1; then update-alternatives --set php-fpm /usr/sbin/php-fpm8.4; else ln -sf /usr/sbin/php-fpm8.4 /usr/sbin/php-fpm; fi mkdir -p /usr/local/src/static-php-cli && cd /usr/local/src/static-php-cli -# Resolve the latest tag from the release redirect to avoid the GitHub API rate limit -LATEST_RELEASE_URL="$(curl -fsSIL --retry 3 -o /dev/null -w '%{url_effective}' "https://github.com/crazywhalecc/static-php-cli/releases/latest")" -LATEST_RELEASE_TAG="${LATEST_RELEASE_URL##*/}" -if [[ ! "${LATEST_RELEASE_TAG}" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Unable to determine the latest static-php-cli release from '${LATEST_RELEASE_URL}'" >&2 - exit 1 -fi -git clone --branch "${LATEST_RELEASE_TAG}" --depth 1 https://github.com/crazywhalecc/static-php-cli.git . +# Pinned to 2.x: static-php-cli 3.0.0 builds OpenSSL 4.1, which PHP 8.1 can't compile against, +# and renames extension sources (apcu -> ext-apcu), which needs changes here +git clone --branch "${STATIC_PHP_CLI_VERSION}" --depth 1 https://github.com/crazywhalecc/static-php-cli.git . composer update -n chmod +x bin/spc bin/spc doctor --auto-fix