ice / framework

Source code of Ice framework
https://www.iceframework.org
BSD 3-Clause "New" or "Revised" License
341 stars 45 forks source link

Could not install via PeCL #271

Closed waghanza closed 3 years ago

waghanza commented 4 years ago

Hi @mruz,

I've found that the version 1.6 is available through apecl channel :+1:

However, using pecl install ice (I'm on a docker), I have :

/bin/bash /tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/libtool --mode=compile cc  -I. -I/tmp/pear/temp/ice -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/include -I/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/main -I/tmp/pear/temp/ice -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   -c /tmp/pear/temp/ice/ice.c -o ice.lo
mkdir .libs
 cc -I. -I/tmp/pear/temp/ice -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/include -I/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/main -I/tmp/pear/temp/ice -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 -c /tmp/pear/temp/ice/ice.c  -fPIC -DPIC -o .libs/ice.o
/bin/bash /tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/libtool --mode=compile cc  -I. -I/tmp/pear/temp/ice -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/include -I/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/main -I/tmp/pear/temp/ice -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   -c /tmp/pear/temp/ice/kernel/main.c -o kernel/main.lo
/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/libtool: line 1283: kernel/main.loT: No such file or directory
mkdir kernel/.libs
mkdir: cannot create directory 'kernel/.libs': No such file or directory
make: *** [Makefile:194: kernel/main.lo] Error 1
ERROR: `make' failed

Regards,

mruz commented 4 years ago

Yes, we are on pecl. Could you send the whole output, please? Maybe some command line tools are missing. https://travis-ci.org/github/ice/framework/jobs/680321113#L643

waghanza commented 4 years ago

RUN apk add --no-cache \ $PHPIZE_DEPS \ openssl-dev

+ On `debian`
   + log => https://gist.github.com/waghanza/f1faa0a98ca7795c6a1e58d43a677b1f
   + `docker`
~~~dockerfile
FROM php:7.4-fpm
mruz commented 4 years ago

libtool ... -o kernel/main.lo /tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/libtool: line 1283: kernel/main.loT: No such file or directory

Can you check the permissions? Looks like libtool can't create main.lo file in the kernel/ directory.

waghanza commented 4 years ago

which kernel folder ?

PS : I'm under root in the container

mruz commented 4 years ago

building in /tmp/pear/temp/pear-build-defaultuserB10pCW/ice-1.6.0

inside ice-1.6.0/ should be kernel/ directory. root should have an access, but could you check manual installation. pecl is doing something like this:

wget https://pecl.php.net/get/ice-1.6.0.tgz
tar -xzf ice-1.6.0.tgz
cd ice-1.6.0/
phpize
./configure --enable-ice
make
make install
waghanza commented 4 years ago

The kernel folder has drwxr-xr-x.

However, I have

/var/www/html/ice-1.6.0/kernel/backtrace.c:24:10: fatal error: execinfo.h: No such file or directory
   24 | #include <execinfo.h>

when trying make step, but ONLY on alpine which is in package libexecinfo-dev

mruz commented 4 years ago

Right, GNU C Library development files are needed. On opensuse it's glibc-devel package (libc6-dev on debian), but php7-devel (php-dev on debian) requires it, so installing php development files should solve this dependency.

waghanza commented 4 years ago

Ok. The folder kernel missing write permission on tarbal uploaded on pecl then :stuck_out_tongue:

Please ping me when ice will be released with this fix

mruz commented 4 years ago

I will change the permission in the next release. I will leave this issue open until then.

waghanza commented 4 years ago

when do you plan the next release @mruz ?

mruz commented 3 years ago

@waghanza can you try 1.6.2?

mruz commented 3 years ago

I tried to run pecl install ice on docker alpine image and you're right @waghanza, it fails on "missing kernel dir". It works if I extract the archive and install ext manually.

I think build dirs are missing, so it fails because of rel path:

PHP_ADD_BUILD_DIR([$ext_builddir/kernel/])
PHP_ADD_BUILD_DIR([$ext_builddir/ice/])

https://github.com/ice/framework/blob/f961b40d99ed51961469c253b8effa2a84ea0cda/build/php7/config.m4#L133

@remicollet what do you think?

waghanza commented 3 years ago

@waghanza can you try 1.6.2?

I tried 1.7 in https://github.com/the-benchmarker/web-frameworks/pull/3466

mruz commented 3 years ago

# pecl install ice-1.8.0alpha2

/tmp/pear/temp/pear-build-mruzmnbDvm/ice-1.8.0alpha2/libtool: line 1290: ice/validation/validator.loT: No such file or directory mkdir ice/validation/.libs mkdir: cannot create directory 'ice/validation/.libs': No such file or directory make: *** [Makefile:249: ice/validation/validator.lo] Error 1 ERROR: `make' failed

https://github.com/phalcon/zephir/pull/2144

mruz commented 3 years ago

/tmp/pear/temp/ice/kernel/backtrace.c:24:10: fatal error: execinfo.h: No such file or directory 24 | #include | ^~~~ compilation terminated. make: *** [Makefile:219: kernel/backtrace.lo] Error 1

to build ice on alpine linux libexecinfo-dev package is required:

ARG PHP_VERSION=8.0.2
FROM php:${PHP_VERSION}-fpm-alpine3.12

RUN apk update && apk add --no-cache \
    autoconf build-base libexecinfo-dev

RUN pecl install ice-1.8.0alpha3 \
    && docker-php-ext-enable ice
waghanza commented 3 years ago

pecl is deprecated on php8 @see https://github.com/the-benchmarker/web-frameworks/pull/3655#issuecomment-766049304

However, I have

Warning: PHP Startup: Unable to load dynamic library 'ice.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so (Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so: backtrace_symbols: symbol not found), /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so.so: No such file or directory)) in Unknown on line 0

when listing modules with php -m

mruz commented 3 years ago

@waghanza can you try:

wget https://github.com/ice/framework/archive/1.8.0alpha3.tar.gz
tar -xzvf 1.8.0alpha3.tar.gz
cd framework-1.8.0alpha3/
./install

php -m
php -r "echo Ice\Version::get() . PHP_EOL;"
waghanza commented 3 years ago

for a standard installation, I run

mkdir -p /usr/src/php/ext/ice && \
    curl -fsSL https://pecl.php.net/get/ice | tar xvz -C "/usr/src/php/ext/ice" --strip 1
  docker-php-ext-install ice

which lead me to php -mwarns

Warning: PHP Startup: Unable to load dynamic library 'ice.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so (Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so: backtrace_symbols: symbol not found), /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so.so: No such file or directory)) in Unknown on line 0

and php -r "echo Ice\Version::get() . PHP_EOL;" says

Warning: PHP Startup: Unable to load dynamic library 'ice.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so (Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so: backtrace_symbols: symbol not found), /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ice.so.so: No such file or directory)) in Unknown on line 0

Fatal error: Uncaught Error: Class "Ice\Version" not found in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1

With you technique I have 1.8.0-alpha.3 when I ask for ice version

I've notice that I use php-pear instead of https://pkgs.alpinelinux.org/packages?name=php8-pear&branch=edge :-)