From 3ce906dbc6eeddcd5f377ddd15f378c637b161b1 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Thu, 22 Oct 2026 09:15:33 -0600 Subject: [PATCH] fix: retry static-php-cli source downloads on intermittent GitHub API failures GitHub API release lookups in `bin/spc download` occasionally return no usable release list ("failed to find zlib release metadata"), and the openssl.org fallback in static-php-cli no longer matches, so the build fails. Retry the download up to 3 times; already-downloaded sources are skipped on retry. Co-Authored-By: Claude Opus 5.5 --- web-build/Dockerfile.php-patch-build | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/web-build/Dockerfile.php-patch-build b/web-build/Dockerfile.php-patch-build index 64c08e0..25f8a24 100644 --- a/web-build/Dockerfile.php-patch-build +++ b/web-build/Dockerfile.php-patch-build @@ -31,7 +31,18 @@ chmod +x bin/spc bin/spc doctor --auto-fix rm -rf source/* buildroot/* -bin/spc download --for-extensions="${STATIC_PHP_EXTENSIONS}" -U "php-src:https://www.php.net/distributions/php-${STATIC_PHP_VERSION}.tar.gz" +# Retry because GitHub API release lookups fail intermittently; already-downloaded sources are skipped +for attempt in 1 2 3; do + if bin/spc download --for-extensions="${STATIC_PHP_EXTENSIONS}" -U "php-src:https://www.php.net/distributions/php-${STATIC_PHP_VERSION}.tar.gz"; then + break + fi + if [ "${attempt}" -eq 3 ]; then + echo "bin/spc download failed after ${attempt} attempts" >&2 + exit 1 + fi + echo "bin/spc download failed (attempt ${attempt}), retrying in $((attempt * 15))s" >&2 + sleep $((attempt * 15)) +done # opcache would normally be here but build fails: https://github.com/crazywhalecc/static-php-cli/issues/192 if [[ ${STATIC_PHP_VERSION} =~ ^[89] ]]; then export STATIC_PHP_EXTENSIONS="${STATIC_PHP_EXTENSIONS},opcache"; fi