Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Support Solaris (and also Joyent SmartOS) #10521

Closed
ariya opened this issue May 2, 2012 · 83 comments
Closed

Support Solaris (and also Joyent SmartOS) #10521

ariya opened this issue May 2, 2012 · 83 comments
Assignees

Comments

@ariya
Copy link
Owner

ariya commented May 2, 2012

ariya.hi...@gmail.com commented:

Currently Solaris, and hence also Solaris-based SmartOS from Joyent, is not supported.

Disclaimer:
This issue was migrated on 2013-03-15 from the project's former issue tracker on Google Code, Issue #521.
🌟   5 people had starred this issue at the time of migration.

@ariya
Copy link
Owner Author

ariya commented Sep 27, 2012

j...@spandex.io commented:

Any updates on this? What's required to support Solaris?

@ariya
Copy link
Owner Author

ariya commented Sep 27, 2012

ariya.hi...@gmail.com commented:

There is no update. No Solaris expert has chimed in yet, therefore there is no data as to how hard it would be.

@arlolra
Copy link

arlolra commented Oct 13, 2012

arlo...@gmail.com commented:

Joyent's SmartOS pkgsrc repo as of 2011Q4 contains version 1.4.1
http://pkgsrc.joyent.com/sdc/2011Q4/x86_64/All/phantomjs-1.4.1.tgz

@tonyarkles
Copy link

t.ark...@gmail.com commented:

I'm just in the process of trying to figure out what needs to happen to make this work.

@ghost ghost assigned ariya Mar 15, 2013
@drook
Copy link

drook commented Apr 14, 2013

I'm trying to build phantomjs on solaris 11.1.
I'm able to create a mkspec file for solaris (freebsd-g++ spec can be used, all of the headers are in place,

#include <sys/filio.h>

must be added in qplatformdefs.h and I didn't figure out how to remove unsupported -Wl,-O1 from linker flags, so I just hacked the

QMAKE_LFLAGS_RELEASE +=

in g++-unix.conf).

amd64 version if failing to build early, in qt/corelib:

