Compile redis with msgpack and igbinary

This commit is contained in:
cytopia
2020-12-09 12:40:17 +01:00
parent 7c1ceabf97
commit a0332b964e
10 changed files with 176 additions and 73 deletions

View File

@@ -82,7 +82,7 @@ jobs:
- '8.1'
refs:
- 'master'
- '0.118'
- '0.121'
steps:
# ------------------------------------------------------------

View File

@@ -4,6 +4,15 @@
## Unreleased
## Release 0.121
#### Fixed
- Fixed `msgpack` install for PHP 7.0 - 7.4
#### Changed
- Compile `redis` extension with `msgpack` and `igbinary`
## Release 0.120
#### Fixed

View File

@@ -314,10 +314,10 @@ RUN set -eux \
# -------------------- Installing PHP Extension: memcache --------------------
RUN set -eux \
# Installation: Generic
# Installation: Version specific
# Type: PECL extension
# Default: Pecl command
&& pecl install memcache \
&& pecl install memcache-4.0.5.2 \
# Enabling
&& docker-php-ext-enable memcache \
&& true
@@ -537,9 +537,26 @@ RUN set -eux \
# -------------------- Installing PHP Extension: redis --------------------
RUN set -eux \
# Installation: Generic
# Type: PECL extension
# Default: Pecl command
&& pecl install redis \
# Type: GIT extension
&& git clone https://github.com/phpredis/phpredis /tmp/redis \
&& cd /tmp/redis \
# Custom: Branch
&& git checkout $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1) \
# Custom: Install command
&& REDIS_ARGS=""; \
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& rm -rf /usr/local/include/php/ext/igbinary \
&& rm -rf /usr/local/include/php/ext/msgpack \
\
# Enabling
&& docker-php-ext-enable redis \
&& true

View File

@@ -314,10 +314,10 @@ RUN set -eux \
# -------------------- Installing PHP Extension: memcache --------------------
RUN set -eux \
# Installation: Generic
# Installation: Version specific
# Type: PECL extension
# Default: Pecl command
&& pecl install memcache \
&& pecl install memcache-4.0.5.2 \
# Enabling
&& docker-php-ext-enable memcache \
&& true
@@ -537,9 +537,26 @@ RUN set -eux \
# -------------------- Installing PHP Extension: redis --------------------
RUN set -eux \
# Installation: Generic
# Type: PECL extension
# Default: Pecl command
&& pecl install redis \
# Type: GIT extension
&& git clone https://github.com/phpredis/phpredis /tmp/redis \
&& cd /tmp/redis \
# Custom: Branch
&& git checkout $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1) \
# Custom: Install command
&& REDIS_ARGS=""; \
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& rm -rf /usr/local/include/php/ext/igbinary \
&& rm -rf /usr/local/include/php/ext/msgpack \
\
# Enabling
&& docker-php-ext-enable redis \
&& true

View File

@@ -317,10 +317,10 @@ RUN set -eux \
# -------------------- Installing PHP Extension: memcache --------------------
RUN set -eux \
# Installation: Generic
# Installation: Version specific
# Type: PECL extension
# Default: Pecl command
&& pecl install memcache \
&& pecl install memcache-4.0.5.2 \
# Enabling
&& docker-php-ext-enable memcache \
&& true
@@ -541,9 +541,26 @@ RUN set -eux \
# -------------------- Installing PHP Extension: redis --------------------
RUN set -eux \
# Installation: Generic
# Type: PECL extension
# Default: Pecl command
&& pecl install redis \
# Type: GIT extension
&& git clone https://github.com/phpredis/phpredis /tmp/redis \
&& cd /tmp/redis \
# Custom: Branch
&& git checkout $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1) \
# Custom: Install command
&& REDIS_ARGS=""; \
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& rm -rf /usr/local/include/php/ext/igbinary \
&& rm -rf /usr/local/include/php/ext/msgpack \
\
# Enabling
&& docker-php-ext-enable redis \
&& true

View File

@@ -317,10 +317,10 @@ RUN set -eux \
# -------------------- Installing PHP Extension: memcache --------------------
RUN set -eux \
# Installation: Generic
# Installation: Version specific
# Type: PECL extension
# Default: Pecl command
&& pecl install memcache \
&& pecl install memcache-4.0.5.2 \
# Enabling
&& docker-php-ext-enable memcache \
&& true
@@ -541,9 +541,26 @@ RUN set -eux \
# -------------------- Installing PHP Extension: redis --------------------
RUN set -eux \
# Installation: Generic
# Type: PECL extension
# Default: Pecl command
&& pecl install redis \
# Type: GIT extension
&& git clone https://github.com/phpredis/phpredis /tmp/redis \
&& cd /tmp/redis \
# Custom: Branch
&& git checkout $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1) \
# Custom: Install command
&& REDIS_ARGS=""; \
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& rm -rf /usr/local/include/php/ext/igbinary \
&& rm -rf /usr/local/include/php/ext/msgpack \
\
# Enabling
&& docker-php-ext-enable redis \
&& true

View File

