-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Fix installing libssl on old Alpine versions #902
Conversation
Which PHP extension are you trying to install on PHP 5.6 fpm that showcases the problem? |
I haven't taken the time to isolate the package as I was under the impressions this was a common installation requirement. Here is the list: install-php-extensions gd \
apcu \
amqp \
memcache \
sodium \
redis \
xdebug \
mcrypt \
gmp \
exif \
sockets \
bcmath \
zip \
tidy \
soap \
mysqli \
simplexml \
intl \
opcache \
pdo_mysql \
mongodb \
@composer I can narrow it down if you want later, I'm grabbing lunch now |
Nowaways we don't have a libssl-dev package, but one day we may have it. Also, everywhere we simply specify either the complete package name or a regular expression that identifies it: why are you using the |
The problem is when you run :
it crashes, which gets called indirectly if you run:
The reason I'm using the funky
it outputs something like:
Which you cannot directly install:
Hence, the cut to only fetch the first part, libssl1.0, which does install:
The |
You are right, on Alpine we can't use regular expressions to choose apk libraries (I forgot about that). So, what about buildRequiredPackageLists_libssl="$(apk search | grep -E '^libssl[0-9]' | cut -d- -f1)" |
If that works I'm entirely okay with that! I'm currently not in a place where I can double-check. Good stuff 👍 |
Even better: apk search | grep -E '^libssl[0-9]' | head -1 | cut -d- -f1 |
Perfect! Feel free to change it, otherwise I'll do it tomorrow |
Test: event, imap, mongo, mongodb, openswoole, relay, stomp, swoole
Done: 3ce069c |
When trying to use the script in PHP 5.6 FPM Alpine, it broke trying to install
^libssl[0-9]+(\.[0-9]+)*$
After closer inspection, it seems that the pattern:
is not portable. It crashes in older PHP fpm scripts. I assume that older alpine versions don't support regex pattern installations.
This solution leverages
apk search
andgrep -E
to achieve the same result.