Static build complication on Linux due to OpenSSL and ICU #12948

Closed
ariya opened this Issue Feb 4, 2015 · 190 comments

Projects

None yet
@ariya
Owner
ariya commented Feb 4, 2015

Compared to 1.x, PhantomJS 2.0 has exhibits some problem when being built statically to produce the official Linux binaries.

@ariya
Owner
ariya commented Feb 4, 2015

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)
@ariya
Owner
ariya commented Feb 4, 2015

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)
@ariya
Owner
ariya commented Feb 4, 2015

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)
@ariya ariya referenced this issue Feb 4, 2015
Closed

Release of PhantomJS 2.0 #12897

7 of 7 tasks complete
@Vitallium
Collaborator
@Vitallium
Collaborator

@ariya, found the problem. Starting commit - 8d23afb

@ariya
Owner
ariya commented Feb 6, 2015

@Vitallium Do you mean that the mentioned commit start to introduce the broken build?

@Vitallium
Collaborator

@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.

@Vitallium
Collaborator

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)
@ariya
Owner
ariya commented Feb 7, 2015

@Vitallium Good news! Now we just need to solve the ICU library...

@kenips
kenips commented Feb 12, 2015

@ariya isn't ICU bug fixed in 5.3.1? Or we're talking about something else?

@kenips kenips referenced this issue in Medium/phantomjs Feb 12, 2015
Closed

2.0 #288

@ariya
Owner
ariya commented Feb 13, 2015

@kenips Can you elaborate?

@BanzaiMan BanzaiMan referenced this issue in travis-ci/travis-ci Feb 13, 2015
Open

Add support for PhantomJS 2.0 #3225

@kenips
kenips commented Feb 13, 2015

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?

@ohenak
ohenak commented Feb 18, 2015

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?

@AkeemMcLennon

@ohenak From my understanding, that should theoretically work across similar environments. (e.g. all machines running the same version of Ubuntu).

@achiang
achiang commented Feb 25, 2015

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

@achiang
achiang commented Feb 25, 2015

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.

@ariya ariya added the Regression label Feb 25, 2015
@avindra
avindra commented Mar 5, 2015

Any ETA / roadmap on this issue? We would like to deploy PhantomJS 2.0 without having to compile.

@ashkulz
Contributor
ashkulz commented Mar 9, 2015

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 😄

@ashkulz
Contributor
ashkulz commented Mar 9, 2015

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.

@zachgersh

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

@emaphp
emaphp commented Mar 12, 2015

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

@ariya
Owner
ariya commented Mar 13, 2015

@ashkulz Good call on CentOS 5. PhantomJS 2 probably should not be bothered with it.

@ariya
Owner
ariya commented Mar 13, 2015

@emaphp This issue has nothing to do with libicu availability.

@Pyppe
Pyppe commented Mar 13, 2015

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

@SocalNick

@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
@sproffer

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.

@Pyppe
Pyppe commented Mar 14, 2015

@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.

@chrislopresto chrislopresto referenced this issue in plyfe/ember-social Mar 15, 2015
Merged

Install PhantomJS 2.0 #19

@level420

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?

@andreasrosdal

+1 for wanting static Linux binaries of PhantomJS 2.

@SocalNick

@Pyppe that did the trick, thanks!

@cschwarz-inco

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.

@level420

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: #13048

@ariya
Owner
ariya commented Mar 20, 2015

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.

@wizardyhnr

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.

@zhushanhu

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

@wizardyhnr

@zhushanhu, looks like you did not follow the build instruction and install the library dependencies.
http://phantomjs.org/build.html

@sean-hill

Have the binaries been prepared yet for a ubunu linux server?

@jdunk jdunk referenced this issue in casperjs/casperjs Apr 4, 2015
Closed

Support for PhantomJS 2.0 #987

@alekciy
alekciy commented Apr 6, 2015

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 detro/ghostdriver#435 fixed.

@londoh
londoh commented Apr 9, 2015

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.

@sbmaxx
sbmaxx commented Apr 14, 2015

Hey, guys. Do you need any help here?

@londoh
londoh commented Apr 14, 2015

yep, as per my post above phantomjs wont install

@DrunkAdmin

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.

@ashkulz
Contributor
ashkulz commented Apr 15, 2015

@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.

@DrunkAdmin

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 notifications@github.com:

@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
#12948 (comment).

@ashkulz
Contributor
ashkulz commented Apr 15, 2015

@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.

@domino14
Contributor

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)
@ashkulz
Contributor
ashkulz commented Apr 18, 2015

@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).

@DrunkAdmin

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 notifications@github.com написал(а):

