Skip to content

ci: every pull request builds the runtime images with the extensions a typical Laravel app installs - #162

Merged
heyJordanParker merged 5 commits into
masterfrom
ci/extensions
Oct 17, 2026
Merged

heyJordanParker merged 5 commits into
masterfrom
ci/extensions

Conversation

@heyJordanParker

Copy link
Copy Markdown
Owner

An app on the runtime image installs the extensions a typical Laravel app installs, bcmath exif gd imagick intl pcntl pdo_pgsql pgsql redis zip, with install-php-extensions. The engine changes PHP's internal structures, but no CI job built an extension against it, and the runtime images were built only on a tag.

PHP_EXTENSIONS runs on every pull request that changes code, once per runtime image, php-fpm's and FrankenPHP's:

  1. It builds the image from git archive HEAD, as the README's command does.
  2. It installs the ten on top, as such an app's Dockerfile does: COPY --from=ghcr.io/mlocati/php-extension-installer:2 and install-php-extensions.
  3. sharp/bin/php-extensions checks that php -m lists each one, and calls into each one, from php and from frankenphp php-cli. redis, pdo_pgsql and pgsql construct their client, check its classes and functions, and connect to a closed port, so the failure comes from their own driver.
  4. sharp/bin/test --installed --opcache --repeat --passes runs the PHP# suite inside the image, on the php it installs with its conf.d, so all ten are loaded.

CI_PASSED and IMAGE need the job.

…a typical Laravel app installs

Problem: an app on the runtime image installs bcmath, exif, gd, imagick,
intl, pcntl, pdo_pgsql, pgsql, redis and zip with install-php-extensions.
The engine changes PHP's internal structures, its opcodes, flags and JIT,
but no CI job built an extension against it. The runtime images were built
only on a tag, so an engine change could break an extension's build, its
loading or a request, and the app would find out first.

Solution: PHP_EXTENSIONS builds each runtime image, php-fpm's and
FrankenPHP's, installs the ten on top as such an app's Dockerfile does, and
checks them with sharp/bin/php-extensions: php -m lists each one, and a call
into each answers, from php and from frankenphp php-cli. Then the PHP# suite
runs inside the image with sharp/bin/test --installed, on the php the image
installs with its conf.d, under opcache and each optimizer pass and JIT.
CI_PASSED and IMAGE need the job.

.github/workflows/sharp.yml   PHP_EXTENSIONS, CI_PASSED and IMAGE need it
sharp/bin/php-extensions      php -m and one call per extension
sharp/bin/test                --installed runs the php on the PATH
sharp/README.md               the command, the mode and the job
… php-fpm image runs

Problem: PHP_EXTENSIONS ran the suite on the php-fpm image's release engine
and three tests failed in every mode, for reasons outside the extensions.
overflow_jit.inc read opcache_get_status()['jit']['sharp_operator_vm_calls'],
which zend_jit_status fills only under ZEND_DEBUG. opcodes.phpt lists opcodes
with phpdbg, and the php-fpm image builds with --disable-phpdbg, as
docker-library's does.

Solution: overflow_jit.inc reads the count with ?? [], as the plus_jit and
signatures_jit tests already read it with ?? 0, so the debug builds of LINUX
and LINUX_ZTS still check it. opcodes.phpt skips when run-tests finds no
phpdbg, and still runs on every build and on the FrankenPHP image, which
has one. PHP_EXTENSIONS stops cancelling one host when the other fails.

Zend/tests/sharp/overflow_jit.inc   the VM-call count a debug build keeps
Zend/tests/sharp/opcodes.phpt       skips without phpdbg
.github/workflows/sharp.yml         PHP_EXTENSIONS runs both hosts to the end
Reverted by the next commit. It shows that the guard fails when one
extension stops building against the engine.
PHP_EXTENSIONS failed on it in both rows, at redis's build:
common.h:13:10: fatal error: ext/standard/php_smart_string.h: No such file
or directory. The job installs the current redis again.
@heyJordanParker
heyJordanParker merged commit 4d5670d into master Oct 17, 2026
23 checks passed
@heyJordanParker
heyJordanParker deleted the ci/extensions branch November 3, 2026 22:08
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