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

7.3.492.27.1 does not build on FreeBSD 12.1 #291

Closed
spagu opened this issue Feb 19, 2020 · 13 comments
Closed

7.3.492.27.1 does not build on FreeBSD 12.1 #291

spagu opened this issue Feb 19, 2020 · 13 comments

Comments

@spagu
Copy link

spagu commented Feb 19, 2020

gem install libv8 -v '7.3.492.27.1' --source 'https://rubygems.org/'

Traceback (most recent call last):
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/metrics.py", line 266, in print_notice_and_exit
yield
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/gclient.py", line 3155, in
sys.exit(main(sys.argv[1:]))
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/gclient.py", line 3141, in main
return dispatcher.execute(OptionParser(), argv)
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/subcommand.py", line 252, in execute
return command(parser, args[1:])
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/gclient.py", line 2699, in CMDsync
ret = client.RunOnDeps('update', args)
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/gclient.py", line 1734, in RunOnDeps
patch_refs=patch_refs, target_branches=target_branches)
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/gclient_utils.py", line 894, in flush
reraise(e[0], e[1], e[2])
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/gclient_utils.py", line 971, in run
self.item.run(*self.args, **self.kwargs)
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/gclient.py", line 937, in run
self.ParseDepsFile()
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/gclient.py", line 697, in ParseDepsFile
filepath, self.get_vars(), self.get_builtin_vars())
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/gclient.py", line 1241, in get_vars
parent_vars = self.parent.get_vars()
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/gclient.py", line 1244, in get_vars
result.update(self.get_builtin_vars())
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/gclient.py", line 1217, in get_builtin_vars
'host_os': _detect_host_os(),
File "/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/vendor/depot_tools/gclient.py", line 1259, in _detect_host_os
return _PLATFORM_MAPPING[sys.platform]
KeyError: 'freebsd12'
Running: gclient root
Running: gclient config --spec 'solutions = [
{
"url": "https://chromium.googlesource.com/v8/v8.git",
"managed": False,
"name": "v8",
"deps_file": "DEPS",
"custom_deps": {},
},
]
Running: gclient sync --with_branch_heads
Subprocess failed with return code 1.
/usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/ext/libv8/builder.rb:83:in block in setup_build_deps!': unable to fetch v8 source (RuntimeError) from /usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/ext/libv8/builder.rb:81:in chdir'
from /usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/ext/libv8/builder.rb:81:in setup_build_deps!' from /usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/ext/libv8/builder.rb:40:in build_libv8!'
from /usr/local/lib/ruby/gems/2.6/gems/libv8-7.3.492.27.1/ext/libv8/location.rb:24:in install!' from extconf.rb:7:in

'
extconf failed, exit code 1

How to solve?

@runlevel5
Copy link
Contributor

@spagu I don't think it is supported. I reckon it is possible to compile v8 and build your own gem on FreeBSD. You could look into my approach https://github.com/runlevel5/v8-ppc64le and adapt that for FreeBSD.

@nightpool
Copy link
Collaborator

Since this gem is a packaging of upstream v8 for Ruby, I'm not sure how in-scope it is for us to support operating systems that v8 itself doesn't support. If we wanted to go down this route, I think it makes more sense to support freebsd by reintroducing the with-system-v8 option (either here or in downstream packages like mini_racer)

@runlevel5
Copy link
Contributor

@nightpool such a pain in the neck to get v8 compile for non-supported platform. Sometimes I wonder if moving to other JS engine is a better choice

@lloeki
Copy link
Contributor

lloeki commented Aug 11, 2020

@runlevel5 we attempted use of nodejs’s vendored libv8, which made things somewhat easier (see discussion at #289)

@dlangille
Copy link

Recent release are no better on FreeBSD 12.1

# gem install libv8
Fetching libv8-8.4.255.0.gem
Building native extensions. This could take a while...
ERROR:  Error installing libv8:
	ERROR: Failed to build gem native extension.

    current directory: /usr/local/lib/ruby/gems/2.6/gems/libv8-8.4.255.0/ext/libv8
/usr/local/bin/ruby26 -I /usr/local/lib/ruby/site_ruby/2.6 -r ./siteconf20201019-64496-1qi22yi.rb extconf.rb
creating Makefile
/usr/local/lib/ruby/gems/2.6/gems/libv8-8.4.255.0/ext/libv8/builder.rb:57:in `setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently 3.7.9 (RuntimeError)
	from /usr/local/lib/ruby/gems/2.6/gems/libv8-8.4.255.0/ext/libv8/builder.rb:39:in `build_libv8!'
	from /usr/local/lib/ruby/gems/2.6/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 /usr/local/lib/ruby/gems/2.6/gems/libv8-8.4.255.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.6/extensions/amd64-freebsd-12/2.6/libv8-8.4.255.0/gem_make.out
# 

@marlinpierce
Copy link

Our solution was to switch to node. This was said by lloeki above, but I am restating it to make this solution stand out.

Here is the Freshports link to the node package https://www.freshports.org/www/node/

Remove any of these you have in your Gemfile: libv8, therubyracer, mini_racer and anything with a dependency on libv8. Install node on your server (not just used to precompile assets).

@marlinpierce
Copy link

@nightpool The V8 library is supported with recent versions for FreeBSD. Here is the Frestports link https://www.freshports.org/lang/v8/

So I don't think it is a reasonable position that the libv8 gem is unnecessary because V8 is not available for FreeBSD.

@marlinpierce
Copy link

I thought I saw a comment critical of non-support for FreeBSD based on how beloved that OS is. In that regard this is open source so enthusiasm for a platform may translate to behove that belover to do the work to support this gem on FreeBSD.

@lloeki
Copy link
Contributor

lloeki commented Jan 21, 2021

Glad to see some movement that way.

I’m progressively adding more targets to sqreen/libv8-node, including FreeBSD, but we don’t have a direct use case for now, so other targets get more priority (like macOS arm64+arm64e and linux aarch64).

@lloeki
Copy link
Contributor

lloeki commented May 7, 2021

libv8-node doesn't have FreeBSD binaries yet but the ruby platform gem could be able to build and install out of the box.

@lloeki
Copy link
Contributor

lloeki commented Dec 4, 2023

Closing as libv8-node supports that (from source). We can't build binaries as we don't have access to FreeBSD infrastructure. Maybe cross-compilation is an option but that's much better tackled at libv8-node anyway.

@lloeki lloeki closed this as completed Dec 4, 2023
@dlangille
Copy link

Closing as libv8-node supports that (from source). We can't build binaries as we don't have access to FreeBSD infrastructure. Maybe cross-compilation is an option but that's much better tackled at libv8-node anyway.

FreeBSD is very easy to install. I'm sure you can get help with that if you ask here.

@lloeki
Copy link
Contributor

lloeki commented Dec 4, 2023

FreeBSD is very easy to install

Oh I'm very well aware of that, this is not an issue of knowledge or ability but of resources (time, maintenance, integration e.g CI).

Anyway, tracked here: rubyjs/libv8-node#49

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants