Skip to content

Add coverage support, improve logs and fix bugs - #37

Merged
shivammathur merged 1 commit into
masterfrom
coverage
Sep 26, 2019
Merged

shivammathur merged 1 commit into
masterfrom
coverage

Conversation

@shivammathur

Copy link
Copy Markdown
Owner

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 format before the commit.

  • npm test returns with no unit test errors.

@shivammathur
shivammathur merged commit 5170bd5 into master Sep 26, 2019
@shivammathur
shivammathur deleted the coverage branch September 26, 2019 15:17
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant