E2E test for turbo libc detection - #6311
Merged
Merged
Conversation
The selector decides between the glibc and the musl turbo build by
looking at the filesystem, so it can only be exercised on a real system
whose libc is what it is. `phpstan diagnose` already prints the verdict:
Turbo platform: linux-gnu-x86_64 (os: Linux, machine: x86_64, libc: gnu, ...)
Three legs:
- a glibc runner carrying /lib/ld-musl-x86_64.so.1 (what musl-tools or
a musl cross-build sysroot leaves behind) must still say linux-gnu-*
- Alpine must say linux-musl-*
- so must a musl system with no /etc/alpine-release
The first one is red: the glob('/lib/ld-musl-*') heuristic sees the
loader on disk and selects the musl build, and PHP then refuses to load
it at startup with
Unable to load dynamic library
'.../linux-musl-x86_64/phpstan_turbo-8.5.so'
(libc.musl-x86_64.so.1: cannot open shared object file)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U8evGx6JricZsa9thKWkou
ondrejmirtes
force-pushed
the
e2e-turbo-musl-detection
branch
from
August 31, 2026 08:02
3c0b8a6 to
1849921
Compare
ondrejmirtes
marked this pull request as ready for review
August 31, 2026 08:04
Collaborator
|
This pull request has been marked as ready for review. |
Contributor
|
thanks |
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.
Test-only PR: the first of the three new E2E legs is expected to be red on 2.2.x. It reproduces what #6308 fixes.
How it reproduces
TurboExtensionSelectordecides between the glibc and the musl turbo build by looking at the filesystem, so it can only be exercised on a real system whose libc is what it is. No fixture needed —phpstan diagnosealready prints the verdict:Three legs:
/lib/ld-musl-x86_64.so.1presentlinux-gnu-*linux-musl-x86_64,libc: muslphp:8.2-cli-alpinelinux-musl-*php:8.2-cli-alpinewith/etc/alpine-releaseremovedlinux-musl-*Leg 1 creates the loader file with
sudo touch: that is exactly what themusl/musl-toolspackage or a musl cross-compilation sysroot leaves at that path, and exactly whatglob('/lib/ld-musl-*')looks at. Legs 2a/2b are the mirror image — they guard that the fix does not lose musl detection, 2b specifically that it does not fall back to depending on/etc/alpine-release.Verified locally
Same three commands under Docker. Against the current
2.2.xselector:Against the selector from #6308: