cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[BUG]: Phalcon v5.9.3 fails to compile on Alpine 3.21 (x86_64/ARM) via Docker

Open joseluisq opened this issue 5 months ago • 2 comments

Questions? Forum: https://phalcon.io/forum or Discord: https://phalcon.io/discord

Describe the bug

Phalcon no longer builds on php:8.4.11-fpm-alpine3.21 (32/64-bit) It fails with the error:

/usr/local/include/php/Zend/zend_API.h:1663:60: error: passing argument 2 of 'zend_parse_arg_array' from incompatible pointer type [-Wincompatible-pointer-types]

The last working build was on php:8.4.7-fpm-alpine3.20.

To Reproduce

Provide output if related. Provide coredump if any. Use https://docs.phalcon.io/latest/generating-backtrace as reference.

Build Phalcon v5.9.3 using the php:8.4.11-fpm-alpine3.21 (armv7) Docker image.

git clone --depth=1 --branch=v5.9.3 https://github.com/phalcon/cphalcon.git /opt/phalcon
cd /opt/phalcon/build
sh ./install
docker-php-ext-enable phalcon

This is an extract of the log error. See full CI build logs.

#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c:206316:17: note: in expansion of macro 'Z_PARAM_STR'
#8 484.5 206316 |                 Z_PARAM_STR(label)
#8 484.5        |                 ^~~~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2244:76: note: expected 'zend_string **' {aka 'struct _zend_string **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
#8 484.5  2244 | static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num)
#8 484.5       |                                                              ~~~~~~~~~~~~~~^~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c: In function 'zim_Phalcon_Forms_Element_AbstractElement_setName':
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2062:58: error: passing argument 2 of 'zend_parse_arg_str' from incompatible pointer type [-Wincompatible-pointer-types]
#8 484.5  2062 |                 if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null, _i))) { \
#8 484.5 /usr/local/include/php/Zend/zend_portability.h:363:52: note: in definition of macro 'UNEXPECTED'
#8 484.5   363 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
#8 484.5       |                                                    ^~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2069:9: note: in expansion of macro 'Z_PARAM_STR_EX'
#8 484.5  2069 |         Z_PARAM_STR_EX(dest, 0, 0)
#8 484.5       |         ^~~~~~~~~~~~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c:206349:17: note: in expansion of macro 'Z_PARAM_STR'
#8 484.5 206349 |                 Z_PARAM_STR(name)
#8 484.5        |                 ^~~~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2244:76: note: expected 'zend_string **' {aka 'struct _zend_string **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
#8 484.5  2244 | static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num)
#8 484.5       |                                                              ~~~~~~~~~~~~~~^~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c: In function 'zim_Phalcon_Forms_Element_AbstractElement_setUserOption':
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2062:58: error: passing argument 2 of 'zend_parse_arg_str' from incompatible pointer type [-Wincompatible-pointer-types]
#8 484.5  2062 |                 if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null, _i))) { \
#8 484.5 /usr/local/include/php/Zend/zend_portability.h:363:52: note: in definition of macro 'UNEXPECTED'
#8 484.5   363 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
#8 484.5       |                                                    ^~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2069:9: note: in expansion of macro 'Z_PARAM_STR_EX'
#8 484.5  2069 |         Z_PARAM_STR_EX(dest, 0, 0)
#8 484.5       |         ^~~~~~~~~~~~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c:206391:17: note: in expansion of macro 'Z_PARAM_STR'
#8 484.5 206391 |                 Z_PARAM_STR(option)
#8 484.5        |                 ^~~~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2244:76: note: expected 'zend_string **' {aka 'struct _zend_string **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
#8 484.5  2244 | static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num)
#8 484.5       |                                                              ~~~~~~~~~~~~~~^~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c: In function 'zim_Phalcon_Forms_Element_AbstractElement_setUserOptions':
#8 484.5 /usr/local/include/php/Zend/zend_API.h:1663:60: error: passing argument 2 of 'zend_parse_arg_array' from incompatible pointer type [-Wincompatible-pointer-types]
#8 484.5  1663 |                 if (UNEXPECTED(!zend_parse_arg_array(_arg, &dest, check_null, 0))) { \
#8 484.5 /usr/local/include/php/Zend/zend_portability.h:363:52: note: in definition of macro 'UNEXPECTED'
#8 484.5   363 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
#8 484.5       |                                                    ^~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:1670:9: note: in expansion of macro 'Z_PARAM_ARRAY_EX2'
#8 484.5  1670 |         Z_PARAM_ARRAY_EX2(dest, check_null, separate, separate)
#8 484.5       |         ^~~~~~~~~~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:1673:9: note: in expansion of macro 'Z_PARAM_ARRAY_EX'
#8 484.5  1673 |         Z_PARAM_ARRAY_EX(dest, 0, 0)
#8 484.5       |         ^~~~~~~~~~~~~~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c:206411:17: note: in expansion of macro 'Z_PARAM_ARRAY'
#8 484.5 206411 |                 Z_PARAM_ARRAY(options)
#8 484.5        |                 ^~~~~~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2314:71: note: expected 'zval **' {aka 'struct _zval_struct **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
#8 484.5  2314 | static zend_always_inline bool zend_parse_arg_array(zval *arg, zval **dest, bool check_null, bool or_object)
#8 484.5       |                                                                ~~~~~~~^~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c: In function 'zim_Phalcon_Forms_Element_Select___construct':
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2062:58: error: passing argument 2 of 'zend_parse_arg_str' from incompatible pointer type [-Wincompatible-pointer-types]
#8 484.5  2062 |                 if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null, _i))) { \
#8 484.5 /usr/local/include/php/Zend/zend_portability.h:363:52: note: in definition of macro 'UNEXPECTED'
#8 484.5   363 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
#8 484.5       |                                                    ^~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2069:9: note: in expansion of macro 'Z_PARAM_STR_EX'
#8 484.5  2069 |         Z_PARAM_STR_EX(dest, 0, 0)
#8 484.5       |         ^~~~~~~~~~~~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c:206771:17: note: in expansion of macro 'Z_PARAM_STR'
#8 484.5 206771 |                 Z_PARAM_STR(name)
#8 484.5        |                 ^~~~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2244:76: note: expected 'zend_string **' {aka 'struct _zend_string **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
#8 484.5  2244 | static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num)
#8 484.5       |                                                              ~~~~~~~~~~~~~~^~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:1663:60: error: passing argument 2 of 'zend_parse_arg_array' from incompatible pointer type [-Wincompatible-pointer-types]
#8 484.5  1663 |                 if (UNEXPECTED(!zend_parse_arg_array(_arg, &dest, check_null, 0))) { \
#8 484.5 /usr/local/include/php/Zend/zend_portability.h:363:52: note: in definition of macro 'UNEXPECTED'
#8 484.5   363 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
#8 484.5       |                                                    ^~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:1670:9: note: in expansion of macro 'Z_PARAM_ARRAY_EX2'
#8 484.5  1670 |         Z_PARAM_ARRAY_EX2(dest, check_null, separate, separate)
#8 484.5       |         ^~~~~~~~~~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:1673:9: note: in expansion of macro 'Z_PARAM_ARRAY_EX'
#8 484.5  1673 |         Z_PARAM_ARRAY_EX(dest, 0, 0)
#8 484.5       |         ^~~~~~~~~~~~~~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c:206774:17: note: in expansion of macro 'Z_PARAM_ARRAY'
#8 484.5 206774 |                 Z_PARAM_ARRAY(attributes)
#8 484.5        |                 ^~~~~~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2314:71: note: expected 'zval **' {aka 'struct _zval_struct **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
#8 484.5  2314 | static zend_always_inline bool zend_parse_arg_array(zval *arg, zval **dest, bool check_null, bool or_object)
#8 484.5       |                                                                ~~~~~~~^~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c: In function 'zim_Phalcon_Forms_Element_Select_render':
#8 484.5 /usr/local/include/php/Zend/zend_API.h:1663:60: error: passing argument 2 of 'zend_parse_arg_array' from incompatible pointer type [-Wincompatible-pointer-types]
#8 484.5  1663 |                 if (UNEXPECTED(!zend_parse_arg_array(_arg, &dest, check_null, 0))) { \
#8 484.5 /usr/local/include/php/Zend/zend_portability.h:363:52: note: in definition of macro 'UNEXPECTED'
#8 484.5   363 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
#8 484.5       |                                                    ^~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:1670:9: note: in expansion of macro 'Z_PARAM_ARRAY_EX2'
#8 484.5  1670 |         Z_PARAM_ARRAY_EX2(dest, check_null, separate, separate)
#8 484.5       |         ^~~~~~~~~~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:1673:9: note: in expansion of macro 'Z_PARAM_ARRAY_EX'
#8 484.5  1673 |         Z_PARAM_ARRAY_EX(dest, 0, 0)
#8 484.5       |         ^~~~~~~~~~~~~~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c:206875:17: note: in expansion of macro 'Z_PARAM_ARRAY'
#8 484.5 206875 |                 Z_PARAM_ARRAY(attributes)
#8 484.5        |                 ^~~~~~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2314:71: note: expected 'zval **' {aka 'struct _zval_struct **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
#8 484.5  2314 | static zend_always_inline bool zend_parse_arg_array(zval *arg, zval **dest, bool check_null, bool or_object)
#8 484.5       |                                                                ~~~~~~~^~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c: In function 'zim_Phalcon_Forms_Element_Select_prepareAttributes':
#8 484.5 /usr/local/include/php/Zend/zend_API.h:1663:60: error: passing argument 2 of 'zend_parse_arg_array' from incompatible pointer type [-Wincompatible-pointer-types]
#8 484.5  1663 |                 if (UNEXPECTED(!zend_parse_arg_array(_arg, &dest, check_null, 0))) { \
#8 484.5 /usr/local/include/php/Zend/zend_portability.h:363:52: note: in definition of macro 'UNEXPECTED'
#8 484.5   363 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
#8 484.5       |                                                    ^~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:1670:9: note: in expansion of macro 'Z_PARAM_ARRAY_EX2'
#8 484.5  1670 |         Z_PARAM_ARRAY_EX2(dest, check_null, separate, separate)
#8 484.5       |         ^~~~~~~~~~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:1673:9: note: in expansion of macro 'Z_PARAM_ARRAY_EX'
#8 484.5  1673 |         Z_PARAM_ARRAY_EX(dest, 0, 0)
#8 484.5       |         ^~~~~~~~~~~~~~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c:206924:17: note: in expansion of macro 'Z_PARAM_ARRAY'
#8 484.5 206924 |                 Z_PARAM_ARRAY(attributes)
#8 484.5        |                 ^~~~~~~~~~~~~
#8 484.5 /usr/local/include/php/Zend/zend_API.h:2314:71: note: expected 'zval **' {aka 'struct _zval_struct **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
#8 484.5  2314 | static zend_always_inline bool zend_parse_arg_array(zval *arg, zval **dest, bool check_null, bool or_object)
#8 484.5       |                                                                ~~~~~~~^~~~
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c: In function 'php_zephir_init_globals':
#8 484.5 /opt/phalcon/build/phalcon/phalcon.zep.c:208335:57: error: assignment to 'zend_string *' {aka 'struct _zend_string *'} from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
#8 484.5 208335 |         phalcon_globals->orm.resultset_prefetch_records = ZSTR_VAL(zend_string_init(ZEND_STRL("0"), 0));
#8 484.5        |     

Steps to reproduce the behavior:

// paste output here

Provide minimal script to reproduce the issue

// paste output here

Expected behavior A clear and concise description of what you expected to happen.

// paste code

Screenshots If applicable, add screenshots to help explain your problem.

Details

  • Phalcon version: (php --ri phalcon) 5.9.3
  • PHP Version: (php -v) 8.4.11
  • Operating System: Alpine Linux 3.21
  • Installation type: Compiling from source || installing via package manager
  • Zephir version (if any):
  • Server: Nginx | Apache | Other
  • Other related info (Database, table schema):

Additional context Add any other context about the problem here.

joseluisq avatar Sep 21 '25 00:09 joseluisq

Same here, I’ve hit this issue as well.

RaymondFaShi avatar Sep 21 '25 03:09 RaymondFaShi

I didn't test your case directly. The same build failure happened on my side, and the workaround was to patch the generated Makefile during build:

sed -i 's/CPPFLAGS = -DPHALCON_RELEASE -DHAVE_CONFIG_H/CPPFLAGS = -DPHALCON_RELEASE -DHAVE_CONFIG_H -Wno-error=incompatible-pointer-types/g' Makefile

Reference: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=php-phalcon

jturbide avatar Dec 08 '25 19:12 jturbide