Skip to content

E2E test for turbo libc detection - #6311

Merged
ondrejmirtes merged 1 commit into
2.2.xfrom
e2e-turbo-musl-detection
Aug 31, 2026
Merged

E2E test for turbo libc detection#6311
ondrejmirtes merged 1 commit into
2.2.xfrom
e2e-turbo-musl-detection

Conversation

@ondrejmirtes

@ondrejmirtes ondrejmirtes commented Aug 31, 2026

Copy link
Copy Markdown
Member

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

TurboExtensionSelector 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. No fixture needed — phpstan diagnose already prints the verdict:

Turbo platform: linux-gnu-x86_64 (os: Linux, machine: x86_64, libc: gnu, php: 8.2, zts: no, debug: no)

Three legs:

leg environment expected on 2.2.x
1 glibc runner with /lib/ld-musl-x86_64.so.1 present linux-gnu-* ❌ says linux-musl-x86_64, libc: musl
2a php:8.2-cli-alpine linux-musl-*
2b php:8.2-cli-alpine with /etc/alpine-release removed linux-musl-*

Leg 1 creates the loader file with sudo touch: that is exactly what the musl / musl-tools package or a musl cross-compilation sysroot leaves at that path, and exactly what glob('/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.x selector:

glibc + musl loader on disk    -> Turbo platform: linux-musl-x86_64 (... libc: musl ...)   wrong
alpine                         -> Turbo platform: linux-musl-x86_64 (... libc: musl ...)
alpine, no /etc/alpine-release -> Turbo platform: linux-musl-x86_64 (... libc: musl ...)

Against the selector from #6308:

glibc + musl loader on disk    -> Turbo platform: linux-gnu-x86_64  (... libc: gnu ...)
alpine                         -> Turbo platform: linux-musl-x86_64 (... libc: musl ...)
alpine, no /etc/alpine-release -> Turbo platform: linux-musl-x86_64 (... libc: musl ...)

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
ondrejmirtes force-pushed the e2e-turbo-musl-detection branch from 3c0b8a6 to 1849921 Compare August 31, 2026 08:02
@ondrejmirtes
ondrejmirtes marked this pull request as ready for review August 31, 2026 08:04
@ondrejmirtes
ondrejmirtes merged commit 26ab2ce into 2.2.x Aug 31, 2026
435 of 436 checks passed
@ondrejmirtes
ondrejmirtes deleted the e2e-turbo-musl-detection branch August 31, 2026 08:05
@phpstan-bot

Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

@AJenbo

AJenbo commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

thanks

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.

3 participants