Cannot install swoole using php:8.2-zts-alpine (linux/arm/v7)
shinsenter opened this issue · comments
Shin commented
Version of install-php-extensions
v2.1.79
Error description
> [linux/arm/v7 php 2/4] RUN
.... <truncated> ....
267.2 /tmp/pear/temp/swoole/include/swoole_server.h:1314:19: warning: comparison of integer expressions of different signedness: 'swoole::SessionId' {aka 'long int'} and 'unsigned int' [-Wsign-compare]
267.2 1314 | if (value > UINT_MAX) {
267.2 | ^
271.2 make: *** [Makefile:210: ext-src/php_swoole.lo] Error 1
273.8 /tmp/pear/temp/swoole/ext-src/swoole_admin_server.cc: In function 'void zif_swoole_get_object_by_handle(zend_execute_data*, zval*)':
273.8 /tmp/pear/temp/swoole/ext-src/swoole_admin_server.cc:556:37: warning: comparison of integer expressions of different signedness: 'zend_long' {aka 'int'} and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare]
273.8 556 | if (objects->top <= 1 || handle >= objects->top) {
273.8 | ~~~~~~~^~~~~~~~~~~~~~~
287.3 make: *** [Makefile:216: ext-src/swoole_admin_server.lo] Error 1
287.5 ERROR: `make -j4' failed
Docker image
php:8.2-zts-alpine
Minimal Dockerfile
FROM --platform=linux/arm/v7 php:8.2-zts-alpine
# IPE default settings
ARG IPE_ASPELL_LANGUAGES=en
ARG IPE_GD_WITHOUTAVIF=1
ARG IPE_ICU_EN_ONLY=1
ARG IPE_INSTANTCLIENT_BASIC=1
ARG IPE_KEEP_SYSPKG_CACHE=0
ARG IPE_LZF_BETTERCOMPRESSION=1
ARG IPE_SOURCE=https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions
ADD --chmod=755 $IPE_SOURCE /usr/local/bin/
RUN set -ex && \
install-php-extensions \
@fix_letsencrypt @composer \
apcu \
bcmath \
calendar \
exif \
gd \
gettext \
igbinary \
imap \
intl \
mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
redis \
swoole \
uuid \
yaml \
zip
Michele Locati commented
RUN set -ex && \ install-php-extensions \ @fix_letsencrypt @composer \ apcu \ bcmath \ calendar \ exif \ gd \ gettext \ igbinary \ imap \ intl \ mysqli \ opcache \ pcntl \ pdo_mysql \ pdo_pgsql \ redis \ swoole \ uuid \ yaml \ zip
Are you sure this is the minimal set of extensions to be installed in order to replicate the issue?
Shin commented
I apologize for posting a non-minimal Dockerfile.
I have retested with the latest IPE version and it was able to fix the issue for the php:8.2-zts-alpine
image, however it failed with PHP 8.3.
I would like to reopen this issue and post a more minimal Dockerfile.
FROM --platform=linux/arm/v7 php:8.3-zts-alpine
# IPE default settings
ARG IPE_ASPELL_LANGUAGES=en
ARG IPE_GD_WITHOUTAVIF=1
ARG IPE_ICU_EN_ONLY=1
ARG IPE_INSTANTCLIENT_BASIC=1
ARG IPE_KEEP_SYSPKG_CACHE=0
ARG IPE_LZF_BETTERCOMPRESSION=1
ARG IPE_SOURCE=https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions
ADD --chmod=755 $IPE_SOURCE /usr/local/bin/
RUN set -ex && install-php-extensions swoole
Build command:
docker build --platform=linux/arm/v7 -f Dockerfile .
Build errors:
.... <truncated> ....
111.4 In file included from /usr/local/include/php/main/php.h:428,
111.4 from /tmp/pear/temp/swoole/php_swoole.h:20,
111.4 from /tmp/pear/temp/swoole/ext-src/php_swoole_private.h:25:
111.4 /tmp/pear/temp/swoole/ext-src/php_swoole.cc: In function 'zend_result zm_startup_swoole(int, int)':
111.4 /tmp/pear/temp/swoole/ext-src/php_swoole.cc:647:51: warning: overflow in conversion from 'swTrace_type' to 'zend_long' {aka 'int'} changes value from 'SW_TRACE_ALL' to '-1' [-Woverflow]
111.4 647 | SW_REGISTER_LONG_CONSTANT("SWOOLE_TRACE_ALL", SW_TRACE_ALL);
111.4 /usr/local/include/php/Zend/zend_constants.h:51:105: note: in definition of macro 'REGISTER_LONG_CONSTANT'
111.4 51 | #define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)
111.4 | ^~~~
111.4 /tmp/pear/temp/swoole/ext-src/php_swoole.cc:647:5: note: in expansion of macro 'SW_REGISTER_LONG_CONSTANT'
111.4 647 | SW_REGISTER_LONG_CONSTANT("SWOOLE_TRACE_ALL", SW_TRACE_ALL);
111.4 | ^~~~~~~~~~~~~~~~~~~~~~~~~
111.5 make: *** [Makefile:225: ext-src/swoole_channel_coro.lo] Error 1
111.6 make: *** [Makefile:228: ext-src/swoole_client.lo] Error 1
111.8 make: *** [Makefile:213: ext-src/php_swoole_cxx.lo] Error 1
112.7 make: *** [Makefile:210: ext-src/php_swoole.lo] Error 1
112.8 make: *** [Makefile:234: ext-src/swoole_coroutine.lo] Error 1
113.7 /tmp/pear/temp/swoole/ext-src/swoole_admin_server.cc: In function 'void zif_swoole_get_object_by_handle(zend_execute_data*, zval*)':
113.7 /tmp/pear/temp/swoole/ext-src/swoole_admin_server.cc:515:37: warning: comparison of integer expressions of different signedness: 'zend_long' {aka 'int'} and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare]
113.7 515 | if (objects->top <= 1 || handle >= objects->top) {
113.7 | ~~~~~~~^~~~~~~~~~~~~~~
118.4 make: *** [Makefile:216: ext-src/swoole_admin_server.lo] Error 1
118.5 ERROR: `make -j10' failed