ci: fail the PHP Unit build when a PHP extension fails to install [10.16] - #41849
Open
oc-tmueller wants to merge 1 commit into
Open
oc-tmueller wants to merge 1 commit into
oc-tmueller wants to merge 1 commit into
Conversation
….16] 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. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.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.
Backport of #41848. Please merge that one first.
The failure this fixes the reporting of
setup-phptreats a failed extension as a warning and lets the step pass. On master's run 35615464136 that produced a red Oracle job whose visible error named the wrong thing entirely:maintenance:installvalidates--databaseagainst the listOC\Setup::getSupportedDatabases()builds from the loaded PHP extensions, so a missingoci8presents as a database misconfiguration. The real cause was 36 seconds earlier, in a step that reported success.Setting setup-php's
fail-fastmakes theSetup PHPstep itself fail, with the✗ oci8line as its last output.One difference from the master PR, and why the comment here is longer
This branch still has the matrix
strategy.fail-fast: true(line 22) — #41695 switched it off on master and was never backported. So unlike on master, the two settings compose here: a failed extension now aborts its shard, which cancels the sibling database shards.That is tolerable for the way
ci.ymlcalls this workflow today, and the comment says so rather than waving it off:oci8is the only extension in this list that downloads anything. Verified in the green 10.16 run:curl,gd,json,xml,zip,imagickall reportEnabledin ~3 ms each (they come with setup-php's own PHP 7.4 build), whileoci8reportsInstalled and enabledafter 29 s of Oracle Instant Client download plus compile.ci.yml:32-35already gives Oracle its own single-database call — with a comment saying it exists precisely "so that a slow or failing Oracle run cannot cancel the other databases via fail-fast". That leg has no siblings to cancel.Worth a maintainer decision, deliberately not done here: the guarantee above is a property of the current caller, not of this reusable workflow —
databasesis aworkflow_callinput, so a future caller mixingoracle:into a multi-database list would lose it. Backporting #41695 (strategy.fail-fast: false) would remove the interaction entirely, and the Oracle leg is a single job so fail-fast buys it nothing. I kept that out of this PR as a separate behavioural change for 10.16 CI.Why the Oracle leg is exposed at all
setup-php'ssrc/scripts/extensions/oci.shhas no cache, so every Oracle job downloadsinstantclient-basiclite-linuxx64.zipandinstantclient-sdk-linuxx64.zipfromdownload.oracle.comvia unversioned "latest" URLs, then compiles oci8 from thephp/pecl-database-oci8mainbranch — both wrapped in>/dev/null 2>&1, which is why the log gives no reason for the failure. That flakiness is not ours to fix; the misattribution is.How it was verified
Against the real upstream script at this branch's pinned SHA (
accd6127, v2.37.0).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 1fail_fast=truewith a✓→ exit 0, continues, so a successful install is unaffectedNo currently-green job relies on a tolerated
✗— every setup-php line in the recent 10.16 runs is✓. YAML parses;envplacement matches master'sacceptance.yml.nightly.ymlcalls this same reusable workflow, so it picks the change up too.No changelog entry, following the other workflow-only
ci:commits.🤖 Generated with Claude Code