Stop SIGPIPE from failing the macOS PHP verification step - #4890
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
# Conflicts: # .github/workflows/build-php-cli-binaries.yml
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.
Related issues
How AI was used in this PR
Claude Code diagnosed the failure and wrote the fix. I reviewed the diff.
Proposed Changes
The
Verify preinstalled PHP for static-php-clistep added in #4889 fails onmacos-x86_64with:That message is wrong — mbstring is present on the runner image. The check itself was broken.
php -m | grep -qix mbstringlets grep exit the moment it matches, which closes the pipe whilephp -mis still writing. PHP is killed by SIGPIPE and exits 255. Because the step runs underset -o pipefail, the pipeline inherits that failure even though grep succeeded. Reproduced locally on a PHP that definitely has mbstring:It tripped on
mbstringand notzlibpurely because of ordering: mbstring appears near the top ofphp -mand zlib near the bottom, so only the mbstring match leaves enough unwritten output to trigger SIGPIPE. That asymmetry is what made it read like a genuine missing-extension result.The module list is now captured once and matched against in the loop, so nothing is piped out of
phpand there is no early-closed pipe.Testing Instructions
Verified locally by extracting the step from the workflow and running it under the same shell GitHub uses (
/bin/bash --noprofile --norc -e -o pipefail):mbstring zliblist → exits 0 and printsphp -v/composer --versionRequired PHP extension missing: …, so the check hasn't been defangedEnd to end, dispatch Build PHP CLI Binaries from this branch with
apps_cdn_visibility: none:Expect all five targets green.
Pre-merge Checklist
🤖 Generated with Claude Code