Skip to content

TEMPORARY: test cross-version resolve for PHP 5.4 on Windows - #53

Closed
Sreini wants to merge 7 commits into
masterfrom
test/fix-win54
Closed

Sreini wants to merge 7 commits into
masterfrom
test/fix-win54

Conversation

@Sreini

@Sreini Sreini commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Throwaway draft to test whether resolving dependencies under PHP 8.3 with composer config platform.php 5.4.45, then switching to PHP 5.4 to run the tests, gets the 5.4/Windows cell working. Will be closed once CI reports.

The phpstan job has been red on every branch since April, and the errors
kept changing because composer.phpstan.json asked for ^2.1 with its lock
file gitignored, so each run resolved whatever was newest. In September it
reported two curl_getinfo stub errors at Client.php:156-157; it now reports
two entirely different ones. Pinning to an exact version stops the target
moving.

Against 2.3.4 the two remaining findings are correct, not false positives:

  127  Comparison operation ">=" between 0|1 and 0 is always true
  199  Unreachable statement - code above always terminates

Every path through the Client::request retry loop returns, continues or
throws, and a continue only happens while $retries > 0. So $retries is only
ever 0 or 1 at the condition check, and the loop never ends by exhausting
its bound, which makes the trailing throw dead today.

Both constructs are deliberate -- the bound documents the retry budget and
the throw guards against a future edit introducing a fall-through path --
so they are recorded in ignoreErrors with that reasoning rather than
removed. Worth a maintainer decision if you would rather drop the throw.

Verified: phpstan reports no errors on both PHP 7.4 (what CI uses) and 8.3.
Neither failure is about dependency resolution, and neither needs a
committed composer.lock. PHP 5.4 resolves and tests fine today on both
ubuntu and macOS; only specific runner/OS combinations are broken.

macOS, PHP 5.6/7.4/8.0/8.5: killed at exactly 10m04s by timeout-minutes,
every time, inside setup-php and before actions/checkout runs. macOS 5.4
finishes in 37s, so the others are compiling rather than fetching a
prebuilt binary. Raised the timeout to 30 minutes for both jobs.

Windows, PHP 5.4: composer exits 1 roughly a quarter of a second after
"Loading composer repositories", printing nothing at all. A resolution
failure would explain itself, so this is a crash. It passed in September
and nothing in the repo changed, so the runner moved. composer 2.3 raised
its floor to PHP 7.2.5 and `tools: composer:v2` installs the newest 2.x,
which makes an incompatible composer the most likely cause, so the 5.x
jobs now ask for the 2.2 LTS line explicitly.

The Windows change is a best guess that CI can confirm or refute quickly.
If 5.4 on Windows still crashes, the fallback is to drop that one
combination; 5.4 stays genuinely covered by ubuntu and macOS either way.
Reverts the temporary display_errors and composer -vvv changes from the
two preceding commits, now that they have answered the question.

composer -vvv showed the job reaching

  Downloading https://repo.packagist.org/packages.json

and the process then exiting 1 with no output whatsoever, 0.17s later.
Nothing was printed even with display_errors=On and error_reporting=-1,
so this is not a suppressed PHP error; the process dies. The CA bundle is
located and reported valid immediately beforehand, so it is not
certificate discovery either.

PHP 5.4.45 on Windows NT 6.2 cannot complete a TLS handshake with
packagist and crashes rather than failing. On ubuntu and macOS, PHP 5.4
links the system OpenSSL and passes. Packagist's TLS requirements are not
ours to change and the PHP 5.4 Windows binaries are long EOL, so nothing
in this repo can fix this combination. It passed in September; the runner
image moved, not the repo.

PHP 5.4 support is unaffected. It stays in the matrix and stays genuinely
tested, on ubuntu and macOS, and composer.json still declares >=5.3.0.
…ners

on: [push, pull_request] fired two identical runs for every push to a PR
branch. On commit ca20989 they were created three seconds apart, and their
ten macOS jobs all started within twenty seconds of each other, each
invoking setup-php against the same runner tool cache.

The result was that the same commit produced opposite macOS outcomes:

  pull_request run   5/5 macOS jobs passed
  push run           5/5 macOS jobs failed

The failures were "composer: command not found" at composer validate --
setup-php reported success but left composer off the PATH, which is what a
lost race over the tool cache looks like. The earlier macOS timeouts are
likely the same contention, ten jobs building PHP at once.

Restricting push to master gives PR branches exactly one run, and a
concurrency group cancels superseded runs on rapid pushes.

Integration_tests was gated on the push event, which previously included
PR branches. With push now master-only, the condition is widened to master
pushes plus same-repo pull requests, so coverage and API quota use are
unchanged. Fork PRs are excluded because they never receive TINIFY_KEY.
@Sreini

Sreini commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Worked. Confirmed the tests genuinely run on PHP 5.4 (PHP_VERSION = 5.4.45, PHPUnit 4.8.36, OK 78 tests / 107 assertions) rather than on the 8.3 used for resolution. Folded into #51 in c7a44b2; the exclusion there is removed. Closing; branch deleted.

@Sreini Sreini closed this Nov 2, 2026
@Sreini
Sreini deleted the test/fix-win54 branch November 2, 2026 11:19
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