Search code examples
ruby-on-railsnode.jssolaristherubyracer

libv8 installation in Solaris 10(SPARC arch, gcc 4.6.3)


just wondering if anyone has successfully install libv8 in Solaris 10(SPARC architecture). I am trying to install a JS runtime(therubyracer) into a Solaris box but failed multiple times. I even tried therubyracer 0.8.2(doesnt require libv8) and alternatively, compiling nodejs from source but no avail. It seems Solaris is not very popular and the related docs are very scarce. I have been stuck on this issue for 2 days so any hint would be much appreciated. This JS runtime is absolutely required for my project.

Cheers


Solution

  • Bad news, v8 is not supported on SPARC.

        $ git clone [email protected]:v8/v8.git
        Cloning into v8...
        remote: Counting objects: 102181, done.
        remote: Compressing objects: 100% (11906/11906), done.
        remote: Total 102181 (delta 90505), reused 101540 (delta 89942)
        Receiving objects: 100% (102181/102181), 50.92 MiB | 274 KiB/s, done.
        Resolving deltas: 100% (90505/90505), done.
        $ grep -i sparc v8/src/*
        v8/src/platform-solaris.cc:#ifdef __sparc
        v8/src/platform-solaris.cc:# error "V8 does not support the SPARC CPU architecture."
        $
    

    I've also been around this loop. Options:

    1. Use an older version of rails (<3.2 at least) that doesn't require a JS runtime.

    2. Turn off all of the precompilation & minification features (with the obvious performance impact).

    3. Migrate to a non-SPARC platform.

    I've done (2) for a small, low traffic app (can post the config if you wish). That works ~okay for my use case but if JS runtime support is a hard requirement for you outside of the native Rails features then clearly neither (1) nor (2) will help.

    I'm planning on (3) as soon as feasible. At this point support for Solaris (and in particular support for Solaris on SPARC) is unlikely to improve.