cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[BUG]: PECL build no longer working

Open JamesArthurHolland opened this issue 1 year ago • 6 comments

Building on docker using pecl was working before Christmas, now it doesn't work.

Steps to reproduce the behavior:

Docker image: php:8.3-fpm-alpine

RUN pecl install mongodb apcu igbinary redis phalcon-5.6.2
#12 362.8 /usr/local/include/php/Zend/zend_API.h:2311:71: note: expected 'zval **' {aka 'struct _zval_struct **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
#12 362.8  2311 | static zend_always_inline bool zend_parse_arg_array(zval *arg, zval **dest, bool check_null, bool or_object)
#12 362.8       |                                                                ~~~~~~~^~~~
#12 362.8 /tmp/pear/temp/phalcon/phalcon.zep.c: In function 'php_zephir_init_globals':
#12 362.8 /tmp/pear/temp/phalcon/phalcon.zep.c:206421:57: error: assignment to 'zend_string *' {aka 'struct _zend_string *'} from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
#12 362.8 206421 |         phalcon_globals->orm.resultset_prefetch_records = ZSTR_VAL(zend_string_init(ZEND_STRL("0"), 0));
#12 362.8        |                                                         ^
#12 362.8 make: *** [Makefile:210: phalcon.lo] Error 1
#12 362.8 ERROR: `make' failed
#12 ERROR: process "/bin/sh -c pecl install mongodb apcu igbinary redis phalcon-5.6.2" did not complete successfully: exit code: 1
------
 > [php  6/15] RUN pecl install mongodb apcu igbinary redis phalcon-5.6.2:

JamesArthurHolland avatar Jan 13 '25 11:01 JamesArthurHolland

It's the same for all: pecl or non-pecl, all builds are broken

oleghind avatar Jan 14 '25 18:01 oleghind

I was able to find a solution, need to set those flags before building: export CFLAGS="$CFLAGS -DALPINE_LINUX=1 -fpermissive"

oleghind avatar Jan 14 '25 21:01 oleghind

RUN export CFLAGS="$CFLAGS -DALPINE_LINUX=1 -fpermissive"; pecl -d php_suffix=${PHP_VERSION} install phalcon-${PHALCON_VERSION} | tee /tmp/phalcon.install.log

didn't fixes the issue

elcreator avatar Mar 14 '25 16:03 elcreator

ENV CFLAGS="-Wno-error=incompatible-pointer-types"

RUN pecl channel-update pecl.php.net
RUN pecl install phalcon-5.8.0
RUN docker-php-ext-enable phalcon
RUN pecl clear-cache

In my case, Ι set CFLAGS="-Wno-error=incompatible-pointer-types" to environment before installing with pecl.

Tested with these versions:

  • php:8.2-fpm-alpine-phalcon5.3.0
  • php:8.3-fpm-alpine-phalcon5.8.0
  • php:8.4-fpm-alpine-phalcon5.9.2

mitsxu avatar Apr 04 '25 22:04 mitsxu

Dockerfile with my fixes to silence most of repeating warnings and with required for Alpine dependencies and symlinks. It works: https://github.com/phalcon/docker/issues/4#issuecomment-2780032550

elcreator avatar Apr 05 '25 10:04 elcreator

This worked for me

export CFLAGS="-Wno-incompatible-pointer-types" sudo -E pecl install phalcon

a-adamoli avatar Aug 21 '25 03:08 a-adamoli