g++ -c -include .pch/release-static/QtCore -g -m64 -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -pthread -D_THREAD_SAFE -fPIC -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 -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/solaris-cc -I. -I../../include -I../../include/QtCore -I.rcc/release-static -Iglobal -I../../tools/shared -I../3rdparty/zlib -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-static -I/usr/local/include -o .obj/release-static/qabstractanimation.o animation/qabstractanimation.cpp
/var/tmp//ccuQa4Sn.s: Assembler messages:
/var/tmp//ccuQa4Sn.s:622: Error: Incorrect register `%rbx' used with `l' suffix
make[1]: *** [.obj/release-static/qabstractanimation.o] Error 1
make[1]: Leaving direcory `/home/emz/src/phantomjs-1.9.0-amd64/src/qt/src/corelib'
make: *** [sub-corelib-make_default-ordered] Error 2
./build.sh: line 79: src/qt/bin/qmake: No such file or directory
Press any key to continue...

i386 version is able to build qt basic components, but is crashing while building qtwebkit:

In file included from ../../JavaScriptCore/wtf/CrossThreadRefCounted.h:37:0,
                 from ../../JavaScriptCore/wtf/text/StringImpl.h:28,
                 from ../../JavaScriptCore/runtime/UString.h:26,
                 from ../../JavaScriptCore/yarr/YarrPattern.h:30,
                 from ../../JavaScriptCore/yarr/YarrInterpreter.h:29,
                 from ../../JavaScriptCore/yarr/YarrInterpreter.cpp:28:
../../JavaScriptCore/wtf/Threading.h:116:12: error: ‘yield’ is already declared in this scope
make[2]: *** [.obj/release-static/YarrInterpreter.o] Error 1
make[2]: Leaving directory `/home/emz/src/phantomjs-1.9.0/src/qt/src/3rdparty/webkit/Source/WebKit/qt'
make[1]: *** [sub-WebKit-qt-QtWebKit-pro-make_default-ordered] Error 2
make[1]: Leaving directory `/home/emz/src/phantomjs-1.9.0/src/qt/src/3rdparty/webkit/Source'
make: *** [sub-webkit-make_default-ordered] Error 2
./build.sh: line 79: src/qt/bin/qmake: No such file or directory

I tried to clone their repo (https://gitorious.org/+qtwebkit-developers/webkit/qtwebkit, as stated in README), but I had no luck at all while trying to build it - seems like they use some old configure.ac file - autogen.sh doesn't see my installed libtool and thus produces broken configure.

Any ideas ?

P.S. Can you clarify one thing for me - if I need phantomjs for my web-server (actually, for node.js integration) - and I have no X on my webserver, is there a way may be to build it without X ? I really feel like I don't need Qt at all. I thought 'headless' assumes 'no graphical toolkit'.

@drook
Copy link

drook commented Apr 14, 2013

By the way, this particular error can be fixed commenting out this 'yield' declaration, but then it crashes on:

../../JavaScriptCore/heap/MachineStackMarker.cpp:120:13: warning: unused parameter ‘signo’
../../JavaScriptCore/heap/MachineStackMarker.cpp: In function ‘size_t JSC::getPlatformThreadRegisters(const JSC::PlatformThread&, JSC::PlatformThreadRegisters&)’:
../../JavaScriptCore/heap/MachineStackMarker.cpp:387:45: error: ‘pthread_getattr_np’ was not declared in this scope
make[2]: *** [.obj/release-static/MachineStackMarker.o] Error 1
make[2]: Leaving directory `/home/emz/src/phantomjs-1.9.0/src/qt/src/3rdparty/webkit/Source/WebKit/qt'
make[1]: *** [sub-WebKit-qt-QtWebKit-pro-make_default-ordered] Error 2
make[1]: Leaving directory `/home/emz/src/phantomjs-1.9.0/src/qt/src/3rdparty/webkit/Source'
make: *** [sub-webkit-make_default-ordered] Error 2

And this seems unfixable regarding my skills.

@drook
Copy link

drook commented Apr 14, 2013

Seems like it can be easily fixed too, after that there's only one crash point which requires --std=c99.

I have build the phantomjs, the binary is working.

@drook
Copy link

drook commented Apr 14, 2013

Just a note about fixing:

‘pthread_getattr_np’ was not declared in this scope

can be fixed by adding

pthread_attr_init(&regs);

in the last branch, which Solaris compiler seem to be falling into. This branch doesn't contain proper code and is marked as FIXME.

So the whole piece should look like this:

#elif OS(WINDOWS)
    regs.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL | CONTEXT_SEGMENTS;
    GetThreadContext(platformThread, &regs);
    return sizeof(CONTEXT);
#elif USE(PTHREADS)
    pthread_attr_init(&regs);
#if HAVE(PTHREAD_NP_H) || OS(NETBSD)
    // e.g. on FreeBSD 5.4, neundorf@kde.org
    pthread_attr_get_np(platformThread, &regs);
#else
    // FIXME: this function is non-portable; other POSIX systems may have different np alternatives
    //pthread_getattr_np(platformThread, &regs);
    pthread_attr_init(&regs);
#endif
    return 0;
#else
#error Need a way to get thread registers on this platform
#endif

@drook
Copy link

drook commented Apr 14, 2013

"Hello world" script does work, the google rendering also works - http://tech.hq.norma.perm.ru/files/google.png (rendered on Solaris, with cyrillic locale). Fonts are ugly, but I think this can be fixed somehow, right ?

@drook
Copy link

drook commented Apr 14, 2013

Got it. Since qtwebkit uses default fontconfig, I made a couple of screenshots with TTF fonts enabled. First uses default rendering settings, second uses some tweaks like AA/hints.

http://tech.hq.norma.perm.ru/files/google-fonts.png
http://tech.hq.norma.perm.ru/files/google-custom-config.png

@ariya
Copy link
Owner Author

ariya commented Apr 14, 2013

@drook Good news! Looking forward to seeing the patch.

@drook
Copy link

drook commented Apr 14, 2013

I'm not that good at patching; will a "raw solaris patch" be enough ? You know, a patch which will still require some manual intervention when building, and will also probably break other platforms, so someone will need to look at it and make if fit for the general codebase.

I can also provide packaged binaries for Solaris 11.0 and 11.1 (x86). I could provide Solaris 10 x86 binaries also, but I think they will be compiler-dependant (I'm sure this won't build with the default 3.4.3, so it needs some modern gcc), when it concerns libgcc_s.so.1.

@ariya
Copy link
Owner Author

ariya commented Apr 15, 2013

@drook Well, just a patch which shows the modification you make will be a start. That way, every one else can have a look and ensure that it doesn't cause problems for other platforms.

@drook
Copy link

drook commented Apr 15, 2013

So....

Patch:
http://tech.hq.norma.perm.ru/files/phantomjs.solaris.diff

Test pic (made with a phantomjs binary, compiled after patching, zero manual intervention):
http://tech.hq.norma.perm.ru/files/google-patched.png

Comments:
I refined the "raw" patch, and to my knowledge, right now it should not break building on other platforms (but still can). I'm bothered only by the problem in src/qt/src/3rdparty/webkit/Source/JavaScriptCore/heap/MachineStackMarker.cpp - to my knowledge, the issue with

/../JavaScriptCore/wtf/Threading.h:116:12: error: ‘yield’ is already declared in this scope

should also fire on Linux too, since the gcc is the same:

[root@hyperion bin]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/lto-wrapper
Target: i386-pc-solaris2.11
Configured with: /builds/hudson/workspace/nightly-update/build/i386/components/gcc45/gcc-4.5.2/configure CC=/ws/on11update-tools/SUNWspro/sunstudio12.1/bin/cc CXX=/ws/on11update-tools/SUNWspro/sunstudio12.1/bin/CC --prefix=/usr/gcc/4.5 --mandir=/usr/gcc/4.5/share/man --bindir=/usr/gcc/4.5/bin --libdir=/usr/gcc/4.5/lib --sbindir=/usr/gcc/4.5/sbin --infodir=/usr/gcc/4.5/share/info --libexecdir=/usr/gcc/4.5/lib --enable-languages=c,c++,fortran,objc --enable-shared --with-gmp-include=/usr/include/gmp --with-mpfr-include=/usr/include/mpfr --without-gnu-ld --with-ld=/usr/bin/ld --with-gnu-as --with-as=/usr/gnu/bin/as CFLAGS='-g -O2 '
Thread model: posix
gcc version 4.5.2 (GCC)

So in this file I commented out the troubled line unconditionally. May be it's worth testing on other gcc versions.
In other files I've added platfom-specific tweaks (as I understand them).

@ariya
Copy link
Owner Author

ariya commented Apr 16, 2013

Looks like the patch is rather minimalistic. I'd give it a try on Linux and see if it still builds there.

@ghost
Copy link

ghost commented Apr 22, 2013

Hmm well I have the following - http://pastebin.com/E3jZSkAT.

Build "works" but something is defo not right.

@ghost
Copy link

ghost commented Apr 22, 2013

More pain http://pastebin.com/DkSyvjT0

@drook
Copy link

drook commented Apr 23, 2013

What Solaris is this ? So you just launch the binary and it crashes ?
Wanna try mine - http://files2.enaza.ru/phantomjs-1.9.0-sunos-x64.tar.bz2 ?

@ghost
Copy link

ghost commented Apr 23, 2013

That works lovely for me - you built for 32bit I see. I'm using SmartOS here (Illumos deriv). @drook if you've got the time I wouldn't mind a quick Skype or IRC with you to clear some things up that I maybe doing wrong in my build?

@drook
Copy link

drook commented Apr 23, 2013

Yeah, I didn't manage to set the build architecture properly, and using CFLAGS only the build crashes somewhere in the assembler stuff (obviously because of the wrong arch). Since this is only a static binary I decided that 32-bit binary would be just fine for a start.

Yeah, I will be glad to help - skype://tookie-lookie or irc://drook@RusNet.

@kigster
Copy link

kigster commented Apr 24, 2013

+1 on SmartOS. Watching this thread, would love phantomjs to build on SmartOS. We are running a bunch of Ubuntu instances just for phantomjs. Thanks for all the hard work! :)

@drook
Copy link

drook commented Apr 24, 2013

Did try to build native SmartOS 32-bit binary using the provided patch ? Without any additional CFLAGS/LDFLAGS in the environment.

@kigster
Copy link

kigster commented Apr 24, 2013

We run on 64bit OS images across the board. Would 32-bit binary work there?

@drook
Copy link

drook commented Apr 24, 2013

Well.. it does on native Solaris, don't know about SmartOS.
At least this doesn't require any additional intervention or configuration on native Solaris.
Since SmartOS was initially created from a fork I think same rules apply to it.
It's worth giving a try at least. Khushil (two posts above) reported that my 32-bit binary from Solaris does work for him, so I think it will be working for you too, but it's more interesting being able to create binaries independently, right ?

@ghost
Copy link

ghost commented Apr 24, 2013

Absolutely works for me (many thanks drook).

I do want to build a 64 bit binary and put it into PKGSRC though and
hopefully anyone on Joyent will then be able to pkgin install it :-)


W. A. Khushil Dep - khushil.dep@gmail.com - 07905 374 843
High Performance Web Platforms Architect & Engineer
@ http://www.facebook.com/GlobalOverlordkhushil

On 24 April 2013 08:48, drook notifications@github.com wrote:

Well.. it does on native Solaris, don't know about SmartOS.
At least this doesn't require any additional intervention or configuration
on native Solaris.
Since SmartOS was initially created from a fork I think same rules apply
to it.
It's worth giving a try at least. Khushil (two posts above) reported that
my 32-bit binary from Solaris does work for him, so I think it will be
working for you too, but it's more interesting being able to create
binaries independently, right ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/10521#issuecomment-16912425
.

@sax
Copy link

sax commented Apr 26, 2013

32bit binary should work on SmartOS, but 64bit would be better (if possible). If you can't get it to compile 64bit I can dig up from environment variable settings that worked for a different 64bit compile, buried somewhere in our chef cookbooks.

@georgesnelling
Copy link

+1 for 64-bit SmartOS.

@wkonkel
Copy link

wkonkel commented Apr 30, 2013

I've just created a $25 bounty for this issue: https://www.bountysource.com/#issues/302363-support-solaris-and-also-joyent-smartos

Specifically, I run into a problem when running "npm install" on SmartOS:

npm http GET https://registry.npmjs.org/wordwrap
Unexpected platform or architecture: sunos ia32
npm ERR! phantomjs@1.9.0-3 install: node install.js
npm ERR! sh "-c" "node install.js" failed with 1
npm ERR!
npm ERR! Failed at the phantomjs@1.9.0-3 install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.

npm ERR! System SunOS 5.11
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /opt/jenkins/jobs/scope.js/workspace
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE

@spark-jaspersoft
Copy link

It turned out I commented out the -grc option while I was waiting for my sysadmin to install it and forgot to uncomment it afterward. Now I can run phantomjs, but I'm getting System Bus errors on all but the most trivial of JavaScript files. I got a whole bunch of cast and widening warnings during both the QT and PhantomJS build. It seems the developers are assuming folks will be using Intel architecture, which is a lot more forgiving of this sort of thing than SPARC is. I'm abandoning my effort for now, but I hope this will serve as a warning in case others attempt this.

@santeriv
Copy link

I tried bundling the app with http://pkgsrc.joyent.com/packages/SmartOS/2013Q3/multiarch/All/ phantomjs-1.9.1.tgz , location mentioned before by @arlolra , in a SmartOS environment. And it ended on

/opt/local/lib/libfreetype.so.6: wrong ELF class: ELFCLASS64

Was I missing something? libfreetype.so.6 points 'different' architecture(x86) than used for building phantomjs (x64)?

@drook
Copy link

drook commented Dec 26, 2013

Looks so. You need to get somewhere or build yourself a 32-bit freetype library and put it in the linker path with crle (or whatever SmartOS uses to). However, "multiarch" may also mean it's supposed to build fine on x64 and you have problem somewhere else.

@mamash
Copy link

mamash commented Dec 26, 2013

The multiarch packages contain both 32-bit and 64-bit binaries, or just 32-bit ones (where 64-bit doesn't make sense, or doesn't work at all - as in the case here). If we managed to make phantomjs build 64-bit on SunOS, we would've obviously posted it here for upstream merge.

The multiarch packages will only work within the multiarch VMs, or theoretically in a 32-bit one (if you don't care about the added 64-bit binaries).

F.

    1. 2013 v 4:28, Santeri Vesalainen notifications@github.com:

I tried bundling the app with http://pkgsrc.joyent.com/packages/SmartOS/2013Q3/multiarch/All/ phantomjs-1.9.1.tgz , location mentioned before by @arlolra , in a SmartOS environment. And it ended on

/opt/local/lib/libfreetype.so.6: wrong ELF class: ELFCLASS64
Was I missing something? libfreetype.so.6 points 'different' architecture(x86) than used for building phantomjs (x64)?


Reply to this email directly or view it on GitHub.

@davefinster
Copy link

@drook I'm currently working on a static build ok wkhtmltopdf on SmartOS 64-bit and I've got everything going except I'm seeing the exact same font issue that your seeing. You mentioned that you enabled TTF support for QtWebKit - what changes were involved in that?

@drook
Copy link

drook commented Jun 22, 2014

@davefinster Well, the fontconfig support is already enabled, you just need to configure the fontconfig itself - this means that you need to take a decent fontconfig config file (with all of the ugliness disabled) and add some common TTF fonts. Fonts can be taken from any Windows machine, for example; and the fontconfig can be taken from any Linux/Unix machine that has X enabled and running and which output you dislike the less. The whole process is covered widely in the Internet, take any howto you like. Something like google://ttf and antialised fonts on linux. For example you can take this how-to: http://www.freebsd.org/doc/handbook/x-fonts.html . Without this, you are probably seeing the picture rendered with defaults, and defaults are always ugly.

@davefinster
Copy link

@drook Thanks for the reply - ended up being the complete absence of fonts :)

Managed to get past it and I've got a working wkhtmltopdf on 64-bit SmartOS without seg faults in part thanks to your patches, particularly the system malloc one.

@kigster
Copy link

kigster commented Jun 23, 2014

@davefinster Is there a version available somewhere that can be downloaded and compiled on SmartOS base64? I would appreciate if you could point me to the sources.

@davefinster
Copy link

@kigster For wkhtmltopdf, I put the static binary link here: https://groups.google.com/forum/#!topic/wkhtmltopdf-general/AIagbMp-FJw

There is a link to the Github issue about SmartOs support, which has a link to a gist that shows my steps to compile Qt.

@mamash
Copy link

mamash commented Jun 23, 2014

Thanks, guys. I'm out for vacation this week, but will revisit next week and see if I can integrate your effort into the pkgsrc packages for both phantomjs and wkhtmltopdf, so that we can generate official 64bit SmartOS packages via pkgsrc.

@jeffchan
Copy link

@mamash any updates on the 64bit SmartOS package?

@mamash
Copy link

mamash commented Jul 13, 2014

No, as soon as I saw the progress over at wkhtmltopdf, I knew they have no relevance in the case here, so 64bit SunOS package remains as broken as before - the JS engine fails to load up at all. Unfortunately I lack time to dig deep into this.

It's obvious though that it's something phantomjs specific; I was able to make wkhtmltopdf packages available in the recent Joyent repositories (2014Q1, 2014Q2), both as 32- and 64-bit. So at least there's that.

@missing1984
Copy link

Is there any update for this case? Will phantomjs 2.0 support Solaris?

@mamash
Copy link

mamash commented Dec 17, 2014

I have been trying to build 64bitPhantomjs from trunk on SmartOS recently, and right now it just doesn't work. Qt5 needs some patching to build at all and the resulting phantomjs binary just segfaults when I invoke it.

@mamash
Copy link

mamash commented Jan 15, 2015

Here's a purely static 32bit binary built on SmartOS. I can keep maintaining this for coming 1.9.x releases too. Wonder if we can have this included as a download option on the official site.

https://us-east.manta.joyent.com/pkgsrc/public/packages/SmartOS/phantomjs/phantomjs-1.9.8-smartos-i386.tgz

@JDougherty
Copy link

mamash- do you have up to date build instructions for 1.9.x? What dependencies must be installed, and does the PhantomJS source need to be patched as discussed above?

I appreciate the help!

@mamash
Copy link

mamash commented Feb 19, 2015

Joseph, please have a look at the pkgsrc recipe here:

https://github.com/joyent/pkgsrc-wip/tree/master/phantomjs

as that's how we build the package. The static version is slightly different (not by much):

https://github.com/joyent/pkgsrc-joyent/tree/master/phantomjs-static

It's full of pkgsrc mark-up, the dependencies and patches can be inspected clearly though.

@joelclipperton
Copy link

Has anyone figured out the issue with compiling on 64bit SmartOS images?

@arunnalla16
Copy link

I am trying to compile phantomjs 1.9.2 from source. When I start building it, I encounter missing header files errors. eg: wayland-client.h etc., Can any one point me to complete bundle of phantomjs 1.9.2 source code where all the header files are in place.
Link to the source code I downloaded:https://github.com/ariya/phantomjs/archive/1.9.2.tar.gz

@ghost ghost removed this from the FutureRelease milestone Jan 10, 2018
@ariya
Copy link
Owner Author

ariya commented Mar 4, 2018

Due to limited resources, I think realistically we will never support other operating systems beyond the usual consumer ones (Windows, macOS, Linux) unless there is a significant help coming our way.

We will close this for now. If there is a new update on the subject, let's have it reopened again.
Thank you!

@ariya ariya closed this as completed Mar 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests