Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: compile issue since 5.9.0 #16722

Open
shyim opened this issue Mar 9, 2025 · 9 comments
Open

[BUG]: compile issue since 5.9.0 #16722

shyim opened this issue Mar 9, 2025 · 9 comments
Assignees
Labels
bug A bug report status: unverified Unverified

Comments

@shyim
Copy link

shyim commented Mar 9, 2025

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

Describe the bug

2025/03/09 00:08:07 WARN /home/build/ext/phalcon.c: In function 'php_zephir_init_globals':
2025/03/09 00:08:07 WARN /home/build/ext/phalcon.c:1345:57: error: assignment to 'zend_string *' {aka 'struct _zend_string *'} from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
2025/03/09 00:08:07 WARN  1345 |         phalcon_globals->orm.resultset_prefetch_records = ZSTR_VAL(zend_string_init(ZEND_STRL("0"), 0));
2025/03/09 00:08:07 WARN       |                                                         ^
2025/03/09 00:08:07 WARN make: *** [Makefile:210: phalcon.lo] Error 1
2025/03/09 00:08:08 ERRO failed to build package: unable to run package php-frankenphp-8.3-phalcon pipeline: unable to run pipeline: exit status 2

I am compiling against PHP 8.3. See for full build logs: https://github.com/shyim/wolfi-php/actions/runs/13742722967/job/38433836013?pr=869

@shyim shyim added bug A bug report status: unverified Unverified labels Mar 9, 2025
@Jeckerson Jeckerson self-assigned this Mar 10, 2025
@Jeckerson
Copy link
Member

Could you provide commands that are executed?

Jeckerson added a commit that referenced this issue Mar 10, 2025
@shyim
Copy link
Author

shyim commented Mar 10, 2025

phpize
./configure
make install

@Jeckerson
Copy link
Member

Ideally install it via pecl, but it seems that build/ directory wasn't regenerated...
@shyim Could you try to compile from this PR - #16723 ?

@shyim
Copy link
Author

shyim commented Mar 11, 2025

still failing

2025/03/11 08:59:51 WARN /home/build/cphalcon/ext/phalcon.c: In function 'php_zephir_init_globals':
2025/03/11 08:59:51 WARN /home/build/cphalcon/ext/phalcon.c:1345:57: error: assignment to 'zend_string *' {aka 'struct _zend_string *'} from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
2025/03/11 08:59:51 WARN  1345 |         phalcon_globals->orm.resultset_prefetch_records = ZSTR_VAL(zend_string_init(ZEND_STRL("0"), 0));
2025/03/11 08:59:51 WARN       |                                                         ^
2025/03/11 08:59:51 WARN make: *** [Makefile:210: phalcon.lo] Error 1

pecl build works. so there must be something still different

@shyim
Copy link
Author

shyim commented Mar 11, 2025

nvm pecl build fails too
https://gist.githubusercontent.com/shyim/cac959cd2fe44af813ff4d89bf8ae94f/raw/c0d025284b51b12071cdd1aba55afe2c84142aed/build.log

maybe because I compile with an too new compiler? GCC 14.2.0

Jeckerson added a commit that referenced this issue Mar 11, 2025
@zz
Copy link

zz commented Mar 12, 2025

From PHP 8.3.14, both 5.8.0 and 5.9.0 has the same error, install with pecl failed

@elcreator
Copy link

elcreator commented Mar 13, 2025

Same with PHP 8.4 on Alpine with enough memory

docker build --memory=5g --memory-swap=6g

FROM php:8.4-fpm-alpine

USER root
ARG PHALCON_VERSION=5.9.0
ARG PHP_VERSION=8.4
ARG PHPIZE_DEPS="autoconf gcc g++ make"
RUN apk add --update $PHPIZE_DEPS
RUN ln -s /usr/local/bin/phpize /usr/local/bin/phpize${PHP_VERSION}
RUN whoami | tee /tmp/whoami.log
RUN cat /proc/meminfo | tee /tmp/meminfo.log
RUN pecl update-channels | tee /tmp/pecl.update.log
RUN pecl -d php_suffix=${PHP_VERSION} install phalcon-${PHALCON_VERSION} | tee /tmp/phalcon.install.log
RUN echo "extension=phalcon.so" | tee $PHP_INI_DIR/conf.d/55_phalcon.ini
USER www-data

