fix(ci): detect FFI without a grep -q pipe that races under pipefail (#236) - #239
Merged
Merged
Conversation
…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
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.
Root cause
The issue suspected a broken Homebrew
php.ini. The real cause is in.github/scripts/run-tests.sh:grep -qexits on the first match (FFI is line 12 of 71). If php is still writing, it gets SIGPIPE, andpipefailmakes the pipeline fail. The script concludes "FFI missing" and adds-d extension=ffi. Homebrew PHP has FFI built in (noffi.so), so every PHP process printsUnable to load dynamic library 'ffi' (tried: .../ffi.so). That warning lands in every test's output, so 0/191 pass. It is timing-dependent, hence ~50%.Evidence (macOS, Homebrew PHP 8.5.10)
php -n -d extension=ffiprints exactly the warning seen in CI.extension_loaded("FFI"), no pipe): 0/200..github/scripts/run-tests.shlocally: 187 passed, 0 failed, 2 skipped, no warning.Closes #236