Skip to content

Fix incorrect musl detection causing turbo to fail on some systems - #6308

Merged
ondrejmirtes merged 1 commit into
phpstan:2.2.xfrom
AJenbo:musl
Aug 31, 2026
Merged

Fix incorrect musl detection causing turbo to fail on some systems#6308
ondrejmirtes merged 1 commit into
phpstan:2.2.xfrom
AJenbo:musl

Conversation

@AJenbo

@AJenbo AJenbo commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

The current implementation checks for musl tools being installed which can be true even if your system is glibc based... for example if you build things using musl. Instead it's better to look at what's in /proc/self/maps.

Context: On 2.2.10 I get the following error

PHP Warning: PHP Startup: Unable to load dynamic library './vendor/phpstan/phpstan/turbo-ext/linux-musl-x86_64/phpstan_turbo-8.5.so' (tried: ./vendor/phpstan/phpstan/turbo-ext/linux-musl-x86_64/phpstan_turbo-8.5.so (libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory), /usr/lib/php/20250925/./vendor/phpstan/phpstan/turbo-ext/linux-musl-x86_64/phpstan_turbo-8.5.so.so (/usr/lib/php/20250925/./vendor/phpstan/phpstan/turbo-ext/linux-musl-x86_64/phpstan_turbo-8.5.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

@AJenbo AJenbo changed the title Fix musl detection causing turbo to fail on some systems Fix incorrect musl detection causing turbo to fail on some systems Aug 30, 2026
@staabm

staabm commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Can the initial error be reproduced in CI?

@AJenbo

AJenbo commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Yes you could run apt install musl-tools and then it should trigger the issue.

I'm not exactly sure if this would be worth adding a new CI job for, or if it would fit in to one of the existing ones.

@ondrejmirtes

Copy link
Copy Markdown
Member

Added a failing test. #6311

I rebase this PR, the test should pass.

@ondrejmirtes
ondrejmirtes merged commit 51d272f into phpstan:2.2.x Aug 31, 2026
437 of 438 checks passed
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you!

@AJenbo
AJenbo deleted the musl branch August 31, 2026 08:12
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