@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.

@zackw
Collaborator
zackw commented Apr 20, 2015

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 😦

@duffj
duffj commented Apr 29, 2015

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?

@ashkulz
Contributor
ashkulz commented Apr 30, 2015

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

@iandanforth

+1 Distro specific binaries. There is nothing "convenient" about this delay.

@ashkulz
Contributor
ashkulz commented May 1, 2015

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.

@jakekdodd jakekdodd referenced this issue in customink-webops/phantomjs May 4, 2015
Open

Source download signature has changed #30

@charlesthk

I have built a phantomjs binary for Amazon Linux.
You can find it here : phantomjs2-amazon-linux

@dploeger
dploeger commented May 8, 2015

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!

@hackfanatic

+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.

@bjonnh
bjonnh commented May 15, 2015

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.

@Vitallium
Collaborator

image
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)
@ashkulz
Contributor
ashkulz commented May 16, 2015

@Vitallium: I assume it is using a static build of ICU?

@Vitallium
Collaborator

@ashkulz yep, it is. I patched our Qt library to link static ICU libraries with -DU_STATIC_IMPLEMENTATION

@ashkulz
Contributor
ashkulz commented May 16, 2015

I assume the host OS/environment was CentOS 6? I didn't see the patches pushed to your fork yet.

@Vitallium
Collaborator

@ashkulz I didn't push it yet. Still needs to perform some tests. I compiled it on Ubuntu 14.04.

@codingkoala

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?

@mvermilion

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.

@codingkoala

ok guys I made phantomjs 2.0.1 compile for CentOS 6.6 here it is if you need it :

https://github.com/codingkoala/phantomjs-2.0.1-centos6.6

@cmluciano

@codingkoala can you share the steps that you took to build and package?

@bprodoehl

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 notifications@github.com
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
#12948 (comment).

http://www.connectify.me/

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.

@ashkulz
Contributor
ashkulz commented Aug 25, 2015

@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.

@semirenko

I have built phantomjs exceutable for CentOS 7

Thanks a lot!

@englianhu

@semirenko May I have the binary apps then? englianhu@gmail.com

@magoni magoni referenced this issue in DDMAL/diva.js Sep 8, 2015
Closed

Tests: some simulated events are broken #286

@hacktvist

phantomjs compiled for Ubuntu14.04, it will surely save you a lot of time.
https://www.dropbox.com/s/qnh1aqdq9cpbsoz/phantomjs?dl=0

@jokeyrhyme

By the way, ArchLinux has offered a PhantomJS 2.0 package for a while now: https://www.archlinux.org/packages/community/x86_64/phantomjs/

@FezVrasta

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

@Vitallium
Collaborator

@FezVrasta yes, I'm working on a possible solution. This issue has the highest priority.

@FezVrasta

thanks

@arya6000

@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.(PhantomJSDriver.java:104)
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");

@arya6000

never mind, I had forgotten to make it executable with chmod. It works perfectly.

@Dingo64
Dingo64 commented Sep 23, 2015

I see a few 64 bit binaries here but do you have anything for 32 bit?

@EpocDotFr

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)

@Vitallium
Collaborator

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.

@iradul
Contributor
iradul commented Sep 30, 2015

Does this mean that we're going to see QT 5.5 upgrade & static build at the same time 😮 ?

@Vitallium
Collaborator

@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.

@iradul
Contributor
iradul commented Sep 30, 2015

🎉

@EpocDotFr

👍

@sbmaxx
sbmaxx commented Sep 30, 2015

🎆

@mayank-phanton

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<::CoreTypesFilter>]’
../../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<QString, QVariant>’ has no member named ‘isNull’
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

@jzaefferer jzaefferer referenced this issue in jquery/jquery-ui Oct 1, 2015
Open

[WIP] Mouse: Switch to pointer events, via PEP #1611

2 of 6 tasks complete
@FezVrasta

@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.

@SRGOM
SRGOM commented Oct 2, 2015

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.

@danielra

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)
@alexrayu

Thank you @danielra your binary works for me.

@avindra
avindra commented Nov 3, 2015

Does anyone have a build for openSUSE yet? I only see 1.9.8 on OBS:

http://software.opensuse.org/package/phantomjs

@ldeavila
ldeavila commented Nov 4, 2015

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

@sproffer
sproffer commented Nov 4, 2015

@ldeavila Yes, I tried, I could not find static ICU library for CentOS7.
When I have time, I might do static build ICU myself.

@Uhsac
Uhsac commented Nov 5, 2015

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

@sproffer
sproffer commented Nov 5, 2015

