rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.66k stars 193 forks source link

OSX 10.10 Incompatibility #301

Closed philipithomas closed 10 years ago

philipithomas commented 10 years ago

I'm running into issues with V8 and the gcc version. I will update the issue if i find a workaround.

gdavis commented 10 years ago

We've also got an open issue on libv8 regarding 10.10 compatibility: https://github.com/cowboyd/libv8/issues/123

onlydole commented 10 years ago

Does the resolution here: https://github.com/cowboyd/libv8/issues/123 fix anything?

nicolasblanco commented 10 years ago

Is somebody has a step by step guide to install therubyracer on 10.10? So far:

# Gemfile
gem "libv8", github: 'cowboyd/libv8'
gem "therubyracer", github: 'cowboyd/therubyracer'
# bundle config
11:27  $ bundle config
Settings are listed in order of priority. The top value will be used.
build.libv8
Set for the current user (/Users/nicolas/.bundle/config): "--with-system-v8"
build.therubyracer
Set for the current user (/Users/nicolas/.bundle/config): "--with-system-v8"
Exception:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
    /usr/local/var/rbenv/versions/2.1.2/bin/ruby extconf.rb --with-system-v8
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
Warning! Unable to load libv8 ~> 3.16.14.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/local/var/rbenv/versions/2.1.2/bin/ruby
    --with-pthreadlib
    --without-pthreadlib
    --with-objclib
    --without-objclib
    --enable-debug
    --disable-debug
