Skip to content

[BUG]: PECL and manual compile fails #16775

@berighton

Description

@berighton

Description
Getting errors installing phalcon 5.9.3 via PECL as well as compiling manually.
Installing locally, not via docker. PHP version: 8.4.7
OS: Nobara 42 (Fedora) - 6.15.2-200.nobara.fc42.x86_64

/usr/include/php/Zend/zend_API.h:1673:60: error: passing argument 2 of 'zend_parse_arg_array' from incompatible pointer type [-Wincompatible-pointer-types]
 1673 |                 if (UNEXPECTED(!zend_parse_arg_array(_arg, &dest, check_null, 0))) { \
/usr/include/php/Zend/zend_portability.h:387:52: note: in definition of macro 'UNEXPECTED'
  387 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
      |                                                    ^~~~~~~~~
/usr/include/php/Zend/zend_API.h:1680:9: note: in expansion of macro 'Z_PARAM_ARRAY_EX2'
 1680 |         Z_PARAM_ARRAY_EX2(dest, check_null, separate, separate)
      |         ^~~~~~~~~~~~~~~~~
/usr/include/php/Zend/zend_API.h:1683:9: note: in expansion of macro 'Z_PARAM_ARRAY_EX'
 1683 |         Z_PARAM_ARRAY_EX(dest, 0, 0)
      |         ^~~~~~~~~~~~~~~~
/var/tmp/phalcon/phalcon.zep.c:206975:17: note: in expansion of macro 'Z_PARAM_ARRAY'
206975 |                 Z_PARAM_ARRAY(options)
       |                 ^~~~~~~~~~~~~
/usr/include/php/Zend/zend_API.h:2363:71: note: expected 'zval **' {aka 'struct _zval_struct **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
 2363 | static zend_always_inline bool zend_parse_arg_array(zval *arg, zval **dest, bool check_null, bool or_object)
      |                                                                ~~~~~~~^~~~
/var/tmp/phalcon/phalcon.zep.c: In function 'php_zephir_init_globals':
/var/tmp/phalcon/phalcon.zep.c:208335:57: error: assignment to 'zend_string *' {aka 'struct _zend_string *'} from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
208335 |         phalcon_globals->orm.resultset_prefetch_records = ZSTR_VAL(zend_string_init(ZEND_STRL("0"), 0));
       |                                                         ^
make: *** [Makefile:208: phalcon.lo] Error 1
ERROR: `make' failed

Tried both of the solutions: #16680 and #16722. The second showed promise, compiling starts after a few warnings but exists abruptly without any additional logs:

 Warning: Function "apcu_dec" does not exist at compile time in /home/bob/cphalcon/phalcon/Storage/Adapter/Apcu.zep on line 255 [nonexistent-function]

                return apcu_dec(key, step);

        ----------------------------------^
 Warning: Function "apcu_delete" does not exist at compile time in /home/bob/cphalcon/phalcon/Storage/Adapter/Apcu.zep on line 260 [nonexistent-function]

                return apcu_delete(key);

        -------------------------------^
 Warning: Function "apcu_exists" does not exist at compile time in /home/bob/cphalcon/phalcon/Storage/Adapter/Apcu.zep on line 265 [nonexistent-function]

                return apcu_exists(key);

        -------------------------------^
 Warning: Function "apcu_inc" does not exist at compile time in /home/bob/cphalcon/phalcon/Storage/Adapter/Apcu.zep on line 270 [nonexistent-function]

                return apcu_inc(key, step);

        ----------------------------------^
 Warning: Function "apcu_fetch" does not exist at compile time in /home/bob/cphalcon/phalcon/Storage/Adapter/Apcu.zep on line 275 [nonexistent-function]

                return apcu_fetch(key);

        ------------------------------^
 Warning: Class "APCUIterator" does not exist at compile time in /home/bob/cphalcon/phalcon/Storage/Adapter/Apcu.zep on line 280 [nonexistent-class]

                return new APCUIterator(pattern);

        ----------------------------------------^
 Warning: Function "apcu_store" does not exist at compile time in /home/bob/cphalcon/phalcon/Storage/Adapter/Apcu.zep on line 285 [nonexistent-function]

                return apcu_store(key, payload, ttl);

        --------------------------------------------^
 Warning: Function "apcu_fetch" does not exist at compile time in /home/bob/cphalcon/phalcon/Annotations/Adapter/Apcu.zep on line 66 [nonexistent-function]

                );

        ---------^
 Warning: Function "apcu_store" does not exist at compile time in /home/bob/cphalcon/phalcon/Annotations/Adapter/Apcu.zep on line 80 [nonexistent-function]

                );

        ---------^
 Preparing for PHP compilation...
configure.ac:150: warning: The macro 'AC_PROG_LIBTOOL' is obsolete.
configure.ac:150: You should run autoupdate.
build/libtool.m4:100: AC_PROG_LIBTOOL is expanded from...
configure.ac:150: the top level
 Preparing configuration file...
 Compiling...

Doing a recommended zephir build throws the same errors as PECL
export CFLAGS="-Wno-error=incompatible-pointer-types"
sudo zephir fullclean
sudo zephir build

/home/bob/cphalcon/ext/kernel/main.c: In function 'zephir_function_exists_ex':
/home/bob/cphalcon/ext/kernel/main.c:275:83: warning: comparison between pointer and integer
  275 |         if (zend_hash_str_exists(CG(function_table), function_name, function_len) != NULL) {
      |                                                                                   ^~
/home/bob/cphalcon/ext/phalcon.c: In function 'php_zephir_init_globals':
/home/bob/cphalcon/ext/phalcon.c:1347:57: error: assignment to 'zend_string *' {aka 'struct _zend_string *'} from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
 1347 |         phalcon_globals->orm.resultset_prefetch_records = ZSTR_VAL(zend_string_init(ZEND_STRL("0"), 0));
      |                                                         ^
make: *** [Makefile:208: phalcon.lo] Error 1
make: *** Waiting for unfinished jobs....
/home/bob/cphalcon/ext/phalcon.c: In function 'php_zephir_init_globals':
/home/bob/cphalcon/ext/phalcon.c:1347:57: error: assignment to 'zend_string *' {aka 'struct _zend_string *'} from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
 1347 |         phalcon_globals->orm.resultset_prefetch_records = ZSTR_VAL(zend_string_init(ZEND_STRL("0"), 0));
      |                                                         ^
make: *** [Makefile:208: phalcon.lo] Error 1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions