Skip to content

[Homebrew/PHP] Build PHP and FPM directly from upstream source - #119

Draft
brandonpayton wants to merge 7 commits into
mainfrom
packaging/php-direct-source-qk044
Draft

[Homebrew/PHP] Build PHP and FPM directly from upstream source#119
brandonpayton wants to merge 7 commits into
mainfrom
packaging/php-direct-source-qk044

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Why

PHP is still built through Kandelo's legacy package registry. That leaves the
tap unable to own PHP's source recipe and prevents the old registry entry from
being retired.

This change gives the core tap a complete, direct-source PHP build. It produces
the command-line runtime, PHP-FPM, and the optional modules needed by Kandelo's
PHP and WordPress workloads without calling the transitional registry bridge.

What changes

  • Build PHP 8.3.15 from its checksum-pinned upstream source with Kandelo's SDK.
  • Consume the existing core-tap bottles for ICU, libcurl, libc++, libiconv,
    libxml2, libzip, OpenSSL, SQLite, and zlib.
  • Install php, php-fpm, six loadable modules (curl, intl, opcache,
    phar, zend_test, and zip), ICU runtime data, sample configuration,
    manuals, and licenses.
  • Keep optional modules out of the base runtime until users explicitly load
    them.
  • Preserve Kandelo's cooperative timeout and extension-boundary adaptations as
    checksum-pinned tap assets.
  • Instrument the fork-capable CLI, FPM, and opcache paths and validate every
    Wasm output before installation.

Runtime boundaries

Kandelo does not provide cross-process writable MAP_SHARED memory today.
Accordingly, opcache remains disabled by default and is supported only with
opcache.file_cache_only=1. The Formula tests both the supported mode and the
truthful failure when shared-memory opcache is requested.

Validation

  • brew style Formula/php.rb
  • ruby -c Formula/php.rb
  • git diff --check
  • Complete Formula test against the newly built keg:
    • PHP CLI and PHP-FPM on Node.js and Chromium
    • fork, wait, System V inter-process communication, sockets, and DBA behavior
    • all six optional modules and their import closure
    • ICU data integrity and fork replay
    • supported and unsupported opcache modes
    • persistent SQLite writes
    • PHP-FPM FastCGI service startup and teardown on Node.js and Chromium

Two Linux diagnosis runs proved that the first build failure was not caused by
compiler parallelism:

  • Run 30296649906
    captured exit status 127 before compilation because the Formula requested
    macOS's gmake executable name on Linux.
  • Run 30296652561
    reproduced the same missing executable at -j2, ruling out the original
    -j4 concurrency as the cause.

Run 30297920467
tested Formula commit 0e2873973b2afb0272a79903eb46b007db37b9a6.
It completed the PHP build, bottle creation, full Node.js and Chromium Formula
tests, and source-closure revalidation. It then stopped in the strict bottle
handoff because the publisher incorrectly treated PHP's curl.so dynamic-link
side module as a process executable and required the process-only
__abi_version export.

Automattic/kandelo#1119 corrects that shared artifact-role classifier without
weakening executable validation. This branch will receive one exact dry run
against that publisher after #1119 lands and the tap caller pin is rotated.

Rollout notes

This PR does not publish a PHP bottle or change tap main. PRs #120 and #121
first corrected the public SQLite and libxml2 bottle declarations. PR #122 then
landed the sealed tap-recipe support boundary. Current branch head
7876c8ca22f28f0f3aa6a510b6722cab0cf972c5 contains those current-main
contracts; the PHP Formula bytes remain the already-tested 0e287397...
version.

The three PHP adaptation assets live in commit
220b0690536d4a2c7c1fd3a704aea093aad6e206, and the Formula fetches their exact
raw URLs. That commit must remain reachable from main: merge this branch with
history preserved, or land the asset commit separately before merging the
Formula commit.

The WordPress/LAMP image handoff has not yet been rerun against a published PHP
bottle; that belongs to the publication and image-cutover step after this
source recipe is reviewed.

Scope

This is a Homebrew packaging and build change. It does not change Kandelo's
kernel or ABI. The PHP Formula exercises the same Node.js and browser host
runtime paths that package consumers use.

Add the reviewed PHP timeout, extension-boundary, and ICU-data-loader sources as immutable inputs for the direct Formula.
Replace the transitional registry bridge with a direct PHP 8.3 source build, complete static and loadable extension closure, ICU data, CLI/FPM artifacts, and Node/Chromium service validation.
PHP must compile with the declared host GNU Make rather than the tap's wasm target program. Homebrew installs that dependency as gmake on macOS and make on Linux; select the platform-owned name and fail clearly if the sealed native proxy is unavailable.
@brandonpayton brandonpayton changed the title [Homebrew] Build PHP and FPM directly from upstream source [Homebrew/PHP] Build PHP and FPM directly from upstream source Jul 27, 2026
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.

1 participant