@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)
@Uhsac
Uhsac commented Nov 6, 2015

@sproffer I can't use yum on AWS lambda, it's not possible to build a fully static binary ?

@sproffer

@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 ~]$

@pnc pnc referenced this issue in justengland/phantom-lambda-template Nov 18, 2015
Closed

Amazon Linux build #7

@MatousJobanek MatousJobanek added a commit to MatousJobanek/arquillian-phantom-binary that referenced this issue Nov 18, 2015
@MatousJobanek MatousJobanek Update to PhantomJS 2.0.0 (Linux binaries are excluded)
Linux binaries exclusion - for more information see:
ariya/phantomjs#12948
3c1d5b1
@dstepanov

@sproffer Can you compile it for Centos 6.7 or provide your changes to the build?

@Uhsac
Uhsac commented Nov 18, 2015

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

@christianhaller

thx @sproffer
Works on AWS Lambda 🎉

@sproffer

@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.

@avindra
avindra commented Nov 19, 2015

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 notifications@github.com 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
#12948 (comment).

@Vanuan
Vanuan commented Dec 7, 2015

@avindra does it have socket api? can it be run headless? does it have capybara driver?

@webmonarch webmonarch added a commit to SimplyCredit/phantomjs2 that referenced this issue Dec 16, 2015
@webmonarch webmonarch Hack in Travis CI's PhantomJS 2.0.0 Ubuntu 12.04 binary
To deal with the disaster that is ariya/phantomjs#12948
d880631
@webmonarch webmonarch added a commit to SimplyCredit/phantomjs2 that referenced this issue Dec 16, 2015
@webmonarch webmonarch Hack in Travis CI's PhantomJS 2.0.0 Ubuntu 12.04 binary
To deal with the disaster that is ariya/phantomjs#12948
a13be57
@zackw zackw modified the milestone: Release 2.0.1, Release 2.1 Dec 23, 2015
@jeanleonino

Is it solved? Any help needed?

@Vanuan
Vanuan commented Dec 26, 2015

@jeanleonino I don't think it's solved. An official phantomjs 2.x binary for Linux is still missing.

@Vanuan
Vanuan commented Dec 26, 2015

On the other hand, it looks like being fixed in #13822

@bprodoehl

Work is ongoing in #13822, and it sounds really close.

On Saturday, December 26, 2015, John Yani notifications@github.com 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
#12948 (comment).

http://www.connectify.me/

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.

@ariya
Owner
ariya commented Dec 27, 2015

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 ariya closed this Dec 27, 2015
@jeanleonino

@ariya Thanks, and thanks for closing. 👍

@iSuslov
iSuslov commented Jan 6, 2016

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!

@sproffer
sproffer commented Jan 6, 2016

For ubuntu, take a look at below page :
https://github.com/bprodoehl/phantomjs/releases
On Jan 5, 2016 10:31 PM, "Ivan Suslov" notifications@github.com 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
#12948 (comment).

@iSuslov
iSuslov commented Jan 6, 2016

Thank you very much! It works!

@Vanuan
Vanuan commented Jan 6, 2016

Ubuntu is trivial. The problem is with CentOS 6.

@ariya
Owner
ariya commented Jan 7, 2016

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:

  • compile it yourself per the instruction given in http://phantomjs.org/build.html
  • unable to compile it yourself due to various reasons? Find a person you can trust to compile it for you

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:

  • learn the Docker workflow described in #13822, or
  • follow the instruction in the README

I believe that everyone's needs can be fulfilled with one of the above paths.

Let's stop this thread for everyone's benefit.

@EFF
EFF commented Jan 21, 2016

@sproffer got it working pretty easily on aws lambda with your centos7 build, thanks for the good work !

@MatousJobanek MatousJobanek added a commit to qa/arquillian-phantom-binary that referenced this issue Jan 22, 2016
@MatousJobanek MatousJobanek Update to PhantomJS 2.0.0 (Linux binaries are excluded)
Linux binaries exclusion - for more information see:
ariya/phantomjs#12948
9eefedf
@alexellis

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

@zowers
zowers commented Aug 6, 2016

@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
@alexellis

So there are no instructions for ARM processors? Is there any reason why you don't have a Dockerfile, too?

@wizardyhnr

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 notifications@github.com 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
#12948 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHBcny-qnv5J44UEif5IFlVyZ7bM-elcks5qdJRLgaJpZM4DbY7J
.

@markusschlebusch
markusschlebusch commented Nov 17, 2016 edited

Is there any description how to build a PhantomJS version on Ubuntu with static dependencies (especially libicu) based on the latest sources?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment