Repository navigation
Add coverage support, improve logs and fix bugs - #37
Merged
Merged
Conversation
ibrahimlawal-paystack
added a commit
to PaystackHQ/setup-php
that referenced
this pull request
Aug 19, 2026
When a PHP package install bundles its own default build of a versioned extension (e.g. redis ships with its own recent version pre-enabled), add_pecl_extension correctly detects the version mismatch against the pinned version and falls back to pecl_install - but it does this even when a matching build has already been restored from a CI cache into a separate directory, since shared_extension only checks that *some* file exists at ext_dir, not which version it is. This adds an opt-in CACHED_EXTENSIONS_DIR: when set and a mismatch is detected, look for extension.so there, and if found, copy it into ext_dir and re-check before falling back to a full pecl_install. When CACHED_EXTENSIONS_DIR is unset, behavior is unchanged. Related to shivammathur/cache-extensions#21 and shivammathur#37, where a cached build of a versioned PECL extension is silently ignored and recompiled on every run regardless of caching.
shivammathur
pushed a commit
that referenced
this pull request
Aug 19, 2026
…1108) * fix: honor a cache-restored build when a versioned extension mismatches When a PHP package install bundles its own default build of a versioned extension (e.g. redis ships with its own recent version pre-enabled), add_pecl_extension correctly detects the version mismatch against the pinned version and falls back to pecl_install - but it does this even when a matching build has already been restored from a CI cache into a separate directory, since shared_extension only checks that *some* file exists at ext_dir, not which version it is. This adds an opt-in CACHED_EXTENSIONS_DIR: when set and a mismatch is detected, look for extension.so there, and if found, copy it into ext_dir and re-check before falling back to a full pecl_install. When CACHED_EXTENSIONS_DIR is unset, behavior is unchanged. Related to shivammathur/cache-extensions#21 and #37, where a cached build of a versioned PECL extension is silently ignored and recompiled on every run regardless of caching. * fix: preserve versioned builds in ext_dir instead of a separate cache dir Per @shivammathur's review on the PR: drop the opt-in CACHED_EXTENSIONS_DIR env var. Instead, after installing a versioned extension, keep a second copy of the built .so in ext_dir itself under a name with no .so suffix (e.g. redis-5.3.7), so it can't be mistaken for the active extension and rides along in the same ext_dir that cache-extensions already caches wholesale - no separate cache directory, key, or workflow step required. On a version mismatch, restore that preserved build over the active binary and re-check before falling back to a full pecl_install.
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.
Add coverage support, improve logs and fix bugs
Description
Add support for specifying coverage driver
Improve logs
Install xdebug-2.5.5 on macOS for php5.6
I have written test cases for the changes in this pull request
I have run
npm run formatbefore the commit.npm testreturns with no unit test errors.