/usr/local/var/rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- libv8 (LoadError)
    from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from extconf.rb:29:in `
' extconf failed, exit code 1 Gem files will remain installed in /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/therubyracer-8dae8f789014 for inspection. Results logged to /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/extensions/x86_64-darwin-14/2.1.0-static/therubyracer-8dae8f789014/gem_make.out An error occurred while installing therubyracer (0.12.1), and Bundler cannot continue.
apavlyut commented 10 years ago

Any ideas how to fix this?

ignisf commented 10 years ago

@onlydole, @nicolasblanco, the fix for cowboyd/libv8#123 does NOT do anything if you are attempting to use the v8 library from the system (as can be clearly seen from the changes introduced in the PR that fixed it https://github.com/cowboyd/libv8/pull/124/files)

onlydole commented 10 years ago

Is there a set step of procedures to get this to run on a 10.10 machine? I've tried pulling and installing the gem straight from Github and haven't had any success on that note

lazywei commented 10 years ago

I confirm this problem, and I use with system v8 to install libv8.

cowboyd commented 10 years ago

@lazywei If you are using --with-system-v8, then it must also be a compatible version, read: 3.16.14

Also note that I've released a binary gem for 10.10

steamboy commented 10 years ago

@cowboyd, do you have a workaround for therubyracer -v 0.11.3 which is dependent on libv8 -v 3.11.8.17? I'm on rvm 1.9.3

airatdev commented 10 years ago

@steamboy @cowboyd seems like it is currently impossible to make work the following set of tools:

am I missing something? here is errors trace after trying to install therubyracer:

(btw - switching to therubyracer version > 0.12 fixes the problem but I'm interested in having some workaround for 0.11.4 version)

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/airatshigapov/.rbenv/versions/2.0.0-p353/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... yes
creating Makefile

make "DESTDIR="
compiling accessor.cc
clang: warning: argument unused during compilation: '-rdynamic'
In file included from accessor.cc:1:
./rr.h:462:14: error: no type named 'AccessorGetter' in namespace 'v8'
  inline v8::AccessorGetter accessorGetter() {return &AccessorGetter;}
         ~~~~^
./rr.h:463:14: error: no type named 'AccessorSetter' in namespace 'v8'
  inline v8::AccessorSetter accessorSetter() {return RTEST(set) ? &AccessorSetter : 0;}
         ~~~~^
./rr.h:465:14: error: no type named 'NamedPropertyGetter' in namespace 'v8'
  inline v8::NamedPropertyGetter namedPropertyGetter() {return &NamedPropertyGetter;}
         ~~~~^
./rr.h:466:14: error: no type named 'NamedPropertySetter' in namespace 'v8'
  inline v8::NamedPropertySetter namedPropertySetter() {return RTEST(set) ? &NamedPropertySetter : 0;}
         ~~~~^
./rr.h:467:14: error: no type named 'NamedPropertyQuery' in namespace 'v8'
  inline v8::NamedPropertyQuery namedPropertyQuery() {return RTEST(query) ? &NamedPropertyQuery : 0;}
         ~~~~^
./rr.h:468:14: error: no type named 'NamedPropertyDeleter' in namespace 'v8'
  inline v8::NamedPropertyDeleter namedPropertyDeleter() {return RTEST(deleter) ? &NamedPropertyDeleter : 0;}
         ~~~~^
./rr.h:469:14: error: no type named 'NamedPropertyEnumerator' in namespace 'v8'
  inline v8::NamedPropertyEnumerator namedPropertyEnumerator() {return RTEST(enumerator) ? &NamedPropertyEnumerator : 0;}
         ~~~~^
./rr.h:471:14: error: no type named 'IndexedPropertyGetter' in namespace 'v8'
  inline v8::IndexedPropertyGetter indexedPropertyGetter() {return &IndexedPropertyGetter;}
         ~~~~^
./rr.h:472:14: error: no type named 'IndexedPropertySetter' in namespace 'v8'
  inline v8::IndexedPropertySetter indexedPropertySetter() {return RTEST(set) ? &IndexedPropertySetter : 0;}
         ~~~~^
./rr.h:473:14: error: no type named 'IndexedPropertyQuery' in namespace 'v8'
  inline v8::IndexedPropertyQuery indexedPropertyQuery() {return RTEST(query) ? &IndexedPropertyQuery : 0;}
         ~~~~^
./rr.h:474:14: error: no type named 'IndexedPropertyDeleter' in namespace 'v8'
  inline v8::IndexedPropertyDeleter indexedPropertyDeleter() {return RTEST(deleter) ? &IndexedPropertyDeleter : 0;}
         ~~~~^
./rr.h:475:14: error: no type named 'IndexedPropertyEnumerator' in namespace 'v8'
  inline v8::IndexedPropertyEnumerator indexedPropertyEnumerator() {return RTEST(enumerator) ? &IndexedPropertyEnumerator : 0;}
         ~~~~^
./rr.h:481:16: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
    Info(const v8::AccessorInfo& info);
               ^~~~~~~~~~~~~~~~
               Accessor
./rr.h:455:7: note: 'Accessor' declared here
class Accessor {
      ^
./rr.h:487:18: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
    inline const v8::AccessorInfo* operator->() {return this->info;}
                 ^~~~~~~~~~~~~~~~
                 Accessor
./rr.h:455:7: note: 'Accessor' declared here
class Accessor {
      ^
./rr.h:501:11: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
    const v8::AccessorInfo* info;
          ^~~~~~~~~~~~~~~~
          Accessor
./rr.h:455:7: note: 'Accessor' declared here
class Accessor {
      ^
./rr.h:505:85: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
  static v8::Handle<v8::Value> AccessorGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
                                                                                    ^~~~~~~~~~~~~~~~
                                                                                    Accessor
./rr.h:455:7: note: 'Accessor' declared here
class Accessor {
      ^
./rr.h:506:96: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
  static void AccessorSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
                                                                                               ^~~~~~~~~~~~~~~~
                                                                                               Accessor
./rr.h:455:7: note: 'Accessor' declared here
class Accessor {
      ^
./rr.h:508:90: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
  static v8::Handle<v8::Value> NamedPropertyGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
                                                                                         ^~~~~~~~~~~~~~~~
                                                                                         Accessor
./rr.h:455:7: note: 'Accessor' declared here
class Accessor {
      ^
./rr.h:509:118: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
  static v8::Handle<v8::Value> NamedPropertySetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
                                                                                                                     ^~~~~~~~~~~~~~~~
                                                                                                                     Accessor
./rr.h:455:7: note: 'Accessor' declared here
class Accessor {
      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [accessor.o] Error 1

Gem files will remain installed in /Users/airatshigapov/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/therubyracer-0.11.4 for inspection.
Results logged to /Users/airatshigapov/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/therubyracer-0.11.4/ext/v8/gem_make.out
ignisf commented 10 years ago

libv8 3.16 has been patched to compile on newer versions of os x. Patches for the 3.11 branch are welcome.

airatdev commented 10 years ago

@ignisf I finally managed how to fix this and submitted a patch with fix for 3.11 branch, could you kindly look at this PR? https://github.com/cowboyd/libv8/pull/147