@@ -326,10 +326,10 @@ RUN set -eux \
# -------------------- Installing PHP Extension: memcache --------------------
RUN set -eux \
# Installation: Generic
# Installation: Version specific
# Type: PECL extension
# Default: Pecl command
&& pecl install memcache \
&& pecl install memcache-4.0.5.2 \
# Enabling
&& docker-php-ext-enable memcache \
&& true
@@ -535,9 +535,26 @@ RUN set -eux \
# -------------------- Installing PHP Extension: redis --------------------
RUN set -eux \
# Installation: Generic
# Type: PECL extension
# Default: Pecl command
&& pecl install redis \
# Type: GIT extension
&& git clone https://github.com/phpredis/phpredis /tmp/redis \
&& cd /tmp/redis \
# Custom: Branch
&& git checkout $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1) \
# Custom: Install command
&& REDIS_ARGS=""; \
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& rm -rf /usr/local/include/php/ext/igbinary \
&& rm -rf /usr/local/include/php/ext/msgpack \
\
# Enabling
&& docker-php-ext-enable redis \
&& true

View File

@@ -333,22 +333,26 @@ RUN set -eux \
# -------------------- Installing PHP Extension: redis --------------------
RUN set -eux \
# Installation: Version specific
# Installation: Generic
# Type: GIT extension
&& git clone https://github.com/phpredis/phpredis /tmp/redis \
&& cd /tmp/redis \
# Custom: Branch
&& git checkout $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1) \
# Custom: Install command
&& sed -i'' 's/, ZSTR_LEN(ra->algorithm)//g' redis_array_impl.c \
&& sed -i'' 's|.*sctx->cb\.no_separation.*||g' library.c \
&& sed -i'' 's|.*sctx->cb\.no_separation.*||g' redis_array_impl.c \
&& sed -i'' 's|.*sctx->cb\.no_separation.*||g' cluster_library.c \
&& sed -i'' 's|.*->no_separation.*||g' redis_array_impl.c \
&& phpize \
&& ./configure --enable-redis \
&& REDIS_ARGS=""; \
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& rm -rf /usr/local/include/php/ext/igbinary \
&& rm -rf /usr/local/include/php/ext/msgpack \
\
# Enabling
&& docker-php-ext-enable redis \

View File

@@ -333,22 +333,26 @@ RUN set -eux \
# -------------------- Installing PHP Extension: redis --------------------
RUN set -eux \
# Installation: Version specific
# Installation: Generic
# Type: GIT extension
&& git clone https://github.com/phpredis/phpredis /tmp/redis \
&& cd /tmp/redis \
# Custom: Branch
&& git checkout $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1) \
# Custom: Install command
&& sed -i'' 's/, ZSTR_LEN(ra->algorithm)//g' redis_array_impl.c \
&& sed -i'' 's|.*sctx->cb\.no_separation.*||g' library.c \
&& sed -i'' 's|.*sctx->cb\.no_separation.*||g' redis_array_impl.c \
&& sed -i'' 's|.*sctx->cb\.no_separation.*||g' cluster_library.c \
&& sed -i'' 's|.*->no_separation.*||g' redis_array_impl.c \
&& phpize \
&& ./configure --enable-redis \
&& REDIS_ARGS=""; \
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& rm -rf /usr/local/include/php/ext/igbinary \
&& rm -rf /usr/local/include/php/ext/msgpack \
\
# Enabling
&& docker-php-ext-enable redis \

View File

@@ -471,6 +471,21 @@ extensions_available:
5.6:
type: pecl
version: 2.2.7
7.0:
type: pecl
version: 4.0.5.2
7.1:
type: pecl
version: 4.0.5.2
7.2:
type: pecl
version: 4.0.5.2
7.3:
type: pecl
version: 4.0.5.2
7.4:
type: pecl
version: 4.0.5.2
all:
type: pecl
build_dep: [zlib1g-dev]
@@ -841,38 +856,24 @@ extensions_available:
5.6:
type: pecl
version: 4.3.0
8.0:
type: git
git_url: https://github.com/phpredis/phpredis
git_ref: $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1)
# TODO: This is a nasty work-around to fix current phpredis implementation for PHP 8.0
command: |
sed -i'' 's/, ZSTR_LEN(ra->algorithm)//g' redis_array_impl.c \
&& sed -i'' 's|.*sctx->cb\.no_separation.*||g' library.c \
&& sed -i'' 's|.*sctx->cb\.no_separation.*||g' redis_array_impl.c \
&& sed -i'' 's|.*sctx->cb\.no_separation.*||g' cluster_library.c \
&& sed -i'' 's|.*->no_separation.*||g' redis_array_impl.c \
&& phpize \
&& ./configure --enable-redis \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
8.1:
type: git
git_url: https://github.com/phpredis/phpredis
git_ref: $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1)
# TODO: This is a nasty work-around to fix current phpredis implementation for PHP 8.1
command: |
sed -i'' 's/, ZSTR_LEN(ra->algorithm)//g' redis_array_impl.c \
&& sed -i'' 's|.*sctx->cb\.no_separation.*||g' library.c \
&& sed -i'' 's|.*sctx->cb\.no_separation.*||g' redis_array_impl.c \
&& sed -i'' 's|.*sctx->cb\.no_separation.*||g' cluster_library.c \
&& sed -i'' 's|.*->no_separation.*||g' redis_array_impl.c \
&& phpize \
&& ./configure --enable-redis \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
all:
type: pecl
type: git
git_url: https://github.com/phpredis/phpredis
git_ref: $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1)
command: |
REDIS_ARGS=""; \
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& rm -rf /usr/local/include/php/ext/igbinary \
&& rm -rf /usr/local/include/php/ext/msgpack \
reflection:
already_avail: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1]
rdkafka: