phpv8 / v8js

V8 Javascript Engine for PHP — This PHP extension embeds the Google V8 Javascript Engine
http://pecl.php.net/package/v8js
MIT License
1.83k stars 200 forks source link

Error Installing v8js-1.3.1 from PECL #257

Closed virgofx closed 8 years ago

virgofx commented 8 years ago

Installed V8 - 5.4.449 per latest Linux instructions. Attempting to install v8 from PECL instead of compiling manually results in:

sudo pecl install v8js-1.3.1

/bin/bash /tmp/pear/temp/pear-build-rooth8Q3Xo/v8js-1.3.1/libtool --mode=compile g++ -Wno-narrowing -std=c++11 -I. -I/tmp/pear/temp/v8js -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rooth8Q3Xo/v8js-1.3.1/include -I/tmp/pear/temp/pear-build-rooth8Q3Xo/v8js-1.3.1/main -I/tmp/pear/temp/v8js -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/usr  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/v8js/v8js_exceptions.cc -o v8js_exceptions.lo
libtool: compile:  g++ -Wno-narrowing -std=c++11 -I. -I/tmp/pear/temp/v8js -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rooth8Q3Xo/v8js-1.3.1/include -I/tmp/pear/temp/pear-build-rooth8Q3Xo/v8js-1.3.1/main -I/tmp/pear/temp/v8js -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/usr -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/v8js/v8js_exceptions.cc  -fPIC -DPIC -o .libs/v8js_exceptions.o
make: *** No rule to make target '/tmp/pear/temp/v8js/v8js_generator_export.cc', needed by 'v8js_generator_export.lo'.  Stop.
ERROR: `make' failed

php -v

PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans

*cat/etc/release**

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
virgofx commented 8 years ago

Also, when attempting to build v8js manually --- all errors on make test

cd /tmp
git clone https://github.com/phpv8/v8js.git
cd v8js
phpize
./configure
make
make test

https://gist.github.com/virgofx/7c1b6dd34e0138b991ac5c6f7c103e5e

stesie commented 8 years ago

nice catch, the compile error seems to be related to an error in the manifest file:

<file baseinstalldir="/" md5sum="d2b5ef6472cb277c34b13a062f9a9cc8" name="v8js_generator_export.cc" role="data"/>

... where the C++ source obviously should have role=src (instead of data).

Regarding the errors on make test, could you please have a look into one of the tests/*.out files and post its contents here

virgofx commented 8 years ago

@stesie Most of them had errors similar to this:

#
# Fatal error in .././src/snapshot/snapshot.h, line 28
# Check failed: IsSane().
#

==== C stack trace ===============================

    /usr/lib/libv8.so(v8::base::debug::StackTrace::StackTrace()+0xe) [0x7fcc3afaa7ee]
    /usr/lib/libv8.so(V8_Fatal+0xe0) [0x7fcc3afa91e0]
    /usr/lib/libv8.so(+0xa71ef8) [0x7fcc3aeb0ef8]
    /usr/lib/libv8.so(v8::internal::Snapshot::Initialize(v8::internal::Isolate*)+0x8d) [0x7fcc3aeb0bed]
    /usr/lib/libv8.so(v8::Isolate::New(v8::Isolate::CreateParams const&)+0x15d) [0x7fcc3a874fed]
    /tmp/v8js/modules/v8js.so(+0x139d4) [0x7fcc3b1e69d4]
    /usr/bin/php7.0(dtrace_execute_internal+0x2a) [0x5584692a1b3a]
    /usr/bin/php7.0(+0x2e37e0) [0x5584693367e0]
    /usr/bin/php7.0(execute_ex+0x1b) [0x5584692f1e2b]
    /usr/bin/php7.0(dtrace_execute_ex+0xb1) [0x5584692a19d1]
    /usr/bin/php7.0(zend_execute+0x1a7) [0x558469345bf7]
    /usr/bin/php7.0(zend_execute_scripts+0xc3) [0x5584692b1bd3]
    /usr/bin/php7.0(php_execute_script+0x2d0) [0x558469252470]
    /usr/bin/php7.0(+0x2f48b7) [0x5584693478b7]
    /usr/bin/php7.0(main+0x474) [0x558469137084]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7fcc3df7e830]
    /usr/bin/php7.0(_start+0x29) [0x5584691371c9]
Illegal instruction

Termsig=4

Going to test on 5.3 to see if any difference.

virgofx commented 8 years ago

Manual compilation works with 5.3; however, PECL - v8js-1.3.1 broken as well same generator error.

virgofx commented 8 years ago

@stesie Looks like the make test errors were because the snapshot files were not copied. I think may need to update Linux instructions to include those as I reinstalled 5.4 and it worked again (manually). Still not working from PECL (errors same as first post)

# Copy snaphshots
sudo cp out/native/*blob.bin /usr/lib/
stesie commented 8 years ago

I've finally found some time to release 1.3.2 version of V8Js which ships the fixed packages.xml manifest. Therefore "pecl install" should work fine as well after all.

virgofx commented 8 years ago

@stesie Thanks!