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

Could not install via PeCL #271

Closed
waghanza opened this issue May 2, 2020 · 18 comments
Closed

Could not install via PeCL #271

waghanza opened this issue May 2, 2020 · 18 comments

Comments

@waghanza
Copy link

waghanza commented May 2, 2020

Hi @mruz,

I've found that the version 1.6 is available through apecl channel 👍

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
Copy link
Member

mruz commented May 2, 2020

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
Copy link
Author

waghanza commented May 2, 2020

FROM php:7.4-fpm-alpine

RUN apk add --no-cache \
                $PHPIZE_DEPS \
                openssl-dev
FROM php:7.4-fpm

@mruz
Copy link
Member

mruz commented May 11, 2020

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
Copy link
Author

which kernel folder ?

PS : I'm under root in the container

@mruz
Copy link
Member

mruz commented May 11, 2020

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
Copy link
Author

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
Copy link
Member

mruz commented May 11, 2020

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
Copy link
Author

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

Please ping me when ice will be released with this fix

@mruz
Copy link
Member

mruz commented May 11, 2020

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

@waghanza
Copy link
Author

when do you plan the next release @mruz ?

@mruz
Copy link
Member

mruz commented Sep 12, 2020

@waghanza can you try 1.6.2?

@mruz
Copy link
Member

mruz commented Nov 17, 2020

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/])

PHP_NEW_EXTENSION(ice, $ice_sources, $ext_shared,, )

@remicollet what do you think?

@waghanza
Copy link
Author

@waghanza can you try 1.6.2?

I tried 1.7 in the-benchmarker/web-frameworks#3466

mruz added a commit to mruz/zephir that referenced this issue Nov 18, 2020
mruz added a commit to mruz/zephir that referenced this issue Nov 20, 2020
@mruz
Copy link
Member

mruz commented Feb 14, 2021

# 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

zephir-lang/zephir#2144

@mruz
Copy link
Member

mruz commented Feb 15, 2021

/tmp/pear/temp/ice/kernel/backtrace.c:24:10: fatal error: execinfo.h: No such file or directory
24 | #include <execinfo.h>
| ^~~~~~~~~~~~
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
Copy link
Author

pecl is deprecated on php8
@see the-benchmarker/web-frameworks#3655 (comment)

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
Copy link
Member

mruz commented Feb 17, 2021

@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
Copy link
Author

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 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants