Skip to content
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

Add option to override the detected version of a package #189

Merged
merged 2 commits into from
Sep 22, 2020

Conversation

mcfedr
Copy link
Contributor

@mcfedr mcfedr commented Sep 18, 2020

Useful when working with pecl packages that have versions that are not semvar compatible, and when installing from source many packages are detected incorrectly.

Would fix #188, #165

There are many examples of existing pecl extensions that have versions that have problems. Given that PHP 7.4 deprecates pecl, it would be great if pickle could be used to install all extensions, not just those that conveniently have composer compatible version numbers.

Particularly when installing from source this is difficult as pecl extensions don't tend to handle this very well.

Useful when working with pecl packages that have versions that are not semvar compatible, and when installing from source many packages are detected incorrectly
@pierrejoye
Copy link
Member

Excellent work! Thank you!

Reviewed the code, clean, existing tests are green.

I will merge early next week and will add some tests. Or if you have time and motivation, go ahead. We use behat, and unit tests. For this case, behat is fine. :)

@pierrejoye
Copy link
Member

<3 <3 <3 thanks a lot!

@pierrejoye pierrejoye merged commit 9c9e184 into FriendsOfPHP:master Sep 22, 2020
@mcfedr mcfedr deleted the version-override branch September 25, 2020 07:56
@grikdotnet
Copy link

grikdotnet commented Oct 17, 2020

Does it allow installing an extension from a local folder?
Use case: download a zip/gzip archive from github with wget in Alpine and unpack it, e.g. https://xdebug.org/files/xdebug-3.0.0beta1.tgz
wget is provided by an Alpine docker image, while git is not

@pierrejoye
Copy link
Member

pierrejoye commented Oct 17, 2020 via email

@grikdotnet
Copy link

Good evening, cd src dir pickle install . should work

unfortunately it does not

/usr/src/xdebug-3.0.0beta1 # php ../pickle.phar install .

In PackageXml.php line 62:

  The path '/usr/src/xdebug-3.0.0beta1' doesn't contain package.xml

@dbpolito
Copy link

dbpolito commented Nov 3, 2020

Any plans on tagging this soon?

@zluiten
Copy link
Contributor

zluiten commented Nov 13, 2020

To use while not tagged yet

This example uses an intermediate container to build pickle of master branch and then installs the latest mongodb while overriding its invalid semver tag.

FROM composer as pickle

RUN git clone https://github.com/FriendsOfPHP/pickle.git \
    && cd pickle \
    && composer install --no-dev --optimize-autoloader \
    && php -d phar.readonly=0 box.phar build

FROM php:8.0.0RC4-cli-alpine3.12

COPY --from=pickle /app/pickle/pickle.phar /usr/local/bin/pickle

RUN apk add --no-cache autoconf cmake make g++ libzip-dev \
    && docker-php-ext-install zip \
    && chmod +x /usr/local/bin/pickle \
    && pickle install --defaults --no-interaction --version-override=1.9.0 mongodb \
    && docker-php-ext-enable mongodb

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.

Invalid version string
5 participants