diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index fac692020a..5ac3e6aea8 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -886,6 +886,31 @@ jobs: echo "FAIL: tmp was created by a worker, meaning sys_temp_dir='tmp~1' was incorrectly evaluated to 'tmp'" exit 1 fi + - script: | + # A glibc system can carry a musl loader without being a musl system: + # musl-tools, a musl cross-compilation sysroot, or anything else built + # against musl installs /lib/ld-musl-.so.1 as well. PHPStan must + # still pick the glibc turbo build there - picking the musl one makes + # PHP refuse to load the extension at startup: "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)". + sudo touch /lib/ld-musl-x86_64.so.1 + OUTPUT=$(bin/phpstan diagnose -l 0 -c tests/e2e/data/empty.neon) + echo "$OUTPUT" + e2e/bashunit -a contains 'Turbo platform: linux-gnu-' "$OUTPUT" + - script: | + # The mirror image of the leg above: an actual musl system must keep + # picking the musl build - both on Alpine, and (since /etc/alpine-release + # is not what makes a system musl) with that file taken away. The images + # ship no php.ini, so memory_limit would default to 128M, which building + # the DI container already exceeds. + DIAGNOSE='php -d memory_limit=-1 bin/phpstan diagnose -l 0 -c tests/e2e/data/empty.neon' + OUTPUT=$(docker run --rm -v "$PWD:/repo" -w /repo php:8.2-cli-alpine sh -c "$DIAGNOSE") + echo "$OUTPUT" + e2e/bashunit -a contains 'Turbo platform: linux-musl-' "$OUTPUT" + OUTPUT=$(docker run --rm -v "$PWD:/repo" -w /repo php:8.2-cli-alpine sh -c "rm /etc/alpine-release && $DIAGNOSE") + echo "$OUTPUT" + e2e/bashunit -a contains 'Turbo platform: linux-musl-' "$OUTPUT" steps: - name: Harden the runner (Audit all outbound calls)