Build and distribute standalone PHP CLI alongside FrankenPHP#57
Merged
munezaclovis merged 3 commits intofeat/build-static-php-binariesfrom Apr 14, 2026
Merged
Conversation
Set SPC_OPT_BUILD_ARGS="--build-cli" so static-php-cli emits both
the frankenphp and standalone php binaries in one invocation. This
guarantees both share an identical extension set (previously the
CLI came from dl.static-php.dev with a different build).
The CI workflow now packages dist/static-php-cli/buildroot/bin/php
into php-mac-{arch}-php{version}.tar.gz and uploads it to the same
release as the frankenphp assets.
phpCLIURL is rewritten to resolve to our own release using the
existing platformName() helper, unifying naming with the frankenphp
asset. The full-version detect step (only used to build the old
static-php.dev URL) and the now-unused phpOSNames/phpArchNames maps
are removed.
Follow-ups from PR review: - Gate the release job on refs/heads/main so feature-branch dispatches exercise the build matrix without publishing to the release. - Assert every FrankenPHP binary has a matching PHP CLI tarball before upload (nullglob + count + per-pair existence) so partial builds can never produce an incomplete release. - Remove DetectPHPVersion and ParseFrankenPHPPhpVersion; they lost their only caller when the PHP CLI moved to the unified release URL. - Extract platformNameFor(goos, goarch) and add table tests for it, plus exact-format tests for phpCLIURL and frankenphpAssetName.
The actions/cache step restores dist/static-php-cli/downloads/, which creates the parent dist/static-php-cli/ containing only downloads/. build-static.sh's check for static-php-cli/src then fails, and its fallback `git clone ... static-php-cli` aborts with exit 128 because the directory already exists. Pre-cloning the repo before the cache step ensures src/ is present, so build-static.sh takes the `cd static-php-cli/ && git pull` branch regardless of cache hit or miss.
3ec3400
into
feat/build-static-php-binaries
5 of 6 checks passed
munezaclovis
added a commit
that referenced
this pull request
Apr 14, 2026
The release workflow forwards FrankenPHP binaries from the previous release to each new release, but the PHP CLI tarballs added in #57 were not part of that copy. Add php-* to the download pattern so both binary sets propagate forward together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for building and distributing a standalone PHP CLI binary that shares the exact same extension set as the FrankenPHP binary. Previously, the PHP CLI was downloaded from static-php.dev, which could have different extensions. Now both binaries are built together and distributed from the same release.
Key Changes
SPC_OPT_BUILD_ARGS: "--build-cli"to the build workflow to compile the standalone PHP CLI alongside FrankenPHPphp-mac-{arch}-php{version}.tar.gz)phpCLIURL()to download the PHP CLI from the same GitHub release as FrankenPHP instead of from static-php.dev, ensuring version consistency and identical extension setsImplementation Details
--build-cliflagphpexecutableprvious/pv)https://claude.ai/code/session_012F7YzeARQRFMj3SbKDRpic