From faa975c78e24ca6ea05780269509ed7a7c2eed89 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Mon, 31 Mar 2025 21:29:18 +0200 Subject: [PATCH 1/3] Fixes build-static script --- build-static.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/build-static.sh b/build-static.sh index aff09f608e..468fe0b94f 100755 --- a/build-static.sh +++ b/build-static.sh @@ -122,6 +122,12 @@ cache_key="${PHP_VERSION}-${PHP_EXTENSIONS}-${PHP_EXTENSION_LIBS}" # Build libphp if necessary if [ -f dist/cache_key ] && [ "$(cat dist/cache_key)" = "${cache_key}" ] && [ -f "dist/static-php-cli/buildroot/lib/libphp.a" ]; then cd dist/static-php-cli + + if [ -f "./spc" ]; then + spcCommand="./spc" + elif [ -f "bin/spc" ]; then + spcCommand="./bin/spc" + fi else mkdir -p dist/ cd dist/ @@ -144,10 +150,10 @@ else fi fi - if [ "${SPC_REL_TYPE}" = "binary" ]; then - mkdir static-php-cli/ + if [ "${SPC_REL_TYPE}" = "binary" && "${arch}" != "arm64" ]; then + mkdir -p static-php-cli/ cd static-php-cli/ - curl -o spc -fsSL "https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-$(uname -m)" + curl -o spc -fsSL "https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-${arch}" chmod +x spc spcCommand="./spc" elif [ -d "static-php-cli/src" ]; then From 90c557b39df6ad2a4a8d4b3372b2c9875d59a4eb Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Tue, 1 Apr 2025 14:15:18 +0200 Subject: [PATCH 2/3] Add composer to gnu image --- static-builder-gnu.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/static-builder-gnu.Dockerfile b/static-builder-gnu.Dockerfile index 120126bb0c..4fcda3a338 100644 --- a/static-builder-gnu.Dockerfile +++ b/static-builder-gnu.Dockerfile @@ -117,6 +117,7 @@ ENV SPC_REL_TYPE='binary' # not sure if this is needed ENV COMPOSER_ALLOW_SUPERUSER=1 +COPY --from=composer/composer:2-bin /composer /usr/bin/composer WORKDIR /go/src/app COPY go.mod go.sum ./ From d5af2b1c3becd428015069feda61b9c910aa828d Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Tue, 1 Apr 2025 15:23:09 +0200 Subject: [PATCH 3/3] Fix syntax --- build-static.sh | 2 +- static-builder-gnu.Dockerfile | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/build-static.sh b/build-static.sh index 468fe0b94f..930b0781a3 100755 --- a/build-static.sh +++ b/build-static.sh @@ -150,7 +150,7 @@ else fi fi - if [ "${SPC_REL_TYPE}" = "binary" && "${arch}" != "arm64" ]; then + if [ "${SPC_REL_TYPE}" = "binary" ] && [[ ! "${arch}" =~ arm ]]; then mkdir -p static-php-cli/ cd static-php-cli/ curl -o spc -fsSL "https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-${arch}" diff --git a/static-builder-gnu.Dockerfile b/static-builder-gnu.Dockerfile index 4fcda3a338..120126bb0c 100644 --- a/static-builder-gnu.Dockerfile +++ b/static-builder-gnu.Dockerfile @@ -117,7 +117,6 @@ ENV SPC_REL_TYPE='binary' # not sure if this is needed ENV COMPOSER_ALLOW_SUPERUSER=1 -COPY --from=composer/composer:2-bin /composer /usr/bin/composer WORKDIR /go/src/app COPY go.mod go.sum ./