Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Does not work on OSX 12.1 #324

Closed
chrishough opened this issue Jan 11, 2022 · 6 comments
Closed

Does not work on OSX 12.1 #324

chrishough opened this issue Jan 11, 2022 · 6 comments

Comments

@chrishough
Copy link

When trying to run gem install libv8 -- --with-system-v8... Please help

Fetching: libv8-8.4.255.0.gem (100%)
Building native extensions with: '--with-system-v8'
This could take a while...
ERROR:  Error installing libv8:
	ERROR: Failed to build gem native extension.

    current directory: /Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/ext/libv8
/Users/christopherhough/.rbenv/versions/2.5.7/bin/ruby -r ./siteconf20220111-11016-7eefkj.rb extconf.rb --with-system-v8
creating Makefile
WARNING: Your metrics.cfg file was invalid or nonexistent. A new one will be created.

________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/v8/v8.git /Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/vendor/_gclient_v8_mrhirwm0' in '/Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/vendor'
Cloning into '/Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/vendor/_gclient_v8_mrhirwm0'...
remote: Finding sources: 100% (15/15)           ting objects: 1
remote: Total 895578 (delta 758391), reused 895576 (delta 758391)
Receiving objects: 100% (895578/895578), 703.68 MiB | 32.97 MiB/s, done.
Resolving deltas: 100% (758391/758391), done.
[0:01:15] Still working on:
[0:01:15]   v8
________ running 'vpython third_party/depot_tools/update_depot_tools_toggle.py --disable' in '/Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/vendor'
/Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/vendor/depot_tools/.cipd_bin/vpython: could not resolve options: failed to resolve Python script: stat /Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/vendor/third_party/depot_tools/update_depot_tools_toggle.py: no such file or directory
Error: Command 'vpython third_party/depot_tools/update_depot_tools_toggle.py --disable' returned non-zero exit status 1 in /Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/vendor
Running: gclient root
Running: gclient config --spec 'solutions = [
  {
    "name": "v8",
    "url": "https://chromium.googlesource.com/v8/v8.git",
    "deps_file": "DEPS",
    "managed": False,
    "custom_deps": {},
  },
]
'
Running: gclient sync --with_branch_heads
Subprocess failed with return code 2.
/Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/ext/libv8/builder.rb:83:in `block in setup_build_deps!': unable to fetch v8 source (RuntimeError)
	from /Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/ext/libv8/builder.rb:81:in `chdir'
	from /Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/ext/libv8/builder.rb:81:in `setup_build_deps!'
	from /Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/ext/libv8/builder.rb:40:in `build_libv8!'
	from /Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0/ext/libv8/location.rb:24:in `install!'
	from extconf.rb:7:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-8.4.255.0 for inspection.
Results logged to /Users/christopherhough/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-21/2.5.0/libv8-8.4.255.0/gem_make.out```
@gnumarcelo
Copy link

I made it work (for OSX 12.0.1) by updating mini_racer to 0.5.0 and then: bundle update libv8 mini_racer. Not ideal but it worked.

@Linell
Copy link

Linell commented Jan 19, 2022

I'm experiencing the same issue and ☝️ @gnumarcelo's solution works for me as well

@adi-pen
Copy link

adi-pen commented Feb 4, 2022

TL;DR: Follow the above comment and bump to 0.5.0.

The vendored deptools part of libv8-8.4.255.0 are not working on Darwin Kernel Version 21.2.0 and RELEASE_X86_64 running macOS Monterey.

I tried upgrading the git submodule of deptools in libv8-8.4.255.0 to see if a git subodule update can fix the issue but it still failed to build v8-8.4.255. This is due to a dependency in v8 on the xcode tools. The SDKs available under macOS Monterey do not have MacOSX10 or lower SDKs that this version of v8 looks for when installing on Mac.

This is the output I see on my local xcode installation.

$ ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
MacOSX.sdk	MacOSX12.1.sdk

The only way I got the rake task to work is by bumping the version of this gem locally and updating the git submodule to build a newer v8 version which is not an acceptable solution for the issue. See diff.

@mjacobsz
Copy link

mjacobsz commented May 14, 2023

Same problem here. The workaround mentioned by @gnumarcelo works, but is not an acceptable solution imho
(I am on osx 13.3, darwin 22)

@jade-zhen
Copy link

Same problem here. The workaround mentioned by @gnumarcelo works, but is not an acceptable solution imho
(I am on osx 13.3, darwin 22)

Exactly the same problem here on 13.3.1(22E261), had to bump mini_racer to latest version in order to avoid libv8.

    mini_racer (0.6.3)
      libv8-node (~> 16.10.0.0)

libv8-node works well.

@lloeki
Copy link
Contributor

lloeki commented Dec 4, 2023

Our efforts are focused on mini_racer + libv8-node, you should actually upgrade to a mini_racer that uses libv8-node, but if you're stuck it should be easier to hack the constraint here than to fiddle with libv8 and depot_tools. Not that I'd recommend that.

Closing as this will not be solved libv8-side.

@lloeki lloeki closed this as completed Dec 4, 2023
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

7 participants