Don't use the "--defaults" pickle flag

pull/179/head
Michele Locati 2020-10-18 21:35:09 +02:00
parent 9d3ed12e13
commit 912d648edd
No known key found for this signature in database
GPG Key ID: 98B7CE2E7234E28B
1 changed files with 83 additions and 37 deletions

View File

@ -1071,7 +1071,7 @@ installModuleFromSource() {
installPECLModule() { installPECLModule() {
printf '### INSTALLING PECL MODULE %s ###\n' "$1" printf '### INSTALLING PECL MODULE %s ###\n' "$1"
installPECLModule_actual="$1" installPECLModule_actual="$1"
installPECLModule_stdin='\n' rm -rf "$CONFIGURE_FILE"
installPECLModule_manuallyInstalled=0 installPECLModule_manuallyInstalled=0
case "$1" in case "$1" in
amqp) amqp)
@ -1136,35 +1136,40 @@ installPECLModule() {
fi fi
;; ;;
memcached) memcached)
# Set the path to libmemcached install prefix
addConfigureOption 'with-libmemcached-dir' 'no'
if test $PHP_MAJMIN_VERSION -lt 700; then if test $PHP_MAJMIN_VERSION -lt 700; then
installPECLModule_actual="$1-2.2.0" installPECLModule_actual="$1-2.2.0"
# --with-libmemcached-dir (default: no) Set the path to libmemcached install prefix
else else
installPECLModule_stdin='' # Set the path to ZLIB install prefix
# --with-libmemcached-dir (default: no) Set the path to libmemcached install prefix addConfigureOption 'with-zlib-dir' 'no'
installPECLModule_stdin="${installPECLModule_stdin}\n" # Use system FastLZ library
# --with-zlib-dir (default: no) Set the path to ZLIB install prefix addConfigureOption 'with-system-fastlz' 'no'
installPECLModule_stdin="${installPECLModule_stdin}\n" # Enable memcached igbinary serializer support
# --with-system-fastlz (default: no) Use system FastLZ library if php --ri igbinary >/dev/null 2>/dev/null; then
installPECLModule_stdin="${installPECLModule_stdin}no\n" addConfigureOption 'enable-memcached-igbinary' 'yes'
# --enable-memcached-igbinary (default: no) Enable memcached igbinary serializer support else
php --ri igbinary >/dev/null 2>/dev/null && installPECLModule_stdin="${installPECLModule_stdin}yes\n" || installPECLModule_stdin="${installPECLModule_stdin}no\n" addConfigureOption 'enable-memcached-igbinary' 'no'
# --enable-memcached-msgpack (default: no) Enable memcached msgpack serializer support fi
php --ri msgpack >/dev/null 2>/dev/null && installPECLModule_stdin="${installPECLModule_stdin}yes\n" || installPECLModule_stdin="${installPECLModule_stdin}no\n" # Enable memcached msgpack serializer support
# --enable-memcached-json (default: no) Enable memcached json serializer support if php --ri msgpack >/dev/null 2>/dev/null; then
installPECLModule_stdin="${installPECLModule_stdin}yes\n" addConfigureOption 'enable-memcached-msgpack' 'yes'
# --enable-memcached-protocol (default: no) Enable memcached protocol support else
installPECLModule_stdin="${installPECLModule_stdin}no\n" # https://github.com/php-memcached-dev/php-memcached/issues/418#issuecomment-449587972 addConfigureOption 'enable-memcached-msgpack' 'no'
# --enable-memcached-sasl (default: yes) Enable memcached sasl support fi
installPECLModule_stdin="${installPECLModule_stdin}yes\n" # Enable memcached json serializer support
# --enable-memcached-session (default: yes) Enable memcached session handler support addConfigureOption 'enable-memcached-json' 'yes'
installPECLModule_stdin="${installPECLModule_stdin}yes\n" # Enable memcached protocol support
addConfigureOption 'enable-memcached-protocol' 'no' # https://github.com/php-memcached-dev/php-memcached/issues/418#issuecomment-449587972
# Enable memcached sasl support
addConfigureOption 'enable-memcached-sasl' 'yes'
# Enable memcached session handler support
addConfigureOption 'enable-memcached-session' 'yes'
fi fi
;; ;;
mongo) mongo)
installPECLModule_stdin='' # Build with Cyrus SASL (MongoDB Enterprise Authentication) support?
# --with-mongo-sasl (default: no) Build with Cyrus SASL (MongoDB Enterprise Authentication) support? addConfigureOption '-with-mongo-sasl' 'yes'
installPECLModule_stdin="${installPECLModule_stdin}yes\n"
;; ;;
mongodb) mongodb)
if test $PHP_MAJMIN_VERSION -le 505; then if test $PHP_MAJMIN_VERSION -le 505; then
@ -1271,10 +1276,14 @@ installPECLModule() {
cd - >/dev/null cd - >/dev/null
installPECLModule_manuallyInstalled=1 installPECLModule_manuallyInstalled=1
else else
# enable igbinary serializer support? # Enable igbinary serializer support?
php --ri igbinary >/dev/null 2>/dev/null && installPECLModule_stdin='yes\n' || installPECLModule_stdin='no\n' if php --ri igbinary >/dev/null 2>/dev/null; then
# enable lzf compression support? addConfigureOption 'enable-redis-igbinary' 'yes'
installPECLModule_stdin="${installPECLModule_stdin}yes\n" else
addConfigureOption 'enable-redis-igbinary' 'no'
fi
# Enable lzf compression support?
addConfigureOption 'enable-redis-lzf' 'yes'
if test $PHP_MAJMIN_VERSION -le 506; then if test $PHP_MAJMIN_VERSION -le 506; then
installPECLModule_actual="$1-4.3.0" installPECLModule_actual="$1-4.3.0"
else else
@ -1293,8 +1302,8 @@ installPECLModule() {
UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/zstd.h" UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/zstd.h"
cd - >/dev/null cd - >/dev/null
fi fi
# enable zstd compression support? # Enable zstd compression support?
installPECLModule_stdin="${installPECLModule_stdin}yes\n" addConfigureOption 'enable-redis-zstd' 'yes'
fi fi
fi fi
;; ;;
@ -1404,7 +1413,7 @@ installPECLModule() {
if test "$1" != "$installPECLModule_actual"; then if test "$1" != "$installPECLModule_actual"; then
printf ' (installing version %s)\n' "$installPECLModule_actual" printf ' (installing version %s)\n' "$installPECLModule_actual"
fi fi
printf "$installPECLModule_stdin" | MAKE="make -j$(getCompilationProcessorCount $1)" $PECL_COMMAND "$installPECLModule_actual" installPeclPackage "$installPECLModule_actual"
fi fi
case "$1" in case "$1" in
apcu_bc) apcu_bc)
@ -1425,14 +1434,19 @@ installPECLModule() {
esac esac
} }
# Installs pickle to use instead of pecl # Configure the PECL package installed
# and add the zip extension that it requires, making sure its installed first # If we'll use pickle, the zip extension will be added to PHP_MODULES_TO_INSTALL
installPickle() { #
# Updates:
# PHP_MODULES_TO_INSTALL
# Sets:
# USE_PICKLE
configureInstaller() {
USE_PICKLE=0
for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do
if ! stringInList "$PHP_MODULE_TO_INSTALL" "$BUNDLED_MODULES"; then if ! stringInList "$PHP_MODULE_TO_INSTALL" "$BUNDLED_MODULES"; then
if test $PHP_MAJMIN_VERSION -lt 800; then if test $PHP_MAJMIN_VERSION -lt 800; then
pecl channel-update pecl.php.net || true pecl channel-update pecl.php.net || true
PECL_COMMAND="pecl install"
return return
fi fi
curl -sSL https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /tmp/pickle curl -sSL https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /tmp/pickle
@ -1440,12 +1454,40 @@ installPickle() {
if ! stringInList 'zip' "$PHP_PREINSTALLED_MODULES"; then if ! stringInList 'zip' "$PHP_PREINSTALLED_MODULES"; then
PHP_MODULES_TO_INSTALL="zip $(removeStringFromList 'zip' "$PHP_MODULES_TO_INSTALL")" PHP_MODULES_TO_INSTALL="zip $(removeStringFromList 'zip' "$PHP_MODULES_TO_INSTALL")"
fi fi
PECL_COMMAND="/tmp/pickle install --defaults" USE_PICKLE=1
return return
fi fi
done done
} }
# Add a configure option for the pecl/pickle install command
#
# Arguments:
# $1: the option name
# $2: the option value
addConfigureOption() {
if test $USE_PICKLE -eq 0; then
printf -- '%s\n' "$2" >>"$CONFIGURE_FILE"
else
printf -- '--%s=%s\n' "$1" "$2" >>"$CONFIGURE_FILE"
fi
}
# Actually installs a PECL package
#
# Arguments:
# $1: the package to be installed
installPeclPackage() {
if ! test -f "$CONFIGURE_FILE"; then
printf '\n' >"$CONFIGURE_FILE"
fi
if test $USE_PICKLE -eq 0; then
cat "$CONFIGURE_FILE" | MAKE="make -j$(getCompilationProcessorCount $1)" pecl install "$1"
else
MAKE="make -j$(getCompilationProcessorCount $1)" /tmp/pickle install --tmp-dir=/tmp/pickle.tmp --no-interaction --with-configure-options "$CONFIGURE_FILE" -- "$1"
fi
}
# Check if a string is in a list of space-separated string # Check if a string is in a list of space-separated string
# #
# Arguments: # Arguments:
@ -1527,11 +1569,15 @@ cleanup() {
rm -rf /tmp/pear rm -rf /tmp/pear
rm -rf /tmp/src rm -rf /tmp/src
rm -rf /tmp/pickle rm -rf /tmp/pickle
rm -rf /tmp/pickle.tmp
rm -rf "$CONFIGURE_FILE"
} }
resetIFS resetIFS
mkdir -p /tmp/src mkdir -p /tmp/src
mkdir -p /tmp/pickle.tmp
IPE_ERRFLAG_FILE="$(mktemp -p /tmp/src)" IPE_ERRFLAG_FILE="$(mktemp -p /tmp/src)"
CONFIGURE_FILE=/tmp/configure-options
setDistro setDistro
setPHPMajorMinor setPHPMajorMinor
setPHPPreinstalledModules setPHPPreinstalledModules
@ -1552,7 +1598,7 @@ sortModulesToInstall
docker-php-source extract docker-php-source extract
BUNDLED_MODULES="$(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | xargs -n1 dirname | xargs -n1 basename | xargs)" BUNDLED_MODULES="$(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | xargs -n1 dirname | xargs -n1 basename | xargs)"
installPickle configureInstaller
buildRequiredPackageLists $PHP_MODULES_TO_INSTALL buildRequiredPackageLists $PHP_MODULES_TO_INSTALL
if test -n "$PACKAGES_PERSISTENT$PACKAGES_VOLATILE"; then if test -n "$PACKAGES_PERSISTENT$PACKAGES_VOLATILE"; then