Skip to content

Run make tests + make phpstan with the turbo extension inside docker-library PHP images - #6182

Merged
ondrejmirtes merged 2 commits into
2.2.xfrom
turbo-docker-run
Aug 5, 2026
Merged

Run make tests + make phpstan with the turbo extension inside docker-library PHP images#6182
ondrejmirtes merged 2 commits into
2.2.xfrom
turbo-docker-run

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Follow-up to #6180. The token-numbering probes added there verified exactly one failure mode; this generalizes the CI so the next docker-library incompatibility is caught without anyone writing a probe for it first — and fixes a nasty persistence the bug left behind in user caches.

Verified: the general path catches the bug

With the pre-fix extension (built from b184aaecac, compiled against a Bison-3.8.2-numbered PHP), inside docker-library images:

php:8.3.21 (matched numbering) php:8.3.22 (Bison 3.0.4)
make phpstan [OK] No errors crash (analysis degenerates without PHPDocs, OOM at 450M in the dead-code pass)
test suite green (21065 tests) 2462 failures

With the fixed extension, all legs are green, including php:8.3.22, php:8.4.24 and php:8.5.9.

Workflow change

turbo-token-numbering is replaced by turbo-docker-run: each leg loads the freshly built gnu-x86_64 .so into a docker-library image and runs make phpstan or the paratest suite (mirroring turbo-run, which covers the same scripts on setup-php builds). The 8.3 images are pinned to one release of each known bison numbering; 8.4/8.5 float on the minor tag on purpose, so a future patch release with a surprising build is tested on the next run without a workflow change. The token-id probe stays as a fast-fail first step — a numbering mismatch names itself in one line instead of thousands of test failures.

Environment specifics baked into the job, all hit while reproducing locally: --shm-size=1g (the arena SIGBUSes a parallel worker at docker's default 64M /dev/shm), memory_limit=-1 via a bind-mounted conf.d ini (the images ship no php.ini and the 128M default kills the test bootstrap), vendor installed on the runner host and paratest invoked directly (the images carry neither composer nor unzip).

FileTypeMapper cache-key bump (v5 → v6)

While reproducing, it turned out one broken run persistently poisons the analysis cache: FileTypeMapper caches per-file resolved-PHPDoc name-scope maps validated only by file content hashes and the phpdoc-parser version. A comment-dropping parse writes well-formed but PHPDoc-less maps — and since the file contents didn't change, every later run trusts them: verified locally, a healthy run on the same tree fails identically after one poisoned run, across PHP patch versions, with clear-result-cache powerless (fingerprint: "class Fiber is not generic" — stub generics resolve through the stub file's ftm entry). The affected releases and 2.2.x-dev share phpdoc-parser 2.3.3, so upgrading to the fixed extension would keep the poison, including for users who worked around the bug with PHPSTAN_TURBO=0 after one broken run. Rotating the key to v6- rebuilds the maps once for everyone.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EpvCn4kVHSaS5aaiaaRhEm

ondrejmirtes and others added 2 commits August 5, 2026 10:46
…library PHP images

The docker-library php images build the official tarballs without
regenerating the parser, so their runtime can differ from the builds the
.so artifacts are compiled against — the T_* token-numbering split
(phpstan/phpstan#15037) being the canonical incident. The
turbo-token-numbering probes verified exactly that one failure mode; the
next incompatibility of this kind will not announce itself in a probe
written for the last one.

Replace the probe job with turbo-docker-run: load the freshly built
extension into docker-library images — 8.3.21/8.3.22 pinned (one release
of each known bison numbering), 8.4/8.5 floating on the minor tag so
future patch releases are picked up automatically — and run the same
make tests + make phpstan as turbo-run. Verified against the pre-fix
token bug: 2462 of 21065 tests fail and self-analysis crashes on the
Bison 3.0.4 image, both green on the matched one and with the fixed
extension. The token-id probe stays as a fast-fail first step for the
one-line diagnosis.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EpvCn4kVHSaS5aaiaaRhEm
…dropping parses

A run with the turbo comment-loss bug (phpstan/phpstan#15037) cached
PHPDoc-less name-scope maps under ftm- keys. The entries validate only by
file content hashes and the phpdoc-parser version, so an upgrade to the
fixed extension keeps trusting them — analysis stays broken (missing
generics, mass false positives) until the tmpDir is wiped by hand, and
clear-result-cache does not help. Rotate the variable cache key to v6 so
every installation rebuilds the maps once.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EpvCn4kVHSaS5aaiaaRhEm
@ondrejmirtes
ondrejmirtes merged commit c2dbd45 into 2.2.x Aug 5, 2026
465 of 466 checks passed
@ondrejmirtes
ondrejmirtes deleted the turbo-docker-run branch August 5, 2026 08:51
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