libv8 / therubyracer seg. fault. Doesn't work with musl
v8 error when “bundle exec rake assets:precompile” in
ruby:2.3.1-alpine
https://github.com/docker-library/ruby/issues/113
When I try to install ruby from the package on Alpine 3.7 (Alpine 3.4 has a Ruby 2.4 package prebuilt!) the code to build therubyracer segfaults:
LINK(target) /usr/lib/ruby/gems/2.4.0/gems/libv8-3.16.14.16/vendor/v8/out/x64.release/mksnapshot
ACTION tools_gyp_v8_gyp_v8_snapshot_target_run_mksnapshot /usr/lib/ruby/gems/2.4.0/gems/libv8-3.16.14.16/vendor/v8/out/x64.release/obj.target/v8_snapshot/geni/snapshot.cc
Segmentation fault (core dumped)
make[1]: *** [tools/gyp/v8_snapshot.target.x64.mk:13: /usr/lib/ruby/gems/2.4.0/gems/libv8-3.16.14.16/vendor/v8/out/x64.release/obj.target/v8_snapshot/geni/snapshot.cc] Error 139
make[1]: Leaving directory '/usr/lib/ruby/gems/2.4.0/gems/libv8-3.16.14.16/vendor/v8/out'
make: *** [Makefile:195: x64.release] Error 2
/usr/lib/ruby/gems/2.4.0/gems/libv8-3.16.14.16/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/usr/lib/ruby/gems/2.4.0/gems/libv8-3.16.14.16/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_snapshot.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
from /usr/lib/ruby/gems/2.4.0/gems/libv8-3.16.14.16/ext/libv8/location.rb:35:in `each'
from /usr/lib/ruby/gems/2.4.0/gems/libv8-3.16.14.16/ext/libv8/location.rb:35:in `verify_installation!'
from /usr/lib/ruby/gems/2.4.0/gems/libv8-3.16.14.16/ext/libv8/location.rb:26:in `install!'
from extconf.rb:7:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /usr/lib/ruby/gems/2.4.0/gems/libv8-3.16.14.16 for inspection.
Results logged to /usr/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0/libv8-3.16.14.16/gem_make.out
The command '/bin/sh -c apk add --update --no-cache --virtual build-deps build-base python git bash && gem install libv8 -v 3.16.14.16 && apk del build-deps' returned a non-zero code: 1
This is of course a showstopper for Ruby with libv8/therubyracker that wants to use Alpine. Simply not possible.
Solution
Alpine should make libv8/therubyracer work with musl and package it.
(from redmine: issue id 8445, created on 2018-01-29)