php: build and test the complete CLI, FPM, and extension runtime - #44
php: build and test the complete CLI, FPM, and extension runtime#44brandonpayton wants to merge 3 commits into
Conversation
207751d to
e3da0db
Compare
|
Devil's-advocate review: ACCEPTED, BUT PREREQUISITE-GATED at exact head The candidate itself has no blocking correctness finding. I traced its complete declared dependency closure through exact fully-qualified versioned kegs, the private libc++ sysroot, ordered compile/link inputs, the 70-object intl closure, ICU data installation, CLI/FPM/side-module artifact guards, Node/Chromium execution, and the real AF_UNIX FastCGI teardown. The formula uses the canonical tap runner and exact descendant status multiset Independent source evidence: the official PHP 8.3.15 tarball matched SHA-256 Do not merge this PR yet. Exact tap prerequisites are:
Base |
Install ICU data without mutating dependency kegs, link every declared intl PIC object, and exercise extensions plus fork replay in Node and Chromium. Stage truthful FPM account/config fixtures, serve a real FastCGI request, and require the exact clean-master/terminated-worker shutdown contract.
e3da0db to
bbdff0f
Compare
Why
Kandelo needs a real PHP runtime from Homebrew so common web applications can be
built into images and installed inside running machines without using the older
package registry. A command-only wrapper would not prove PHP's process manager,
configuration, internationalization data, or loadable extensions. Providing the
complete PHP 8.3.15 package matters because those are the runtime surfaces that
applications actually use.
What changed
This adds PHP 8.3.15 to Kandelo's first-party Homebrew tap as a normal
source-built Formula. The keg, which is Homebrew's installed directory for one
package version, owns the PHP command-line executable, PHP-FPM process manager,
runtime configuration, International Components for Unicode (ICU) data, and
the loadable extensions needed by common PHP applications.
The Formula builds through Kandelo's SDK and declares every library it consumes as a Homebrew dependency: ICU, libcurl, libc++, GNU libiconv, libxml2, libzip, OpenSSL, SQLite, and zlib.
It installs:
bin/phpandsbin/php-fpmexecutables;opcache.so,curl.so,phar.so,zend_test.so,zip.so, andintl.so;The build uses a private sysroot populated from the declared libc++ keg, preserves linker argument order, enables shared-module output for every generated libtool tag, and derives the complete
intlobject list from PHP's generated Makefile. Reproducible path mappings keep host build paths out of the resulting Wasm files.The Formula also rejects malformed artifacts. It checks the Kandelo ABI, the VM-interrupt import, required fork exports, dynamic side-module imports and relocation exports, legacy Asyncify markers, and embedded host paths. Opcache is fork-instrumented because it can execute a fork path; the non-forking side modules are rejected if they accidentally expose executable fork instrumentation.
musl
fopencookiecorrectionPHP's cross-compilation probe treats every Linux host as though it were glibc. For Kandelo's truthful
wasm32-unknown-linux-musltarget, that incorrectly definesCOOKIE_SEEKER_USES_OFF64_T, even though musl'sfopencookieseek callback usesoff_t *, not glibc'soff64_t *.The Formula fixes the generated PHP configuration before compilation by preserving
HAVE_FOPENCOOKIEand removing only the glibc-only callback-type define. Fail-closed checks ensure thatfopencookiesupport remains enabled and that the incorrect define is gone. This correction is folded into the first PHP purpose commit rather than carried as a follow-up fix.Runtime test contract
brew testis designed to exercise the installed Homebrew bytes through Kandelo's normal runtime path:intlcall afterpcntl_fork()replay.php-fpm, connects through its AF_UNIX socket, serves a staged PHP request, and checks shutdown of both the FPM master and worker.PHP-FPM 8.3.15 can finish with a clean master and a worker terminated by
SIGTERM; the test requires that exact descendant status set and separately requires the master and root test process to exit successfully.Exact-head validation completed
The following checks were run against head
bbdff0fda7213185fa026727c33014d497222094, tree5bc77d8d8f0911b1b421642affe275c67d0df876:fopencookiecorrection and its fail-closed assertions.This exact head has not yet produced the final bottle, so the validation above does not claim a final poured runtime result. Earlier development builds established the Node, Chromium, and FPM test path; those tests must run again against the final merged dependency graph and the exact bottle that will be published.
Remaining merge and publication gates
Do not merge this PR until the tap contains the exact dependency Formula sources this build requires, including ICU, libzip, libc++ PIC archives, the libcurl PIC archive, and libxml2 linked to GNU libiconv. Then restack this branch on current tap main and rerun strict audit and
brew readall.Final bottle publication also requires:
This PR contains Formula source and tests only. It does not contain bottle bytes, bottle metadata, a binary index entry, or a change to the main Kandelo repository.
Exact candidate
bbdff0fda7213185fa026727c33014d4972220945bc77d8d8f0911b1b421642affe275c67d0df876da5f694d1c9c01656bfd1beeb78a710af3a25d6e