Everything ok with rights, pecl and memory.

downloading phalcon-5.9.0.tgz ...
Starting to download phalcon-5.9.0.tgz (972,036 bytes)
.................................................................................................................................................................................................done: 972,036 bytes
5 source files, building
running: phpize8.4
Configuring for:
PHP Version:             8.4
PHP Api Version:         20240924
Zend Module Api No:      20240924
Zend Extension Api No:   420240924
building in /tmp/pear/temp/pear-build-defaultuserkqbibsknmcb5ecGEbLl/phalcon-5.9.0
running: /tmp/pear/temp/phalcon/configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking target system type... x86_64-pc-linux-musl
shtool:echo:Warning: unable to determine terminal sequence for bold mode
shtool:echo:Warning: unable to determine terminal sequence for bold mode
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for pkg-config... no
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking how to run the C preprocessor... cc -E
checking for egrep -e... (cached) /bin/grep -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20240924
checking for PHP installed headers prefix... /usr/local/include/php
checking if debugging is enabled... no
checking if PHP is built with thread safety (ZTS)... no

Configuring extension
checking whether to enable phalcon... yes, shared
checking PHP version... checking for cc options needed to detect all undeclared functions... none needed
checking whether HAVE_BUNDLED_PCRE is declared... yes
checking for ext/pcre/php_pcre.h... yes
checking whether HAVE_JSON is declared... no

Configuring libtool
checking for a sed that does not truncate output... /bin/sed
checking for ld used by cc... /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld... yes
checking for /usr/x86_64-alpine-linux-musl/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
/tmp/pear/temp/phalcon/configure: line 5930: /usr/bin/file: not found
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/x86_64-alpine-linux-musl/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool

Generating files
configure: creating build directories
configure: creating Makefile
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /tmp/pear/temp/pear-build-defaultuserkqbibsknmcb5ecGEbLl/phalcon-5.9.0/libtool --tag=CC --mode=compile cc -I. -I/tmp/pear/temp/phalcon -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE    -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/phalcon/phalcon.zep.c -o phalcon.lo  -MMD -MF phalcon.dep -MT phalcon.lo
mkdir .libs
 cc -I. -I/tmp/pear/temp/phalcon -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/phalcon/phalcon.zep.c -MMD -MF phalcon.dep -MT phalcon.lo  -fPIC -DPIC -o .libs/phalcon.o
