Compared to 1.x, PhantomJS 2.0 has exhibits some problem when being built statically to produce the official Linux binaries.
When the binary is built on Centos 6.6 and tested on Ubuntu 12.04, there will be this error:
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"
$ bin/phantomjs
bin/phantomjs: error while loading shared libraries: libicudata.so.42: cannot open shared object file: No such file or directory
$ ldd bin/phantomjs
linux-vdso.so.1 => (0x00007fff31fff000)
libicudata.so.42 => not found
libssl.so.10 => not found
libcrypto.so.10 => not found
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007ff99863e000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007ff9983a2000)
libjpeg.so.62 => not found
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007ff998179000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff997f62000)
libicui18n.so.42 => not found
libicuuc.so.42 => not found
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff997d5d000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff997b54000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff997937000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff997637000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff99733a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff997124000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff996d65000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff99887d000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007ff996b3a000)
When the binary is built on Ubuntu 12.04 and tested on CentOS 6, there is this error:
$ cat /etc/redhat-release
CentOS release 6.6 (Final)
$ bin/phantomjs
bin/phantomjs: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
$ ldd bin/phantomjs
bin/phantomjs: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by bin/phantomjs)
bin/phantomjs: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by bin/phantomjs)
bin/phantomjs: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by bin/phantomjs)
linux-vdso.so.1 => (0x00007fff9e9ff000)
libssl.so.1.0.0 => not found
libcrypto.so.1.0.0 => not found
libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x0000003970600000)
libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x0000003970e00000)
libjpeg.so.8 => not found
libpng12.so.0 => /usr/lib64/libpng12.so.0 (0x0000003974200000)
libz.so.1 => /lib64/libz.so.1 (0x000000396fa00000)
libicui18n.so.48 => not found
libicuuc.so.48 => not found
libdl.so.2 => /lib64/libdl.so.2 (0x000000396e600000)
librt.so.1 => /lib64/librt.so.1 (0x000000396f200000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x000000396ee00000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fbbd8347000)
libm.so.6 => /lib64/libm.so.6 (0x000000396f600000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fbbd8130000)
libc.so.6 => /lib64/libc.so.6 (0x000000396ea00000)
/lib64/ld-linux-x86-64.so.2 (0x000000396e200000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x0000003973600000)
As a comparison, ldd
on PhantomJS 1.9.8 statically built binary on Ubuntu 12.04 gives the following:
ldd bin/phantomjs
linux-vdso.so.1 => (0x00007fff987cf000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f88af68e000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f88af458000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f88af253000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f88af04b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f88aee2e000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f88aeb2d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f88ae831000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f88ae61b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f88ae25b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f88af932000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f88ae044000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f88ade1a000)
ICU upstream bug: https://bugreports.qt.io/browse/QTBUG-38445
@ariya, found the problem. Starting commit - 8d23afb782de22c83c8ab48da50bc35bcf91bbfc
@Vitallium Do you mean that the mentioned commit start to introduce the broken build?
@ariya yes, check the line 162 https://github.com/ariya/phantomjs/blob/2.0/src/qt/preconfig.sh#L162 I assume it should be just openssl
.
With openssl
, I got this on Ubuntu 14.04:
ldd ../bin/phantomjs
linux-vdso.so.1 => (0x00007fff347c0000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f9fe8df8000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f9fe8b50000)
libicui18n.so.52 => /usr/lib/x86_64-linux-gnu/libicui18n.so.52 (0x00007f9fe8748000)
libicuuc.so.52 => /usr/lib/x86_64-linux-gnu/libicuuc.so.52 (0x00007f9fe83c8000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9fe81c0000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9fe7fb8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9fe7d98000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9fe7a90000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9fe7788000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9fe7570000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9fe71a8000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9fe9050000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f9fe6f78000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9fe6d58000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f9fe6b30000)
libicudata.so.52 => /usr/lib/x86_64-linux-gnu/libicudata.so.52 (0x00007f9fe52c0000)
@Vitallium Good news! Now we just need to solve the ICU library...
@ariya isn't ICU bug fixed in 5.3.1? Or we're talking about something else?
@kenips Can you elaborate?
hey @ariya I thought the ICU bug is https://bugreports.qt.io/browse/QTBUG-38445, which is fixed in 5.3.1, isn't it?
Want to bring this up again as my team is depending on PhantomJS 2.0 for testing.
However, I am not expert in this. How can I help verifying one static build is working, what is the metric of testing we are looking at?
If I simply do ./build.sh
and it completed successfully, does it mean I can copy over to other machines to test?
@ohenak From my understanding, that should theoretically work across similar environments. (e.g. all machines running the same version of Ubuntu).
I do think ICU was fixed in 5.3.1, but Ubuntu 14.04 has an older version:
libqt5core5a:amd64 5.2.1+dfsg-1ubuntu14.2
Probably this fix can be backported:
https://codereview.qt-project.org/#/c/84012/
Although it's not clear to me whether the problem is in the bundled Qt or in the system's version of Qt.
Any ETA / roadmap on this issue? We would like to deploy PhantomJS 2.0 without having to compile.
The only solution which is sustainable in the long term is to have distro-specific packages, like I have done for wkhtmltopdf. Due to the patched/bundled Qt, it does not get packaged with most distributions anyway so having "official" binaries is important.
I'm willing to take up just the packaging part, as I'll be working on that anyway in the near future for wkhtmltopdf 0.13
based on Qt 5.4.1
:smile:
Note that I won't be supporting CentOS 5, as not all security fixes are being backported and getting it to work would be very tough due to very old software versions.
For people that are actually looking for a built binary of phantom-js 2.0 it seems that the Travis-CI team has one (currently only for Ubuntu-12.04). Thought this would at least help some people on the thread until official binaries are available.
https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2
We've got this working on 14.04 by manually installing (dpkg
) this package:
http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu48_4.8.1.1-3ubuntu0.4_amd64.deb
you can download libicu for ubuntu 14 (amd64) from this link: http://packages.ubuntu.com/en/precise/amd64/libicu48/download
sudo dpkg -i [package-name].deb
@ashkulz Good call on CentOS 5. PhantomJS 2 probably should not be bothered with it.
@emaphp This issue has nothing to do with libicu availability.
FYI: I added compiled binary, built on Ubuntu 14.04 x64 (DigitalOcean 8GB virtual machine), if someone else finds it helpful: https://github.com/Pyppe/phantomjs2.0-ubuntu14.04x64
@Pyppe - tried following your build steps on a vagrant ubuntu/trusty64 (virtualbox, 14.04) but got the following error:
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make[2]: *** [.obj/dom/Node.o] Error 4
make[2]: Leaving directory `/home/vagrant/phantomjs/phantomjs-2.0.0/src/qt/qtwebkit/Source/WebCore'
make[1]: *** [sub-Target-pri-make_first-ordered] Error 2
make[1]: Leaving directory `/home/vagrant/phantomjs/phantomjs-2.0.0/src/qt/qtwebkit/Source/WebCore'
make: *** [sub-Source-WebCore-WebCore-pro-make_first-ordered] Error 2
I have built phantomjs exceutable for CentOS 7, it runs great on my systems. If anybody wants it, you can get it from http://garyzhu.net/notes/phantomjs-centos7.tar.
ldd bin/phantomjs linux-vdso.so.1 => (0x00007fff85dfe000) libicudata.so.50 => /lib64/libicudata.so.50 (0x00007fef00cb4000) libssl.so.10 => /lib64/libssl.so.10 (0x00007fef00a47000) libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007fef00662000) libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00007fef00426000) libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007fef00180000) libjpeg.so.62 => /lib64/libjpeg.so.62 (0x00007feefff2b000) libpng15.so.15 => /lib64/libpng15.so.15 (0x00007feeffd00000) libz.so.1 => /lib64/libz.so.1 (0x00007feeffae9000) libicui18n.so.50 => /lib64/libicui18n.so.50 (0x00007feeff6eb000) libicuuc.so.50 => /lib64/libicuuc.so.50 (0x00007feeff372000) libdl.so.2 => /lib64/libdl.so.2 (0x00007feeff16d000) librt.so.1 => /lib64/librt.so.1 (0x00007feefef65000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007feefed49000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007feefea41000) libm.so.6 => /lib64/libm.so.6 (0x00007feefe73f000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007feefe529000) libc.so.6 => /lib64/libc.so.6 (0x00007feefe167000) /lib64/ld-linux-x86-64.so.2 (0x00007fef022a4000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007feefdf1d000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007feefdc3d000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007feefda38000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007feefd803000) libexpat.so.1 => /lib64/libexpat.so.1 (0x00007feefd5d9000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007feefd3ca000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007feefd1c6000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007feefcfab000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007feefcd86000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007feefcb24000) liblzma.so.5 => /lib64/liblzma.so.5 (0x00007feefc8ff000)
I have problem to build on CentOS 6, maybe because of older versions of glibc library, Google chrome stopped supporting CentOS 6 for the same reason.
@SocalNick, my first guess would be that you're out of memory. How much did you allocate? The build process is quite heavy. Actually, I first tried it with a 2GB-instance and it too failed. After that I tried with the 8GB-instance which did the job.
You could also try building it with ./build.sh --jobs 1
in order to reduce the resources needed, although I'm not sure how much that would affect the memory usage.
Regarding centos 6:
As (I think) I've understood the phantomjs build process, qt5 sources are included in the phantomjs distro and shipped with phantomjs. The build process also builds qt5 and links the libs statically to phantomjs.
Wouldn't it be an option to use the qt5 devel packages (currently at version 5.4.0) from epel (https://fedoraproject.org/wiki/EPEL) to build phantomjs?
+1 for wanting static Linux binaries of PhantomJS 2.
@Pyppe that did the trick, thanks!
When the binary is built on Centos 6.6 and tested on Ubuntu 12.04
This is not the right approach to begin with. You will never get all the dependencies right (unless using static linkage which introduces other problems such as how to deal with security updates).
The right approach to do is build and package a dynamic target for each Linux distribution.
CensOS: build on CentOS and create an rpm package.
Ubuntu: build on Ubuntu (or the corresponding Debian release) and create a deb package.
I've successfully built the phantomJS 2 binary on CentOS 6.6 (updated to latest patches) via instructions given in http://phantomjs.org/build.html.
uname -rsvo
Linux 2.6.32-504.12.2.el6.x86_64 #1 SMP Wed Mar 11 22:03:14 UTC 2015 GNU/Linux
cat /etc/centos-release
CentOS release 6.6 (Final)`
git clone git://github.com/ariya/phantomjs.git phantomjs
cd phantomjs
git checkout 2.0
./build.sh --jobs 1
ldd bin/phantomjs
linux-vdso.so.1 => (0x00007fff9f8f7000)
libicudata.so.42 => /usr/lib64/libicudata.so.42 (0x000000388b600000)
libssl.so.10 => /usr/lib64/libssl.so.10 (0x000000388b200000)
libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x0000003888600000)
libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x0000003887e00000)
libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007fba25217000)
libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x0000003887600000)
libpng12.so.0 => /usr/lib64/libpng12.so.0 (0x000000388ce00000)
libz.so.1 => /lib64/libz.so.1 (0x0000003884600000)
libicui18n.so.42 => /usr/lib64/libicui18n.so.42 (0x0000003886600000)
libicuuc.so.42 => /usr/lib64/libicuuc.so.42 (0x0000003885e00000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003884200000)
librt.so.1 => /lib64/librt.so.1 (0x0000003884a00000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003883e00000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003886a00000)
libm.so.6 => /lib64/libm.so.6 (0x0000003884e00000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003885600000)
libc.so.6 => /lib64/libc.so.6 (0x0000003883a00000)
/lib64/ld-linux-x86-64.so.2 (0x0000003883600000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x0000003889a00000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x0000003889200000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x0000003886e00000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x0000003889600000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x000000388aa00000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x0000003888e00000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x0000003887200000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x0000003885a00000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003885200000)
bin/phantomjs --version
2.0.1-development
I've tested phantomJS 2 running as an export server for highcharts (http://www.highcharts.com/docs/export-module/render-charts-serverside).
Rendering png works as expected (at a first look identically to phantomJS 1.9.8) but rendering pdf seems changed in size and gives weird results if using page zoom, similar to the issue reported here: https://github.com/ariya/phantomjs/issues/13048
This is not the right approach to begin with.
@cschwarz-inco This has been discussed many times before. Official distro packagers are free to package it the right way. We simply want to offer the convenience, just like in the 1.x series. There are other trade-offs and various aspirations we have, but if you feel inclined to discuss that, then start a topic in the mailing-list.
It is due to libicu version issues. I built a chroot cross compile platform in my x64 opensuse with armv7l opensuse and built the 2.0 phantomjs successfully. when I copied the binary to my armv7l ubuntu14.04 and run it, it said libicu was missing.
The truth is, the version of libicu on my armv7l opensuse is 51.2, while the library on the armv7l ubuntu is 52.1. there seems to be some version check functionality on the libicu. i could not cheate phantomjs to run by creating soft links to libicu. it is diffcult to keep dynamic library on different distros to be the same.
my solution is to copy all libicu* so files on the armv7l opensuse to the same directory of phantomjs and add the path to Ld library searching path and it works.
so my suggestion is either statically include the libicu into binary or to copy the libicu*.so files together with the built binary at the end of the build.sh file.
since the built binary highly depends on the version of libicu. i can imagine if the libicu lib is updated to a higher number, you might not be able to run the binary again.
BTW, on ubuntu, it is suggested to install libjpeg62-dev instead of libjpeg-dev to maintain compatibility with opensuse, centos and others.
Does anybody build phantomjs2.0 success on SUSE, I want build it on suse11.1 but got errors like this:
Encountered 5 configuration warning(s):
! QtQuick module not found, QML APIs will not be built
! Missing GStreamer or QtMultimedia, disabling HTML5 media element support
! Missing QtWidgets module, disabling WebKit1
! Missing QtTest module, disabling DumpRenderTree, WebKitTestRunner and tests
! QtWebKitQml will not be build. It is not supported with static linking
The WebKit build was disabled for the following reasons:
* QtWebKit depends on gui for building.
make: Nothing to be done for `first'.
Building main PhantomJS application...
cd src/ && ( test -e Makefile.phantomjs || /home/phantomjs/2.0/source/phantomjs-2.0.0/src/qt/qtbase/bin/qmake /home/phantomjs/2.0/source/phantomjs-2.0.0/src/phantomjs.pro -o Makefile.phantomjs ) && make -f Makefile.phantomjs
Project ERROR: Unknown module(s) in QT: webkitwidgets network gui core
make: *** [sub-src-phantomjs-pro-make_first-ordered] Error 3
Anyone can help me? thanks
@zhushanhu, looks like you did not follow the build instruction and install the library dependencies.
http://phantomjs.org/build.html
Have the binaries been prepared yet for a ubunu linux server?
PhantomJS 2.0 for Debian 7: https://drive.google.com/file/d/0B6NgSctByOnhNFltUmFGSnRzWXc/view?usp=sharing
First:
sudo apt-get install libicu48 libfontconfig1 libjpeg8 libpng12-0
Details:
root@vm-alex-debian:/bin# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
NAME="Debian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="http://bugs.debian.org/"
root@vm-alex-debian:/bin# cat /etc/debian_version
7.8
root@vm-alex-debian:/bin# phantomjs -v
2.0.0
In my build bug https://github.com/detro/ghostdriver/issues/435 fixed.
Hi
install fails for me.
Centos 6.6 (Final)
I followed install instructions carefully, and all deps are there.
this is the last few lines of output:
g++: Internal error: Segmentation fault (program cc1plus)
Please submit a full bug report.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[2]: *** [.obj/qabstractanimation.o] Error 1
make[2]: Leaving directory `/root/downloads/phantomjs/src/qt/qtbase/src/corelib'
make[1]: *** [sub-corelib-make_first] Error 2
make[1]: Leaving directory `/root/downloads/phantomjs/src/qt/qtbase/src'
make: *** [sub-src-make_first] Error 2
I have no idea what that means, but I would be happy if phantomjs could install.
If there's any info I can give to help someone diagnose please let me know.
thanks
l.
Hey, guys. Do you need any help here?
yep, as per my post above phantomjs wont install
I picked up the project in ubuntu 12.04. All went well. However, as the practice of the build is very unstable. And fall regularly occur without any reports generated. If required - can be used to test any scripts for catching errors.
@ariya, @Vitallium: I now have Qt5.4.1-based builds working for wkhtmltopdf. Do you want me to open a new issue to discuss taking a similar approach (distro-specific binaries)? Now that it is ready, it won't take much effort for me but will require thought about how/whether it will integrate with the current build script.
Hello. I can offer test (self-assemble from source) phantomjs on Ubuntu
12.04 and run a script to check the stability of the build.
2015-04-15 15:08 GMT+03:00 Ashish Kulkarni [email protected]:
@ariya https://github.com/ariya, @Vitallium
https://github.com/Vitallium: I now have Qt5.4.1-based builds working
for wkhtmltopdf http://wkhtmltopdf.org/downloads.html#testing. Do you
want me to open a new issue to discuss taking a similar approach
(distro-specific binaries)? Now that it is ready, it won't take much effort
for me but will require thought about how/whether it will integrate with
the current build script.—
Reply to this email directly or view it on GitHub
https://github.com/ariya/phantomjs/issues/12948#issuecomment-93361331.
@DrunkAdmin: if you have a script which can check the build stability, it would be better to add it as a test via a PR so that it can be verified automatically.
I cannot build 2.0 on CentOS 6.6:
In file included from rendering/RenderingAllInOne.cpp:89:
rendering/RenderQuote.cpp: In function ‘WTF::StringImpl* WebCore::stringForQuoteCharacter(UChar)’:
rendering/RenderQuote.cpp:308: warning: ‘WebCore::stringForQuoteCharacter(UChar)::StringForCharacter’ declared with greater visibility than the type of its field ‘WebCore::stringForQuoteCharacter(UChar)::StringForCharacter::string’
{standard input}: Assembler messages:
{standard input}:202926: Error: open CFI at the end of file; missing .cfi_endproc directive
g++: Internal error: Killed (program cc1plus)
@domino14: are you using devtoolset-1.1? You'll have to install it and enable it using scl enable devtoolset-1.1 bash
. You also need to have a lot of RAM free (6-8GB) when compiling the AllInOne files, if not just run the compilation process without multiple process (make
instead of make -jWHATEVER
).
I use phantomjs to test some sites in multi-threaded mode. I have a set of scripts and it is impossible to identify the place where the program crashes. I think this complex include a set of test programs would be inappropriate. I have the ability to compile and run the test sites with the new version of the program. I will see if it will become unstable and possibly gather error logs.
Отправлено с iPhone
15 апр. 2015 г., в 17:10, Ashish Kulkarni [email protected] написал(а):
@DrunkAdmin: if you have a script which can check the build stability, it would be better to add it as a test so that it can be verified automatically.
—
Reply to this email directly or view it on GitHub.
I wonder how hard it would be to persuade the build process to link more of the non-bundled libraries (such as libicu*
and libssl
) statically. I'd know exactly how to do that if the build system used autotools, but qmake is Greek to me :frowning:
I was wondering - why is this issue blocking official binaries from being built? As far as I can tell, building a binary on a RHEL-based system works fine on any RHEL-based system; the same goes for Debian-based systems. Why not make two binaries available until the issue can be resolved? We'd really like to use PhantomJS 2.0 on my current team (it solves a problem that was blocking us from using PhantomJS 1.x) and our infrastructure team is reluctant to allow us to use a binary that we have built ourselves, so it would be great if there were official binaries. We're a Red Hat shop here, so I'm happy to contribute towards the production of the RPM configuration if that would help?
I think that @ariya has to make a call on this, I already volunteered for producing distro-specific binaries above (I have to do almost the same effort for wkhtmltopdf, so maintaining it is not going to be an issue in the long run).
+1 Distro specific binaries. There is nothing "convenient" about this delay.
I don't want to take this up unilaterally as it effectively means a rewrite of the build system, without feedback the chances of merging would be essentially nil.
I have built a phantomjs binary for Amazon Linux.
You can find it here : phantomjs2-amazon-linux
I'd like to +1 the static built binaries, because I'd like to use phantomjs in a continuous delivery system, where my build agents are supposed to have minimum prerequisites. So just distributing a phantomjs static binary would be great!
+1 to @dploeger, I have the exact same use case and am using chef to setup PhantomJS. having to build them on the fly makes the process longer and would require a significant rewrite.
Docker may help: https://registry.hub.docker.com/u/rosenhouse/phantomjs2/
I'm currently trying a debian Jessie build (by replacing the first line by FROM debian:latest).
I can give some help if you want to make docker envs for different distros.
Static compilation with ICU library has been fixed for Linux.
vitaly@ubuntu:~/dev/phantomjs/src$ ldd ../bin/phantomjs
linux-vdso.so.1 => (0x00007fffd9098000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f41e6c60000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f41e6a00000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f41e6620000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f41e63e0000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f41e6138000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f41e5f30000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f41e5d28000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f41e5b08000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f41e5800000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f41e54f8000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f41e52e0000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f41e4f18000)
/lib64/ld-linux-x86-64.so.2 (0x00007f41e6e98000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f41e4ce8000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f41e4ac0000)
@Vitallium: I assume it is using a static build of ICU?
@ashkulz yep, it is. I patched our Qt library to link static ICU libraries with -DU_STATIC_IMPLEMENTATION
I assume the host OS/environment was CentOS 6? I didn't see the patches pushed to your fork yet.
@ashkulz I didn't push it yet. Still needs to perform some tests. I compiled it on Ubuntu 14.04.
Trying to compile on CentOS 6.6 Final
uname -rsvo
Linux 3.14.27-xxxx-grs-ipv6-64 #1 SMP Wed Dec 17 14:02:42 CET 2014 GNU/Linux
cat /etc/centos-release
CentOS release 6.6 (Final)
and getting error:
g++: Internal error: Segmentation fault (program cc1plus)
Please submit a full bug report.
See http://bugzilla.redhat.com/bugzilla for instructions.
make[2]: ** [.obj/qabstractanimation.o] Error 1
make[2]: Leaving directory /root/phantomjs/phantomjs/src/qt/qtbase/src/corelib'
make[1]: *** [sub-corelib-make_first] Error 2
make[1]: Leaving directory
/root/phantomjs/phantomjs/src/qt/qtbase/src'
make: ** [sub-src-make_first] Error 2
I tried ./build_sh --jobs 1 too, anyone can help?
Hi People. I have been using PhantomJS for about a month and would like to use the latest Linux version for my build system. @Vitallium, do you have an ETA on pushing your fix? Thanks for your help fixing this issue.
ok guys I made phantomjs 2.0.1 compile for CentOS 6.6 here it is if you need it :
@codingkoala can you share the steps that you took to build and package?
+1
+1 static build for Red Hat Enterprise Linux
@cmluciano I was trying to compile on a CentOS 6.6 server and it was failing with the error I pasted above, so I decided to get VirtualBox on my iMac and install a clean CentOS 6.6 from scratch , Desktop install and follow all steps described here http://phantomjs.org/build.html for fedora distribution. The only thing I added was to install git ( yum -y install git ) before doing anything else.
Once compiling ended on VirtualBox image I got the phantomjs executable from bin directory and tested it on the CentOS 6.6 server I was trying to compile at first and it was working fine.
That's all, since the original server is an hosting one I do not know what they installed or upgraded, I can see that kernel version is different indeed, so probably something is causing conflict with compiling if the CentOS 6.6 install is too "edge", while on a clean install with all kept "basic" it's working fine.
I moved the image to github:
@codingkoala "I moved the image to github:
https://github.com/codingkoala/phantomjs-2.0.1-centos6.6"
I tried to run it and was told "error while loading shared libraries: libicudata.so.42". I am currently running PhantomJS 1.9.8 on my CentOS 6.6 server.
I did a bit of investigating and solved the problem by typing:
sudo yum -y install gcc gcc-c++ make flex bison gperf ruby \
openssl-devel freetype-devel fontconfig-devel libicu-devel sqlite-devel \
libpng-devel libjpeg-devel
I'm sure the error was only related to the libicu-devel package, but I figured it wouldn't hurt to be thorough.
By the way, I _really_ appreciate your compiling PhantomJS 2.0.1 for CentOS 6.6!!!
@codingkoala It looks like 2.0.1 can't handle page.uploadFile.
It would be great if you compiled a version of it with the patch listed at https://github.com/ariya/phantomjs/issues/12506#issuecomment-61698339. The patch is pretty simple, it just comments out two lines.
For now, I'm using 1.9.8 for some sites and 2.0.1 for other sites. (A LinkedIn page I interface with totally breaks under 1.9.8 but is solid under 2.0.1.)
@lifeboatpres I compiled phantomjs 2.0.1 with patch #12506 , please check my repo for both clean and patched version, I hope this helps.
@codingkoala "I compiled phantomjs 2.0.1 with patch #12506".
I checked and it works perfectly! Now sites that required PhantomJS 2.0 work _plus_ sites that required PhantomJS 1.9.8 (because of the regression in PhantomJS 2.0) work as well!
@codingkoala thanks a lot, your binary save my world... :)
I'm trying to get an updated binary for Ubuntu. Didn't see one linked, so I booted up a large EC2 instance and am building it right now. It's taking a really long time. How come phantomjs's build takes longer than building the entire linux kernel?
For those using Ubuntu, I compiled a working binary. Save yourself the 1+ hour compile time: https://github.com/mirraj2/PhantomjsUbuntu/blob/master/phantomjs-ubuntu.gz?raw=true
Hi guys any idea about when will you release the official Linux binaries at http://phantomjs.org/download.html?
mirraj2 does your version supports woff webfonts?
@oleghind No idea. All I did was clone the repo, checkout 2.0 and ran ./build.sh
:+1: for webfont request from @oleghind
@mtyeh411 I compiled master branch and webfonts works well now, dunno why it's still not fixed in the 2.0 branch, seems to be an easy fix
@Vitallium @ariya now that this issue seems to be resolved, is there any timeframe for uploading official binaries? This is the last blocker for medium/phantomjs to release 2.0 of their npm wrapper, which allows karma to upgrade, which means lots of test suites can drop the ES5 shim because PhantomJS 1.* doesn't have Function.prototype.bind
@Vitallium Which commit of yours fixed the icu issue?
@ariya I didn't push it yet. I'll do it later today. It will be in this branch https://github.com/Vitallium/phantomjs/commits/fix-linux-static-build
@SRGOM Can't THANK YOU and @bprodoehl enought, working like a charm in Ubuntu 14.04 !
Any ideas when this might get merged? We're looking forward to using this on codeship :)
@codingkoala thanks for the binary for Centos 6! Works great!
@Vitallium I pushed changes for a working static build to here: https://github.com/bprodoehl/phantomjs
I'm doing the actual build in a Dockerfile, which is also here: https://github.com/bprodoehl/phantomjs/blob/master/deploy/Dockerfile
My build has more crap baked in than 1.9 had, so the list of dependencies is shorter, which is good in some ways and bad in others.
PhantomJS 1.9.8:
linux-vdso.so.1 => (0x00007fff1f7dc000)
libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007fdd67c6a000)
libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00007fdd67a2b000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fdd67827000)
librt.so.1 => /lib64/librt.so.1 (0x00007fdd6761f000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fdd67403000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fdd670f4000)
libm.so.6 => /lib64/libm.so.6 (0x00007fdd66dec000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fdd66bd5000)
libc.so.6 => /lib64/libc.so.6 (0x00007fdd66818000)
/lib64/ld-linux-x86-64.so.2 (0x00007fdd67f14000)
libz.so.1 => /lib64/libz.so.1 (0x00007fdd66602000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00007fdd663f2000)
libpng16.so.16 => /lib64/libpng16.so.16 (0x00007fdd661bf000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x00007fdd65f95000)
PhantomJS 2.0:
linux-vdso.so.1 => (0x00007fffaa3e6000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fb482aa9000)
librt.so.1 => /lib64/librt.so.1 (0x00007fb4828a1000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb482685000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fb482376000)
libm.so.6 => /lib64/libm.so.6 (0x00007fb48206e000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fb481e57000)
libc.so.6 => /lib64/libc.so.6 (0x00007fb481a9a000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb482cad000)
It's built with Ubuntu 14.04, and I tested the same binary on Ubuntu 15.04, Fedora 20 and 21 and CentOS 7. Since it is still dynamically linking some core libs like libc and libstdc++, it doesn't work on distros much older than Ubuntu 14.04 (that includes CentOS 5 and 6). I'm going to try the same build process on Ubuntu 12.04 to see how much that widens support.
@bprodoehl yeah, old distros has dependency on their glibc. We can't link against old version because their are not ABI compatible with new versions.
Did you pass static compilation flag for libicu
? This flag is needed to build libicu statically.
We think now that we should produce 2 kind of binaries: one for old distros, like Debian, and another for new (Ubuntu, etc.)
@Vitallium I just got around the icu problem by adding -licudata, as suggested in that original Qt ticket. I haven't tried those changes in a dynamic build, or on a different platform yet. The build also seems to implicitly link in either expat or libxml2, which blows up the static linking for fontconfig. So I similarly had to add -lxml2 where fontconfig was pulled in. There is certainly a nicer way to do that, but I was going to go ask here if there's a strong preference of fontconfig and expat as dynamic dependencies (1.9.8 required them). With everything baked in, the binary is ~97MB unstripped and ~75MB stripped.
@Vitallium I may have misunderstood your question. Yes, I'm building libicu statically, along with zlib, libpng, libjpeg-turbo, libwebp, OpenSSL, libxml2, libxslt, Freetype and Fontconfig. Here's the chunk of Dockerfile that grabs and compiles libicu:
# libicu
ENV ICU_VER=55.1
ENV ICU_FILE_VER=55_1
RUN curl -sL http://download.icu-project.org/files/icu4c/${ICU_VER}/icu4c-${ICU_FILE_VER}-src.tgz | tar -xz
RUN cd icu/source && ./configure --prefix=/usr --enable-static --disable-shared && make all -j${NUM_CORES} && make install
@bprodoehl but what about static flag for libicu: U_STATIC_IMPLEMENTATION
?
@Vitallium I didn't need to add it, and it all linked. I've mostly been testing it on the different platforms with the rasterize example, so maybe there's a problem and I just haven't run into it yet. Is needing U_STATIC_IMPLEMENTATION something that's fixed in icu4c 55.1? I'll look more at the icu4c docs tonight. Otherwise if you have changes to the phantom build to set it and are confident that it's needed, I'll gladly take that, too!
Yes, I have fixed it recently, but I didn't push it yet.
If you link in fontconfig
statically but do not have it installed, does it work? I'd think that the configuration files being missing would cause problems... the best bet seems to be to do a CentOS 6 build with static linking for icu
and using -qt-libpng -qt-libjpeg
arguments when configuring Qt (other dependencies do not seem to cause issues due to the stable SONAMEs).
@ashkulz we use these flags to build Qt. For the fontconfig
. I don't think we would have a problem, but I'm not sure.
@ashkulz it seems to work linking in fontconfig statically but not having it installed, but it complains at each run about missing configuration files, and it seems that the first run takes awhile longer (perhaps building some font cache somewhere?). I'm rebuilding static on CentOS 5 and 6, with the same dynamic dependencies that PhantomJS 1.9.8 has (fontconfig, freetype, libz, libbz2, libpng and libexpat).
@Vitallium Should I try your fix-linux-static-build branch? Are you confident that this is good enough and going to push it to master?
I'm not seeing the @Vitallium branch work. I'm running ./build.sh --confirm --qt-config "-icu-static"
and I still see it blowing up not linking in libicudata. I've also tried ./build.sh --confirm --qt-config "-icu -icu-static"
ICU auto-detection... ()
g++ -c -pipe -DQT_NO_GRAPHICSVIEW -DQT_NO_GRAPHICSEFFECT -DQT_NO_STYLESHEET -DQT_NO_STYLE_CDE -DQT_NO_STYLE_CLEANLOOKS -DQT_NO_STYLE_MOTIF -DQT_NO_STYLE_PLASTIQUE -O2 -Wall -W -fPIE -I../../../mkspecs/linux-g++ -I. -o icu.o icu.cpp
g++ -Wl,-O1 -o icu icu.o -licui18n -licuuc
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../libicuuc.a(udata.ao): In function `openCommonData(char const*, int, UErrorCode*)':
udata.cpp:(.text._ZL14openCommonDataPKciP10UErrorCode+0x153): undefined reference to `icudt55_dat'
udata.cpp:(.text._ZL14openCommonDataPKciP10UErrorCode+0x16b): undefined reference to `icudt55_dat'
udata.cpp:(.text._ZL14openCommonDataPKciP10UErrorCode+0x190): undefined reference to `icudt55_dat'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../libicuuc.a(putil.ao): In function `uprv_dlsym_func_55':
putil.cpp:(.text.uprv_dlsym_func_55+0x1e): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../libicuuc.a(putil.ao): In function `uprv_dl_close_55':
putil.cpp:(.text.uprv_dl_close_55+0x11): undefined reference to `dlclose'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../libicuuc.a(putil.ao): In function `uprv_dl_open_55':
putil.cpp:(.text.uprv_dl_open_55+0x16): undefined reference to `dlopen'
collect2: ld returned 1 exit status
gmake: *** [icu] Error 1
ICU disabled.
The ICU library support cannot be enabled.
Turn on verbose messaging (-v) to /src/phantomjs/src/qt/qtbase/configure to see the final report.
If you believe this message is in error you may use the continue
switch (-continue) to /src/phantomjs/src/qt/qtbase/configure to continue.
Not sure if I'm misunderstanding the patch. The same system with 2.0 + this commit works: https://github.com/bprodoehl/phantomjs/commit/93e6bdb9fef8e3cec1d480c768c6385dea53e9d3
@ariya yes, before landing this to master, you should try it.
@bprodoehl I built my own copy of libicu with static flags. But, now I wonder why they ever have special flag for static linking, when you can just link with data. I think I'm missing something.
I am totally new at this, but was anyone able to build the PhantomJS for Linux ? I am currently running RedHat 6.5, and need PhantomJS 2 to be able to run a python script.
Much apprecaited
@elsherm We want to keep this thread about the static build. Please post any build problem to the official PhantomJS users mailing-list. If you have not read it yet, please check also a few tips on Effective Q&A.
So what's the status of the static build? There's a lot of issues and solutions discussed above, but it's hard to determine the current state of the static build and when it will be ready to land on master so downloadable binaries for linux can be made available.
I am building on CentOS 6.5 and tried both approaches by @Vitallium and @bprodoehl. The only one I could get to work was statically building all the required libraries and linking them as @bprodoehl suggested. I can confirm that I get the same fontconfig missing configuration error though.
Hi elsherm and remojansen, same with me... Hope that official Linux version will be launch soonly.
http://phantomjs.org/download.html
Trying below binary app on Centos7...
https://github.com/ariya/phantomjs/issues/12948#issuecomment-100051959
But there has permission error, may I know if the Linux verson works across all platforms? Or else error cause the permission error?
https://github.com/ropensci/RSelenium/issues/56
@dschaller: sudo ln -s /etc/fonts/fonts.conf /usr/etc/fonts/fonts.conf
fixed the fontconfig error for me (I'm on Debian 8).
@sproffer thanks a lot.. your phantomjs binaries works like charm for me...
i am using centos 7 x64 ... thanks a lot again... :)
I'd love to see this build. 75% of all PhantomJS downloads are for the Linux version.
@macbre that works but requires having access to the destination machine before launching phantomjs since it only links the existing font configs. Ideally there would be a way to either specify the path when building phantom as a configuration argument.
@bprodoehl thanks for your binaries? Is there anything similar for the 12.04?
@bprodoehl thanks for the 15.04 Ubuntu build - I'm just about to try it out.
@wizardyhnr solution works well. I compiled PhantomJS 2 for CentOS 6.4, and got it running on Ubuntu 12 and up by downloading the missing dependencies manually (libcrypto.so.10, libicudata.so.42, libicui18n.so.42, libicuuc.so.42, libjpeg.so.62, and libssl.so.10), putting them into the same directory as the binary and using "LD_LIBRARY_PATH=. ./phantomjs".
The only thing to watch out for is to make sure you're compiling the binary on the oldest distribution to avoid the GLIBC errors.
Compiling the source code of phantomjs in linux takes 30 minutes. On searching for binaries I land up on this page, is any binaries available as of now ? From the discussion I guess there are some issues, but still wanted to check, if not available, then when in nearest future it can be available
When linking to the static ICU libs, no changes are required since Qt 5.3.1 -- QTBUG-38445 ensured that -licudata
is added automatically in qtproject/qtbase@159465536f0dd1a373f0c67e5530f9af6ccec433. For the error about -ldl
, you have to pass the --disable-dyload
argument to ICU's configure
to ensure that error message goes away (you don't need dynamic loading in a statically-linked ICU). The exact command-line I'm using in wkhtmltopdf is:
source/configure --enable-release --disable-debug --enable-static --disable-shared --disable-tests --disable-samples --disable-dyload
I suspect that since the Qt upgrade, no further problems remain on the static ICU linkage front once ICU is configured correctly.
@bprodoehl have you managed to build on CentOS 5? Can you share your binaries / build procedure?
For those who can't successfully compile due to low memory, etc.
Instructions provided.
https://github.com/gitromand/phantomjs/releases/tag/2.0.1
System info:
$uname -a Linux 47406.local 3.2.0-80-generic #116-Ubuntu SMP Mon Mar 23 17:11:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Hi guys! Quick question: does anyone have tried to build phantomjs packages using fpm? Here's an example how to build nodejs package with it.
Do you think it would be possible to prepare _deb_ & _rpm_ packages with all dependencies included, so we can simply do sudo dpkg -i phantomjs2.0-ubuntu14.04x64.deb
?
Does anybody know if this works for ubuntu 14.04?
В ubuntu 14 нормально работает, только нужно установить дополнительно несколько библиотек.
Отправлено с iPhone
4 авг. 2015 г., в 1:14, Andrei Sura [email protected] написал(а):
Does anybody know if this works for ubuntu 14.04?
—
Reply to this email directly or view it on GitHub.
Thanks @gitromand for the binaries! (Just a note, the release description has a few references to phantomjs-1.9.8
)
Any rough estimates on when a stable build of Phantom JS 2 will be available for Linux?
Thanks, @stevage, fixed it.
@gitromand Hey man, thanks for the binaries.
I followed your instructions and upon running the phantomjs (or phantomjs201) command, I get the following error:
phantomjs: error while loading shared libraries: libicui18n.so.48: cannot open shared object file: No such file or directory
any idea how to fix this?
@elahmo try sudo yum -y install libicu-devel
or on Debian sudo apt-get install libicu-dev
@elahmo try sudo apt-get install libicu48
. Or just as @iradul said.
@iradul and @gitromand I have libicu-dev but its newer version, not 4.8. I cant seem to find the older version to install.
apt-cache policy libicu-dev
libicu-dev:
Installed: 52.1-3ubuntu0.3
Candidate: 52.1-3ubuntu0.3
Version table:
*** 52.1-3ubuntu0.3 0
500 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
52.1-3 0
500 http://mirrors.digitalocean.com/ubuntu/ trusty/main amd64 Package
These ones are available. For libicu48 installation, I get this:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libicu48 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libicu48' has no installation candidate~~~
@gitromand thanks a lot for the binaries, but I am experiencing the same issue that @elahmo has. When I try to install libicu48, I got
No package matching 'libicu48' is available
and when I try to run phantomjs I got
error while loading shared libraries: libicui18n.so.48: cannot open shared object file: No such file or directory
Follow the procedures via below link (Linux OS).
http://phantomjs.org/build.html
git clone git://github.com/ariya/phantomjs.git
fatal: destination path 'phantomjs' already exists and is not an empty directory.
@jplethier same issue here, but I found a copy here: https://launchpad.net/ubuntu/precise/amd64/libicu48/4.8.1.1-3 seems to work ok for me.
@webmull that worked perfectly! Thanks, I managed to get this running.
Now If only selenium wanted to start the app correctly that would be awesome :)
@elahmo No problem. I'm going through this process today and had to locate it myself for a vagrant provision script.
@ariya @Vitallium any update here? I think the last we heard was that @Vitallium had a patch and then someone else had a different patch? Are we any closer to getting a static build for linux?
Do you have binaries for any Linux distribution?
For those who just want to have a working 2.0 binary for multiple distributions, I took @bprodoehl's fork and Dockerfile, adjusted it and put it on the Docker hub. In order to get the binary, run the following (you need to have Docker installed of course):
docker run -v $PWD:/output mazzolino/phantomjs-static
You should have the phantomjs
binary in the current directory afterwards.
As the Docker image is big (~ 1GB), I uploaded a current build of the binary here.
There are some tests using different Docker distribution base images in the repository. It looks like currently it does not work on debian <8 and centos <7, because of incompatible glibc versions.
(Btw, thanks @bprodoehl for the work so far.)
Cool! I never could get what @Vitallium was working on to link right
(almost certainly my failing and not his), and I haven't had a chance to
look at it since 2.1 and the Qt rebase. I'll try to take a look at updating
my dockerfiles to 2.1 tonight.
On Sunday, August 23, 2015, Martin Honermeyer [email protected]
wrote:
For those who just want to have a working 2.0 binary for multiple
distributions, I took @bprodoehl https://github.com/bprodoehl's fork
and Dockerfile, adjusted it and put it on the Docker hub. In order to get
the binary, run the following (you need to have Docker installed of course):docker run -v $PWD:/output mazzolino/phantomjs-static
You should have the phantomjs binary in the current directory afterwards.
As the Docker image is big (~ 1GB), I uploaded a current build of the
binary here
http://phantomjs-static.s3-website-us-west-2.amazonaws.com/phantomjs.There are some tests using different Docker distribution base images in the
repository https://github.com/djmaze/docker-phantomjs-static. It looks
like currently it does not work on debian <8 and centos <7, because of
incompatible glibc versions.(Btw, thanks @bprodoehl https://github.com/bprodoehl for the work so
far.)—
Reply to this email directly or view it on GitHub
https://github.com/ariya/phantomjs/issues/12948#issuecomment-133830869.
This email message is for the sole use of the intended recipient(s) and may
contain Connectify confidential or privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not an
intended recipient, please contact the sender by reply email and destroy
all copies of the original message.
@bprodoehl: if you use the instructions I gave above for compiling ICU, you shouldn't need to patch phantomjs at all to get a static binary.
I have built phantomjs exceutable for CentOS 7
Thanks a lot!
@semirenko May I have the binary apps then? [email protected]
@englianhu, it was in the @sproffer 's commet above:
http://garyzhu.net/notes/phantomjs-centos7.tar
phantomjs compiled for Ubuntu14.04, it will surely save you a lot of time.
https://www.dropbox.com/s/qnh1aqdq9cpbsoz/phantomjs?dl=0
By the way, ArchLinux has offered a PhantomJS 2.0 package for a while now: https://www.archlinux.org/packages/community/x86_64/phantomjs/
Debian 8 (jessie)
https://drive.google.com/open?id=0Bx0-3EBJ9jrLZkszUjQ1eDJKbUE
Any news about a static linked binary? You know the 99% of the people out there use PhantomJS with NPM and having a pre-compiled binary is a must have...
ping @Vitallium
@FezVrasta yes, I'm working on a possible solution. This issue has the highest priority.
thanks
@samdraz Thanks for your Debian 8 binary but I get the following error when I run my test
java.lang.IllegalStateException: The driver is not executable: /root/phantomjs-2.0.0-linux-x86_64/bin/phantomjs
at com.google.common.base.Preconditions.checkState(Preconditions.java:197)
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:125)
at org.openqa.selenium.phantomjs.PhantomJSDriverService.findPhantomJS(PhantomJSDriverService.java:245)
at org.openqa.selenium.phantomjs.PhantomJSDriverService.createDefaultService(PhantomJSDriverService.java:181)
at org.openqa.selenium.phantomjs.PhantomJSDriver.
at yahootinder.Test.run(Test.java:43)
at java.lang.Thread.run(Thread.java:745)
This is how I give my program the phantomJS path which works with Windows
caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "/root/phantomjs-2.0.0-linux-x86_64/bin/phantomjs");
never mind, I had forgotten to make it executable with chmod. It works perfectly.
I see a few 64 bit binaries here but do you have anything for 32 bit?
Linux ARMv7 build : https://github.com/mitghi/phantomjs-2.0.0-armv7/raw/master/phantomjs-2.0.0-linux-armv7l.tar.bz2 (not by me but successfully tested on ARMv7 Ubuntu 14.04 LTS)
So, I finally have figured out where is the problem. The problem is that in Qt 5.5 flag static
doesn't mean build _everything_ statically. It means only static build of Qt.
Does this mean that we're going to see QT 5.5 upgrade & static build at the same time :open_mouth: ?
@iradul I think so. I don't see anything that could stop us from releasing 2.0.1 with Qt 5.5. Qt 5.5 fixes several critical issues: OS X + upx (and on Windows too), keychain dialog on OS X, etc.
:tada:
:+1:
:fireworks:
Getting below error while compiling the Source Phantomjs 2.0.0 from Phantomjs Official website (phantomjs-2.0.0-source.zip) in SUSE Linux Enterprise Server 11 SP3 for VMware (x86_64) - Kernel 3.0.101-0.47.55-default
../../../include/QtCore/5.3.0/QtCore/private/../../../../../src/corelib/kernel/qmetatypeswitcher_p.h:76: instantiated from ‘static ReturnType QMetaTypeSwitcher::switcher(DelegateObject&, int, const void_) [with ReturnType = bool, DelegateObject = QVariantIsNull<
../../corelib/kernel/qvariant.cpp:129: instantiated from here
../../../include/QtCore/5.3.0/QtCore/private/../../../../../src/corelib/kernel/qvariant_p.h:225: error: ‘const struct QHash
make[2]: _* [.obj/qvariant.o] Error 1
make[1]: ** [sub-bootstrap-make_first] Error 2
make: *** [sub-src-make_first] Error 2
Building QtWebkit...
Project ERROR: Unknown module(s) in QT: core
make: *** [sub-Source-WTF-WTF-pro-make_first-ordered] Error 3
Building main PhantomJS application...
cd src/ && ( test -e Makefile.phantomjs || /srv/jobs/phantomjs-2.0.0/src/qt/qtbase/bin/qmake /srv/jobs/phantomjs-2.0.0/src/phantomjs.pro -o Makefile.phantomjs ) && make -f Makefile.phantomjs
Project ERROR: Unknown module(s) in QT: webkitwidgets network gui core
make: *** [sub-src-phantomjs-pro-make_first-ordered] Error 3
Not sure what is missing and why this error is coming
@Vitallium is there any official build for PhantomJS 2.0.1? or any ETA for an updated phantomjs package on NPM?
Also, which one is the branch to compile the 2.0.1 ?
Thanks.
Guys, may I request:
1) Please stop asking for ETAs. I'm sure the dev team is hard at work
2) Please don't discuss compilation related issues unless its about the static build.
3) Please don't pressure the devs by telling them how badly you need PhantomJS (unless ofcourse you're a gold supporter of this project ;) )
Seriously, lets respect the spirit of open source and commend and thank devs for this tool.
FWIW, I used a modified version of bprodoehl's DockerFile to build a binary on Debian 7. I tested that it runs on a fresh install of Debian 7 and also on a fresh install of Ubuntu 15.04.
It can be found here: https://github.com/danielra/phantomjs-2.0.0-linux-x86_64/raw/master/phantomjs-2.0.0-linux-x86_64.tar.bz2
ldd output when run against this binary:
linux-vdso.so.1 => (0x00007ffe79280000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f6576756000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f65764b7000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f657629f000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f657609b000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f6575e93000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6575c76000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f657596f000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f65756ed000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f65754d6000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f657514b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f65769aa000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f6574f21000)
Thank you @danielra your binary works for me.
Does anyone have a build for openSUSE yet? I only see 1.9.8 on OBS:
Installed the CentOS7 build by @sproffer.
Got these errors:
libicudata.so.50 => not found
libicui18n.so.50 => not found
libicuuc.so.50 => not found
Did a sudo yum install libicu
... that installed libicu version 50.1.2-11.el7 for x86_64.
phantomjs -v
should show 2.0.0
@ldeavila Yes, I tried, I could not find static ICU library for CentOS7.
When I have time, I might do static build ICU myself.
I tried to use phantomjs on AWS Lambda using a binary I built on a AWS EC2 instance (using aws linux) but I have this error (like @ldeavila) :
Command failed: /var/task/phantomjs: error while loading shared libraries: libicudata.so.50: cannot open shared object file: No such file or directory
Someone had already did this ?
PS : I followed this http://blog.idetailaid.co.uk/compiling-phantomjs-2-0-for-aws-ec2-linux-image/ to compile
@Uhsac If you use Amazon Linux 2015.9, try:
You should have a good executable (phantonjs-2.0.0/phantomjs):
_ldd phantomjs-2.0.0/phantomjs_
linux-vdso.so.1 => (0x00007ffec01b1000) libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f3bcc5b1000) libz.so.1 => /lib64/libz.so.1 (0x00007f3bcc39b000) libicui18n.so.50 => /usr/lib64/libicui18n.so.50 (0x00007f3bcbfa3000) libicuuc.so.50 => /usr/lib64/libicuuc.so.50 (0x00007f3bcbc2d000) libicudata.so.50 => /usr/lib64/libicudata.so.50 (0x00007f3bca65a000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f3bca455000) librt.so.1 => /lib64/librt.so.1 (0x00007f3bca24d000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f3bca031000) libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007f3bc9d94000) libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007f3bc9b5f000) libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f3bc98f2000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f3bc95ec000) libm.so.6 => /lib64/libm.so.6 (0x00007f3bc92ea000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f3bc90d4000) libc.so.6 => /lib64/libc.so.6 (0x00007f3bc8d11000) /lib64/ld-linux-x86-64.so.2 (0x0000556fe7861000) libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f3bc8ae8000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f3bc889b000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f3bc85b8000) libcom_err.so.2 => /usr/lib64/libcom_err.so.2 (0x00007f3bc83b5000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f3bc8182000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f3bc7f73000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f3bc7d70000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f3bc7b55000) libselinux.so.1 => /usr/lib64/libselinux.so.1 (0x00007f3bc7934000)
@sproffer I can't use yum on AWS lambda, it's not possible to build a fully static binary ?
@Uhsac I have built a new executable (statically linked ICU libraries) which should work with stock Amazon Linux without extra packages, Hopefully, this will work on Amazon Lambda.
Give it a try:
Notes:
Static Linked some libraries, removed below dynamic libraries:
libjpeg.so libpng15.so libicui18n.so libicuuc.so libicudata.so
Below output is from a stock Amazon Linux instance:
[ec2-user@ip-172-16-0-142 ~]$ file phantomjs
phantomjs: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=3e8e4b82b95b8963be89f44569f12802d8d8abc4, not stripped[ec2-user@ip-172-16-0-142 ~]$ ldd phantomjs
linux-vdso.so.1 => (0x00007fffb459d000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f8cf0d08000)
libz.so.1 => /lib64/libz.so.1 (0x00007f8cf0af2000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f8cf08ed000)
librt.so.1 => /lib64/librt.so.1 (0x00007f8cf06e5000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8cf04c9000)
libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007f8cf022c000)
libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007f8cefff7000)
libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f8cefd8a000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f8cefa84000)
libm.so.6 => /lib64/libm.so.6 (0x00007f8cef782000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8cef56c000)
libc.so.6 => /lib64/libc.so.6 (0x00007f8cef1a9000)
/lib64/ld-linux-x86-64.so.2 (0x000055f4921ca000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f8ceef80000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f8ceed34000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f8ceea50000)
libcom_err.so.2 => /usr/lib64/libcom_err.so.2 (0x00007f8cee84d000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f8cee61b000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f8cee40b000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f8cee208000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f8cedfee000)
libselinux.so.1 => /usr/lib64/libselinux.so.1 (0x00007f8ceddcc000)[ec2-user@ip-172-16-0-142 ~]$ ./phantomjs -v
2.0.0
[ec2-user@ip-172-16-0-142 ~]$
@sproffer Can you compile it for Centos 6.7 or provide your changes to the build?
@sproffer I can launch phantom using your script but it fail when I'm using render command with this Error: Command failed:
(yeah not really verbose)
thx @sproffer
Works on AWS Lambda 🎉
@dstepanov I gave up on CentOS 6 some time ago, there are too many library differences between 6 and 7. I have been using CentOS 7, which is also the baseline for Amazon Linux. This should only work on CentOS 7, Amazon Linux (current version), RHEL 7.
@christianhaller @Uhsac I am not sure about AWS Lambda, I do not use it, I only use "plain / old" EC instances (Amazon Linux). I did not strip symbol tables from my executable, so you "might" be able to use gdb to debug it; but again, I don't know about AWS Lambda.
On ICU library, I have statically built ICU4C version 50.1.2 from source, and then statically linked them into phantomJS executable.
So I've been hearing that electron is the new phantomjs, and is even node
compatible? Anyone try it out ?
On Thu, Nov 19, 2015 at 5:13 PM sproffer [email protected] wrote:
@dstepanov https://github.com/dstepanov I gave up on CentOS 6 some time
ago, there are too many library differences between 6 and 7. I have been
using CentOS 7, which is also the baseline for Amazon Linux. This should
only work on CentOS 7, Amazon Linux (current version), RHEL 7.@christianhaller https://github.com/christianhaller @Uhsac
https://github.com/Uhsac I am not sure about AWS Lambda, I do not use
it, I only use "plain / old" EC instances (Amazon Linux). I did not strip
symbol tables from my executable, so you "might" be able to use gdb to
debug it; but again, I don't know about AWS Lambda.On ICU library, I have statically built ICU4C version 50.1.2 from source,
and then statically linked them into phantomJS executable.—
Reply to this email directly or view it on GitHub
https://github.com/ariya/phantomjs/issues/12948#issuecomment-158216950.
@avindra does it have socket api? can it be run headless? does it have capybara driver?
Is it solved? Any help needed?
@jeanleonino I don't think it's solved. An official phantomjs 2.x binary for Linux is still missing.
On the other hand, it looks like being fixed in #13822
Work is ongoing in #13822, and it sounds really close.
On Saturday, December 26, 2015, John Yani [email protected] wrote:
@jeanleonino https://github.com/jeanleonino I don't think so. An
official phantomjs 2.x binary for Linux is still missing.—
Reply to this email directly or view it on GitHub
https://github.com/ariya/phantomjs/issues/12948#issuecomment-167369437.
This email message is for the sole use of the intended recipient(s) and may
contain Connectify confidential or privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not an
intended recipient, please contact the sender by reply email and destroy
all copies of the original message.
The solution is to use Docker. The binaries will be provided in the next release 2.1 (when? whenever it's ready!). For further details, refer to #13822 and/or consult the mailing-list.
@ariya Thanks, and thanks for closing. :+1:
Guys please make it finally for Ubuntu! It's almost a year since we don't have it. I tried building from binaries, and after 15 hours I still don't have it working!
For ubuntu, take a look at below page :
https://github.com/bprodoehl/phantomjs/releases
On Jan 5, 2016 10:31 PM, "Ivan Suslov" [email protected] wrote:
Guys please make it finally for Ubuntu! It's almost a year since we don't
have it. I tried building from binaries, and after 15 hours I still don't
have it working!—
Reply to this email directly or view it on GitHub
https://github.com/ariya/phantomjs/issues/12948#issuecomment-169247902.
Thank you very much! It works!
Ubuntu is trivial. The problem is with CentOS 6.
Here is a summarized list of several alternatives for everyone.
If you can wait for an official Linux binary, watch for the next release of version 2.1. Follow #12970 for further detailed updates.
If you can't wait and you want to run PhantomJS on your own Linux system:
Note on trust: While you may have a certain level of trust on your Linux distribution, its packagers, or the folks behind PhantomJS, you need to be cautious in extending that trust to anyone (especially on the Intertubes). Downloading and running an executable from a random person is not necessary the best security practice.
If you want to find a way to build PhantomJS Linux binary _statically_:
I believe that everyone's needs can be fulfilled with one of the above paths.
Let's stop this thread for everyone's benefit.
@sproffer got it working pretty easily on aws lambda with your centos7 build, thanks for the good work !
I am wanting to build PhantomJS for an ARMv7 Debian-based distro and output a static binary, I don't need a .deb file. There's a lot of noise on the thread you tell us to read.. can you point me at a Dockerfile or a clear set of instructions please? @ariya
@alexellis as described in https://github.com/ariya/phantomjs/tree/master/deploy
Once you have Docker installed, run these commands from the top level of the PhantomJS source repository:
$ git clean -xfd . $ docker run -v $PWD:/src debian:wheezy /src/deploy/docker-build.sh
So there are no instructions for ARM processors? Is there any reason why you don't have a Dockerfile, too?
I have written a blog regarding cross compile armv7 binary in docker. You
can have a look at that:
http://wizardyhnr.blogspot.com/2016/04/how-to-build-cross-compliatio.html?m=1
On Sat, Aug 6, 2016 at 10:03 AM Alex Ellis [email protected] wrote:
So there are no instructions for ARM processors? Is there any reason why
you don't have a Dockerfile, too?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ariya/phantomjs/issues/12948#issuecomment-238024748,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHBcny-qnv5J44UEif5IFlVyZ7bM-elcks5qdJRLgaJpZM4DbY7J
.
Is there any description how to build a PhantomJS version on Ubuntu with static dependencies (especially libicu) based on the latest sources?