cli icon indicating copy to clipboard operation
cli copied to clipboard

feat: upgrade static-php-cli submodule to v2.7.5

Open pjcdawkins opened this issue 2 months ago • 0 comments

Summary

This PR upgrades the static-php-cli submodule from commit 4c55f4a2 (v1.3.3+132 commits) to v2.7.5 (c5ae719b) and updates the build process to work with the new architecture.

(@crazywhalecc helpfully pointed out our SPC version is rather old)

Changes Made

  1. Upgraded submodule: Updated ext/static-php-cli from commit 4c55f4a2 to v2.7.5 (c5ae719b)

  2. Created ext/craft.yml: New configuration file for static-php-cli v2.7.5 that specifies:

    • PHP version 8.2
    • Enabled extensions: curl, filter, openssl, pcntl, phar, posix, zlib
    • Build options (UPX packing, stripping)
  3. Updated Makefile: Replaced the legacy Docker build process with the new spc-alpine-docker tool:

    • Old: Custom Dockerfile.php with manual build scripts
    • New: bin/spc-alpine-docker build command from static-php-cli v2.7.5
  4. Removed obsolete files:

    • Dockerfile.php (replaced by spc-alpine-docker)
    • ext/extensions.txt (replaced by ext/craft.yml)

Key Differences in v2.7.5

  • The docker/ directory with manual scripts (download.sh, compile-php.sh, etc.) has been removed
  • New unified bin/spc CLI tool with Docker wrappers (spc-alpine-docker, spc-gnu-docker)
  • Configuration via craft.yml instead of extensions.txt in docker/
  • Better dependency management with ext.json, lib.json, and source.json

Testing

To test the build, run:

make php

This will trigger the Linux PHP build using the new spc-alpine-docker tool. The build will:

  1. Create a Docker image with all dependencies and the static-php-cli toolchain
  2. Build PHP with the specified extensions
  3. Copy the resulting binary to internal/legacy/archives/php_linux_

The build may take 10-15 minutes on first run as it sets up the Docker environment.

pjcdawkins avatar Oct 24 '25 22:10 pjcdawkins