From 9fe2731fec61a7edfaaeb0431c702c21e60d4f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ha=C5=82as?= Date: Tue, 29 Sep 2026 11:12:14 +0200 Subject: [PATCH] fix(ci): detect FFI without a grep -q pipe that races under pipefail (#236) grep -q exits on the first match; php then gets SIGPIPE and pipefail reports the pipeline as failed. run-tests.sh took that as "FFI missing" and added -d extension=ffi, so every PHP process on Homebrew (FFI built in, no ffi.so) printed a startup warning and every test failed. Reproduced locally: 169/200 false negatives with the old check, 0/200 with extension_loaded(). Closes #236 --- .github/scripts/run-tests.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/run-tests.sh b/.github/scripts/run-tests.sh index 578b917..01970d4 100755 --- a/.github/scripts/run-tests.sh +++ b/.github/scripts/run-tests.sh @@ -6,7 +6,9 @@ set -euo pipefail ARGS="-n" if [ -n "${ZVEC_EXT:-}" ]; then ARGS="$ARGS -d extension=$ZVEC_EXT" -elif ! php -n -m | grep -qx FFI; then +# Not `php -m | grep -q`: grep exits on the first match, php gets SIGPIPE, +# and pipefail turns that into a false "FFI missing" (#236). +elif ! php -n -r 'exit(extension_loaded("FFI") ? 0 : 1);'; then ARGS="$ARGS -d extension=ffi" fi for ext in ${PHP_EXTRA_EXTENSIONS:-}; do