ci: fail the PHP Unit build when a PHP extension fails to install - #41848
Merged
Merged
Conversation
setup-php treats a failed extension as a warning, not an error: it prints "✗ <ext> Could not install ..." and lets the step succeed. The job then runs on until something misses the extension. For the Oracle leg that produces a misleading failure. When oci8 fails to install, the job dies half a minute later in Install Server with [InvalidArgumentException] Database <oci> is not supported. because maintenance:install validates --database against the list that OC\Setup::getSupportedDatabases() derives from the *loaded PHP extensions* - so a missing oci8 presents as a database misconfiguration rather than as the extension problem it is. The real cause is further up the log, in a step that reported success. Setting fail-fast makes the Setup PHP step itself fail, with the "✗ oci8" line as its last output. acceptance.yml already sets it the same way. This is setup-php's own fail-fast option, read from the step environment. It is unrelated to, and does not change, the matrix-level strategy.fail-fast that governs whether sibling database legs keep running. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
phil-davis
approved these changes
Sep 22, 2026
phil-davis
pushed a commit
that referenced
this pull request
Sep 22, 2026
….16] (#41849) Backport of #41848. setup-php treats a failed extension as a warning, not an error: it prints "✗ <ext> Could not install ..." and lets the step succeed. The job then runs on until something misses the extension. For the Oracle leg that produces a misleading failure. When oci8 fails to install, the job dies half a minute later in Install Server with [InvalidArgumentException] Database <oci> is not supported. because maintenance:install validates --database against the list that OC\Setup::getSupportedDatabases() derives from the *loaded PHP extensions* - so a missing oci8 presents as a database misconfiguration rather than as the extension problem it is. The real cause is further up the log, in a step that reported success. Setting fail-fast makes the Setup PHP step itself fail, with the "✗ oci8" line as its last output. Unlike master, this branch still has the matrix strategy.fail-fast set to true - #41695 was never backported - so the two settings compose here: a Setup PHP failure cancels the sibling database legs. The comment records why that is tolerable for the way ci.yml calls this workflow today, oci8 being the only extension in the list that downloads anything and Oracle already having a single-database call of its own. Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> Co-authored-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The failure this fixes the reporting of
On run 35615464136 (job
106384881315, a docs-only PR) the Oracle leg went red with:That message is misleading. The actual failure was 36 seconds earlier, in a step that reported success:
setup-phptreats a failed extension as a warning and lets the step pass, so the job ran on toInstall Serverand died there at 14:57:53.maintenance:installvalidates--databaseagainst the listOC\Setup::getSupportedDatabases()builds from the loaded PHP extensions (ociis gated onis_callable('oci_connect'),lib/private/Setup.php), so a missingoci8presents as a database misconfiguration rather than as the extension problem it is.Setting setup-php's
fail-fastmakes theSetup PHPstep itself fail, with the✗ oci8line as its last output.Why the Oracle leg is exposed to this at all
setup-php'ssrc/scripts/extensions/oci.shhas no cache, so on every Oracle job it:instantclient-basiclite-linuxx64.zipandinstantclient-sdk-linuxx64.zipfromdownload.oracle.comvia unversioned "latest" URLs, andphp/pecl-database-oci8mainbranch,>/dev/null 2>&1, which is why the log gives no reason for the failure.~80 MB from Oracle plus a compile, per job, against two unpinned upstreams. That flakiness is not ours to fix; the misattribution is.
It was a flake, not a regression — the same pinned setup-php SHA and PHP version printed
✓ oci8 Installed and enabledon master 8 hours earlier, and the 10.16 sibling PR's Oracle job passed in the same minute. 12 of the last 13 Oracle jobs passed. A re-run cleared it.Please note: two different
fail-fastkeysphp-unit.ymlnow contains both. They are unrelated and this PR does not touch the first:strategy.fail-fast(line 22)false, unchangedenv.fail-fast(new)trueThis is not a revert of #41695.
Not a new pattern
acceptance.yml:174-175already setsenv: fail-fast: trueon itsSetup PHPstep, at the same pinned action SHA.php-unit.ymlwas inconsistent with it.nightly.ymlcalls this same reusable workflow, so the nightly Oracle run picks the change up too.How it was verified
f3e473d).src/install.tsmaps thefail-fastinput/env toprocess.env['fail_fast'];src/scripts/unix.shreads it inread_envand enforces it inadd_log. Executing thatadd_logdirectly:fail_fast=false→ prints✗ oci8 …, exit 0, execution continues (today's behaviour, i.e. the bug),fail_fast=true→ prints✗ oci8 …, exit 1,fail_fast=truewith a✓→ exit 0, continues, so a successful install is unaffected.✗. Checked the setup-php output of the sqlite, mysql:8.0, mariadb:10.6, mariadb:10.11 and postgres:10.21 legs of the run above: every line is✓. This makes real failures louder; it does not create new ones.envplacement and indentation matchacceptance.yml.No changelog entry, following the other workflow-only
ci:commits (0f0098699c,d617d439d4).Backport to 10.16 follows.
Known remaining gap
lint-and-codestyle.ymlis now the onlysetup-phpcall site withoutfail-fast. Its risk is much lower — its extensions are core ones and a failure there surfaces quickly in the next step — so I left it out to keep this diff to the failure mode we actually hit. Happy to add it here if you would rather have all three consistent.🤖 Generated with Claude Code