Skip to content

Fixes build-static script#1474

Merged
dunglas merged 3 commits intophp:mainfrom
pierredup:static-build-fixes
Apr 17, 2025
Merged

Fixes build-static script#1474
dunglas merged 3 commits intophp:mainfrom
pierredup:static-build-fixes

Conversation

@pierredup
Copy link
Copy Markdown
Contributor

Some small fixes for the build-static script (mostly issues when running the script multiple times)

  • If libphp is already built, spcCommand is not set and causes error when used
  • Don't error when trying to create static-php-cli directory if it already exists
  • spc-bin doesn't have an arm binary. If SPC_REL_TYPE is set to binary but the arch is arm64, don't download the binary and use source instead

@pierredup pierredup force-pushed the static-build-fixes branch from aebd9e6 to faa975c Compare March 31, 2025 19:35
Comment thread build-static.sh
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

@henderkes
Copy link
Copy Markdown
Contributor

I just realized that the script is completely messed up for consecutive compilations. Half the variables are only set in the else block of the cache key.

@dunglas dunglas merged commit 99064ee into php:main Apr 17, 2025
42 of 43 checks passed
@dunglas
Copy link
Copy Markdown
Member

dunglas commented Apr 17, 2025

Thanks!

@pierredup pierredup deleted the static-build-fixes branch April 17, 2025 13:06
henderkes pushed a commit to static-php/frankenphp that referenced this pull request Apr 18, 2025
* Fixes build-static script

* Add composer to gnu image

* Fix syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants