-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support caching extensions built from source #21
Comments
Currently the verification of versions is not done as when extension version in the input changed the cache got invalidated as a new output cache key was generated. Now with building from source for the refs like branches and tags, this actions takes a This action currently only generates a cache key output along with the extension directory which can be passed to If you would like to add version verification you might have to import |
@shivammathur thanks for the pointers, I'll definitely take a look. I definitely want to add version checking here as well. At MongoDB, we build against the latest dev version of the driver, which is not pushed to pecl. Since we always want to build against latest, updating commit hashes in our workflow does not make much sense, so the current method of invalidating the cache would not work (as it will always be |
Any update on this? Would be a really nice win. It could also be nice to show in the output that an extension was built from source to at least make it clear that one is not cachable at the moment. Not sure if that's possible tho. |
Describe the feature
With shivammathur/setup-php#399, it becomes possible to install an extension from source, e.g. by specifying
extensions: mongodb-mongodb/[email protected]
. The same works for commit hashes and branches, but this interferes with the caching.Version
v1
.Underlying issue
This workflow caches the installed .so files for extensions and restores them before
setup-php
is called.setup-php
then checks whether the restored version is correct and only installs the extension if there is a mismatch. This is done by running the equivalent ofphpversion(<extension>)
, which can produce incorrect results when building from source. At a minimum, the cache needs to contain the version that was cached. This can take the form of<extension>-<version>
, withversion
being either a version string or a full git hash. I don't think that the repository is needed to be part of this, as the commit hash should not conflict between different repos without actually pointing to the same content.This process needs to take into account refs that may change, e.g. tags or branch refs. For this reason, whenever an extension is installed from source, the version identifier will always be a commit hash. This is to ensure that if version a.b.c was installed from pecl, this is not considered the same as installing tag a.b.c from a repository.
Describe alternatives
Additional context
Are you willing to submit a PR?
I plan to work on this next but wanted to discuss the approach before getting to work.
The text was updated successfully, but these errors were encountered: