Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions build-static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -144,10 +150,10 @@ else
fi
fi

if [ "${SPC_REL_TYPE}" = "binary" ]; then
mkdir static-php-cli/
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-$(uname -m)"
curl -o spc -fsSL "https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-${arch}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spc has arm binary, but it's using GNU-style arch name: aarch64, not arm64.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is still valid then. arch is set to uname -m at the top of the file, so we're just re-using the variable here. And if arch is set to arm64, then the download will fail since a binary with arm64 does not exist

chmod +x spc
spcCommand="./spc"
elif [ -d "static-php-cli/src" ]; then
Expand Down
Loading