Repository navigation
ci: every pull request builds the runtime images with the extensions a typical Laravel app installs - #162
Merged
Conversation
…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.
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.
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, withinstall-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_EXTENSIONSruns on every pull request that changes code, once per runtime image, php-fpm's and FrankenPHP's:git archive HEAD, as the README's command does.COPY --from=ghcr.io/mlocati/php-extension-installer:2andinstall-php-extensions.sharp/bin/php-extensionschecks thatphp -mlists each one, and calls into each one, fromphpand fromfrankenphp php-cli.redis,pdo_pgsqlandpgsqlconstruct their client, check its classes and functions, and connect to a closed port, so the failure comes from their own driver.sharp/bin/test --installed --opcache --repeat --passesruns the PHP# suite inside the image, on thephpit installs with itsconf.d, so all ten are loaded.CI_PASSEDandIMAGEneed the job.