/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'zephir_function_exists_ex':
/tmp/pear/temp/phalcon/phalcon.zep.c:3983:83: warning: comparison between pointer and integer
 3983 |         if (zend_hash_str_exists(CG(function_table), function_name, function_len) != NULL) {
      |                                                                                   ^~
/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'zephir_require_ret':
/tmp/pear/temp/phalcon/phalcon.zep.c:8893:19: error: passing argument 1 of 'zval_ptr_dtor' from incompatible pointer type [-Wincompatible-pointer-types]
 8893 |     zval_ptr_dtor(zend_string_path);
      |                   ^~~~~~~~~~~~~~~~
      |                   |
      |                   zend_string * {aka struct _zend_string *}
In file included from /usr/local/include/php/Zend/zend.h:36,
                 from /usr/local/include/php/main/php.h:31,
                 from /tmp/pear/temp/phalcon/phalcon.zep.c:46:
/usr/local/include/php/Zend/zend_variables.h:80:35: note: expected 'zval *' {aka 'struct _zval_struct *'} but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
   80 | ZEND_API void zval_ptr_dtor(zval *zval_ptr);




... we all need ability to silence at least notices as those stack traces are bigger than docker limit 2MB ...



/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'zim_Phalcon_Encryption_Security_JWT_Token_Signature___construct':
/usr/local/include/php/Zend/zend_API.h:2080:58: error: passing argument 2 of 'zend_parse_arg_str' from incompatible pointer type [-Wincompatible-pointer-types]
 2080 |                 if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null, _i))) { \
/usr/local/include/php/Zend/zend_portability.h:387:52: note: in definition of macro 'UNEXPECTED'
  387 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
      |                                                    ^~~~~~~~~
/usr/local/include/php/Zend/zend_API.h:2087:9: note: in expansion of macro 'Z_PARAM_STR_EX'
 2087 |         Z_PARAM_STR_EX(dest, 0, 0)
      |         ^~~~~~~~~~~~~~
/tmp/pear/temp/phalcon/phalcon.zep.c:205974:17: note: in expansion of macro 'Z_PARAM_STR'
205974 |                 Z_PARAM_STR(hash)
       |                 ^~~~~~~~~~~
/usr/local/include/php/Zend/zend_API.h:2300:76: note: expected 'zend_string **' {aka 'struct _zend_string **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
 2300 | static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num)
      |                                                              ~~~~~~~~~~~~~~^~~~
/usr/local/include/php/Zend/zend_API.h:2080:58: error: passing argument 2 of 'zend_parse_arg_str' from incompatible pointer type [-Wincompatible-pointer-types]
 2080 |                 if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null, _i))) { \
/usr/local/include/php/Zend/zend_portability.h:387:52: note: in definition of macro 'UNEXPECTED'
  387 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
      |                                                    ^~~~~~~~~
/usr/local/include/php/Zend/zend_API.h:2087:9: note: in expansion of macro 'Z_PARAM_STR_EX'
 2087 |         Z_PARAM_STR_EX(dest, 0, 0)
      |         ^~~~~~~~~~~~~~
/tmp/pear/temp/phalcon/phalcon.zep.c:205975:17: note: in expansion of macro 'Z_PARAM_STR'
205975 |                 Z_PARAM_STR(encoded)
       |                 ^~~~~~~~~~~
/usr/local/include/php/Zend/zend_API.h:2300:76: note: expected 'zend_string **' {aka 'struct _zend_string **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
 2300 | static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num)
      |                                                              ~~~~~~~~~~~~~~^~~~
/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'zim_Phalcon_Encryption_Security_JWT_Token_Token_verify':
/usr/local/include/php/Zend/zend_API.h:2080:58: error: passing argument 2 of 'zend_parse_arg_str' from incompatible pointer type [-Wincompatible-pointer-types]
 2080 |                 if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null, _i))) { \
/usr/local/include/php/Zend/zend_portability.h:387:52: note: in definition of macro 'UNEXPECTED'
  387 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
      |                                                    ^~~~~~~~~
/usr/local/include/php/Zend/zend_API.h:2087:9: note: in expansion of macro 'Z_PARAM_STR_EX'
 2087 |         Z_PARAM_STR_EX(dest, 0, 0)
      |         ^~~~~~~~~~~~~~
/tmp/pear/temp/phalcon/phalcon.zep.c:206247:17: note: in expansion of macro 'Z_PARAM_STR'
206247 |                 Z_PARAM_STR(key)
       |                 ^~~~~~~~~~~
/usr/local/include/php/Zend/zend_API.h:2300:76: note: expected 'zend_string **' {aka 'struct _zend_string **'} but argument is of type 'zval *' {aka 'struct _zval_struct *'}
 2300 | static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num)
      |                                                              ~~~~~~~~~~~~~~^~~~
/tmp/pear/temp/phalcon/phalcon.zep.c: In function 'php_zephir_init_globals':
/tmp/pear/temp/phalcon/phalcon.zep.c:207638:57: error: assignment to 'zend_string *' {aka 'struct _zend_string *'} from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
207638 |         phalcon_globals->orm.resultset_prefetch_records = ZSTR_VAL(zend_string_init(ZEND_STRL("0"), 0));
       |                                                         ^
make: *** [Makefile:204: phalcon.lo] Error 1
ERROR: `make' failed

@oleghind
Copy link

Have you tried the solution from #16680

@elcreator
Copy link

tried, it didn't work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: unverified Unverified
Projects
None yet
Development

No branches or pull requests

5 participants