Closed bryanp closed 1 year ago
@lloeki any ideas here?
I wonder if this alpine image for ruby is missing some headers or has them messed up? does this happen in other ruby alpines?
Hmm, it does build on ruby:2.7.3-alpine
but fails on both ruby:3.0.0-alpine
and ruby:3.0.1-alpine
.
Yes, something changed ever since ruby:3.0.0-preview1, I'm not sure what as I could only have a cursory look.
I'll see to dig a bit in the coming days.
I think that might be the core of it, there's some mixup between C and C++:
/usr/local/include/ruby-3.0.0/ruby/internal/memory.h:275:16: error: conflicting declaration of 'void* ruby_nonempty_memcpy(void*, const void*, size_t)' with 'C' linkage
275 | #define memcpy ruby_nonempty_memcpy
| ^~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-3.0.0/ruby/internal/memory.h:265:1: note: previous declaration with 'C++' linkage
265 | ruby_nonempty_memcpy(void *dest, const void *src, size_t n)
| ^~~~~~~~~~~~~~~~~~~~
I could swear I already handled a similar issue but have no recollection how.
Some progress: using clang and a little bit of prodding has it building on ruby:3.0-alpine
:
diff --git a/Dockerfile b/Dockerfile
index 208d733..ef86d91 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,6 +13,10 @@ COPY lib/mini_racer/version.rb /code/lib/mini_racer/version.rb
WORKDIR /code
RUN bundle install
+RUN apk add clang
+ENV CC=clang
+ENV CXX=clang++
+
COPY Rakefile /code/
COPY ext /code/ext/
RUN bundle exec rake compile
diff --git a/ext/mini_racer_extension/extconf.rb b/ext/mini_racer_extension/extconf.rb
index 7881f20..8ae252d 100644
--- a/ext/mini_racer_extension/extconf.rb
+++ b/ext/mini_racer_extension/extconf.rb
@@ -29,6 +29,10 @@ if ENV['CXX']
CONFIG['CXX'] = ENV['CXX']
end
+$CPPFLAGS += " -fdeclspec" if CONFIG['CXX'] =~ /clang/
+
CXX11_TEST = <<EOS
#if __cplusplus <= 199711L
# error A compiler that supports at least C++11 is required in order to compile this project.
docker build --build-arg RUBY_VERSION=3.0-alpine -t mini_racer:3.0-alpine .
docker run --rm -it mini_racer:3.0-alpine bundle exec rake test
But then it strangely fails on a locale test:
1) Failure:
MiniRacerTest#test_locale [/code/test/mini_racer_test.rb:14]:
Expected: "28/4/2021"
Actual: "7/5/2021"
84 runs, 140 assertions, 1 failures, 0 errors, 2 skips
FWIW I have that same failing test in my local development environment (macos):
MiniRacerTest#test_locale [/Users/bryanp/Code/OSS/mini_racer/test/mini_racer_test.rb:14]:
Expected: "28/4/2021"
Actual: "7/5/2021"
The test was introduced here with a hardcoded date string:
I opened https://github.com/rubyjs/mini_racer/pull/200 to fix it.
Good catch, thanks @bryanp.
OK, so a workaround would be to install and use clang:
apk add --no-cache build-base clang
export CC=clang
export CXX=clang++
gem install mini_racer
... if it were not for the required -fdeclspec
or -fms-extensions
flags which need some patching of extconf.rb
:
diff --git a/ext/mini_racer_extension/extconf.rb b/ext/mini_racer_extension/extconf.rb
index 7881f20..8ae252d 100644
--- a/ext/mini_racer_extension/extconf.rb
+++ b/ext/mini_racer_extension/extconf.rb
@@ -29,6 +29,10 @@ if ENV['CXX']
CONFIG['CXX'] = ENV['CXX']
end
+puts "CXX: #{CONFIG['CXX']}"
+
+$CPPFLAGS += " -fdeclspec" if CONFIG['CXX'] =~ /clang/
+
CXX11_TEST = <<EOS
#if __cplusplus <= 199711L
# error A compiler that supports at least C++11 is required in order to compile this project.
Do we need platform-specific configuration in extconf.rb
? Pardon my lack of knowledge here, I've not dealt with this before.
I used the suggestions here and was able to get it working with a patch. My Dockerfile:
...
RUN apk -U add --no-cache build-base clang \
&& rm -rf /var/cache/apk/*
ENV CC=clang
ENV CXX=clang++
RUN gem install 'specific_install'
RUN gem specific_install -l "https://github.com/sagarjauhari/mini_racer"
...
So confirming that the suggestions are working.
Confirmed that @sagarjauhari works for me as well.
@lloeki @SamSaffron Can we make changes to extconf.rb
to make this process easier for users, or should I just add some notes to the README about how to use mini_racer
in alpine?
It would be better to make changes so that it works out of the box. I'll see to it.
So, I looked into an implementation, and to have the widest support possible and good feedback for the user I'm going to introduce a bit of compiler, feature, and version checking (that CXX11_TEST is a bit outdated and limited in scope). I think the README is due for some informative updates as well.
Might take a bit of time to get this right, but everyone will end up happier.
Just got into the same problem.
I can confirm that clang
+ CC
+ CXX
+ extconf.rb
patch solves the issue, but it breaks byebug
native extensions compilation under the same circumstances, unfortunately. And byebug
is a default gem for rails
apps. I know that ruby 3.0 is not fully supported by byebug
itself, but still.
So after experimenting a bit I figured out that clang
+ setting CXX=clang++
in the Dockerfile + patching extconf.rb
is enough and it does not brake byebug
. Maybe this will be helpful for someone :)
FYI, it's known upstream in Ruby and a PR is open.
Thanks @nogweii, then since it's going to be fixed upstream shortly-ish (the PR is approved) it doesn't make sense to hack anything in here.
@bryanp Would you be in to add a note to the README regarding this Ruby 3.x Alpine issue?
I tried this again now that Ruby 3.1 is out but hit a new issue, this time in mini_racer
instead of libv8-node
:
$ docker build .
[+] Building 4.0s (6/6) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 129B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ruby:3.1-alpine 0.2s
=> [1/3] FROM docker.io/library/ruby:3.1-alpine@sha256:0602d61c893480f4cd05c1941459e371e2d30ff82203fd3dabaaf2358f301894 0.0s
=> CACHED [2/3] RUN apk update && apk upgrade && apk add --no-cache build-base && gem update --system && gem install bundler 0.0s
=> ERROR [3/3] RUN gem install mini_racer -v 0.5.0 3.7s
------
> [3/3] RUN gem install mini_racer -v 0.5.0:
#6 2.323 Successfully installed libv8-node-16.10.0.0-aarch64-linux
#6 2.323 Building native extensions. This could take a while...
#6 3.592 ERROR: Error installing mini_racer:
#6 3.592 ERROR: Failed to build gem native extension.
#6 3.592
#6 3.592 current directory: /usr/local/bundle/gems/mini_racer-0.5.0/ext/mini_racer_extension
#6 3.592 /usr/local/bin/ruby -I /usr/local/lib/ruby/site_ruby/3.1.0 -r ./siteconf20211230-1-bfat0i.rb extconf.rb
#6 3.592 checking for -lpthread... yes
#6 3.592 creating Makefile
#6 3.592
#6 3.592 current directory: /usr/local/bundle/gems/mini_racer-0.5.0/ext/mini_racer_extension
#6 3.592 make DESTDIR\= clean
#6 3.592
#6 3.592 current directory: /usr/local/bundle/gems/mini_racer-0.5.0/ext/mini_racer_extension
#6 3.592 make DESTDIR\=
#6 3.592 compiling mini_racer_extension.cc
#6 3.592 mini_racer_extension.cc: In function 'void* gvl_ruby_callback(void*)':
#6 3.592 mini_racer_extension.cc:1246:42: warning: 'void rb_gc_force_recycle(VALUE)' is deprecated: this is now a no-op function [-Wdeprecated-declarations]
#6 3.592 1246 | rb_gc_force_recycle(ruby_args);
#6 3.592 | ^
#6 3.592 In file included from /usr/local/include/ruby-3.1.0/ruby/intern.h:39,
#6 3.592 from /usr/local/include/ruby-3.1.0/ruby/ruby.h:192,
#6 3.592 from /usr/local/include/ruby-3.1.0/ruby.h:38,
#6 3.592 from mini_racer_extension.cc:2:
#6 3.592 /usr/local/include/ruby-3.1.0/ruby/internal/intern/gc.h:214:6: note: declared here
#6 3.592 214 | void rb_gc_force_recycle(VALUE obj);
#6 3.592 | ^~~~~~~~~~~~~~~~~~~
#6 3.592 mini_racer_extension.cc:1255:92: warning: 'VALUE ruby::backward::cxxanyargs::rb_rescue2(VALUE (*)(...), VALUE, VALUE (*)(...), VALUE, ...)' is deprecated: Use of ANYARGS in this function is deprecated [-Wdeprecated-declarations]
#6 3.592 1255 | RUBY_METHOD_FUNC(rescue_callback), callback_data_value, rb_eException, (VALUE)0);
#6 3.592 | ^
#6 3.592 In file included from /usr/local/include/ruby-3.1.0/ruby/internal/anyargs.h:83,
#6 3.592 from /usr/local/include/ruby-3.1.0/ruby/ruby.h:26,
#6 3.592 from /usr/local/include/ruby-3.1.0/ruby.h:38,
#6 3.592 from mini_racer_extension.cc:2:
#6 3.592 /usr/local/include/ruby-3.1.0/ruby/backward/cxxanyargs.hpp:284:1: note: declared here
#6 3.592 284 | rb_rescue2(type *q, VALUE w, type *e, VALUE r, ...)
#6 3.592 | ^~~~~~~~~~
#6 3.592 mini_racer_extension.cc:1269:38: warning: 'void rb_gc_force_recycle(VALUE)' is deprecated: this is now a no-op function [-Wdeprecated-declarations]
#6 3.592 1269 | rb_gc_force_recycle(ruby_args);
#6 3.592 | ^
#6 3.592 In file included from /usr/local/include/ruby-3.1.0/ruby/intern.h:39,
#6 3.592 from /usr/local/include/ruby-3.1.0/ruby/ruby.h:192,
#6 3.592 from /usr/local/include/ruby-3.1.0/ruby.h:38,
#6 3.592 from mini_racer_extension.cc:2:
#6 3.592 /usr/local/include/ruby-3.1.0/ruby/internal/intern/gc.h:214:6: note: declared here
#6 3.592 214 | void rb_gc_force_recycle(VALUE obj);
#6 3.592 | ^~~~~~~~~~~~~~~~~~~
#6 3.592 linking shared-object mini_racer_extension.so
#6 3.592 g++: error: /usr/local/bundle/gems/libv8-node-16.10.0.0-aarch64-linux/vendor/v8/aarch64-linux-musl/libv8/obj/libv8_monolith.a: No such file or directory
#6 3.592 make: *** [Makefile:263: mini_racer_extension.so] Error 1
#6 3.592
#6 3.592 make failed, exit code 2
#6 3.592
#6 3.592 Gem files will remain installed in /usr/local/bundle/gems/mini_racer-0.5.0 for inspection.
#6 3.592 Results logged to /usr/local/bundle/extensions/aarch64-linux-musl/3.1.0/mini_racer-0.5.0/gem_make.out
------
executor failed running [/bin/sh -c gem install mini_racer -v 0.5.0]: exit code: 1
I have fixes for this committed, will do a new release today
On Fri, 31 Dec 2021 at 3:12 am, Bryan Powell @.***> wrote:
I tried this again now that Ruby 3.1 is out but hit a new issue, this time in mini_racer instead of libv8-node:
$ docker build . [+] Building 4.0s (6/6) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 129B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/ruby:3.1-alpine 0.2s => [1/3] FROM @.***:0602d61c893480f4cd05c1941459e371e2d30ff82203fd3dabaaf2358f301894 0.0s => CACHED [2/3] RUN apk update && apk upgrade && apk add --no-cache build-base && gem update --system && gem install bundler 0.0s => ERROR [3/3] RUN gem install mini_racer -v 0.5.0 3.7s
[3/3] RUN gem install mini_racer -v 0.5.0:
6 2.323 Successfully installed libv8-node-16.10.0.0-aarch64-linux
6 2.323 Building native extensions. This could take a while...
6 3.592 ERROR: Error installing mini_racer:
6 3.592 ERROR: Failed to build gem native extension.
6 3.592
6 3.592 current directory: /usr/local/bundle/gems/mini_racer-0.5.0/ext/mini_racer_extension
6 3.592 /usr/local/bin/ruby -I /usr/local/lib/ruby/site_ruby/3.1.0 -r ./siteconf20211230-1-bfat0i.rb extconf.rb
6 3.592 checking for -lpthread... yes
6 3.592 creating Makefile
6 3.592
6 3.592 current directory: /usr/local/bundle/gems/mini_racer-0.5.0/ext/mini_racer_extension
6 3.592 make DESTDIR\= clean
6 3.592
6 3.592 current directory: /usr/local/bundle/gems/mini_racer-0.5.0/ext/mini_racer_extension
6 3.592 make DESTDIR\=
6 3.592 compiling mini_racer_extension.cc
6 3.592 mini_racer_extension.cc: In function 'void gvl_ruby_callback(void)':
6 3.592 mini_racer_extension.cc:1246:42: warning: 'void rb_gc_force_recycle(VALUE)' is deprecated: this is now a no-op function [-Wdeprecated-declarations]
6 3.592 1246 | rb_gc_force_recycle(ruby_args);
6 3.592 | ^
6 3.592 In file included from /usr/local/include/ruby-3.1.0/ruby/intern.h:39,
6 3.592 from /usr/local/include/ruby-3.1.0/ruby/ruby.h:192,
6 3.592 from /usr/local/include/ruby-3.1.0/ruby.h:38,
6 3.592 from mini_racer_extension.cc:2:
6 3.592 /usr/local/include/ruby-3.1.0/ruby/internal/intern/gc.h:214:6: note: declared here
6 3.592 214 | void rb_gc_force_recycle(VALUE obj);
6 3.592 | ^
~~~~~~6 3.592 mini_racer_extension.cc:1255:92: warning: 'VALUE ruby::backward::cxxanyargs::rb_rescue2(VALUE ()(...), VALUE, VALUE ()(...), VALUE, ...)' is deprecated: Use of ANYARGS in this function is deprecated [-Wdeprecated-declarations]
6 3.592 1255 | RUBY_METHOD_FUNC(rescue_callback), callback_data_value, rb_eException, (VALUE)0);
6 3.592 | ^
6 3.592 In file included from /usr/local/include/ruby-3.1.0/ruby/internal/anyargs.h:83,
6 3.592 from /usr/local/include/ruby-3.1.0/ruby/ruby.h:26,
6 3.592 from /usr/local/include/ruby-3.1.0/ruby.h:38,
6 3.592 from mini_racer_extension.cc:2:
6 3.592 /usr/local/include/ruby-3.1.0/ruby/backward/cxxanyargs.hpp:284:1: note: declared here
6 3.592 284 | rb_rescue2(type q, VALUE w, type e, VALUE r, ...)
6 3.592 | ^
~~~~~6 3.592 mini_racer_extension.cc:1269:38: warning: 'void rb_gc_force_recycle(VALUE)' is deprecated: this is now a no-op function [-Wdeprecated-declarations]
6 3.592 1269 | rb_gc_force_recycle(ruby_args);
6 3.592 | ^
6 3.592 In file included from /usr/local/include/ruby-3.1.0/ruby/intern.h:39,
6 3.592 from /usr/local/include/ruby-3.1.0/ruby/ruby.h:192,
6 3.592 from /usr/local/include/ruby-3.1.0/ruby.h:38,
6 3.592 from mini_racer_extension.cc:2:
6 3.592 /usr/local/include/ruby-3.1.0/ruby/internal/intern/gc.h:214:6: note: declared here
6 3.592 214 | void rb_gc_force_recycle(VALUE obj);
6 3.592 | ^
~~~~~~6 3.592 linking shared-object mini_racer_extension.so
6 3.592 g++: error: /usr/local/bundle/gems/libv8-node-16.10.0.0-aarch64-linux/vendor/v8/aarch64-linux-musl/libv8/obj/libv8_monolith.a: No such file or directory
6 3.592 make: *** [Makefile:263: mini_racer_extension.so] Error 1
6 3.592
6 3.592 make failed, exit code 2
6 3.592
6 3.592 Gem files will remain installed in /usr/local/bundle/gems/mini_racer-0.5.0 for inspection.
6 3.592 Results logged to /usr/local/bundle/extensions/aarch64-linux-musl/3.1.0/mini_racer-0.5.0/gem_make.out
executor failed running [/bin/sh -c gem install mini_racer -v 0.5.0]: exit code: 1
— Reply to this email directly, view it on GitHub https://github.com/rubyjs/mini_racer/issues/199#issuecomment-1003092612, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABIXPWT5BLLPJL2I6FE2LUTSAFLANCNFSM44IFIPZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID: @.***>
Thanks! Tried mini_racer v0.6.0
and it solved the above problem, but still fails:
docker build --no-cache .
[+] Building 11.4s (6/6) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 177B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ruby:3.1-alpine 0.5s
=> CACHED [1/3] FROM docker.io/library/ruby:3.1-alpine@sha256:0602d61c893480f4cd05c1941459e371e2d30ff82203fd3dabaaf2358f301894 0.0s
=> [2/3] RUN apk update && apk upgrade && apk add --no-cache build-base && gem update --system && gem install bundler 7.0s
=> ERROR [3/3] RUN gem install mini_racer -v 0.6.0 3.9s
------
> [3/3] RUN gem install mini_racer -v 0.6.0:
#6 2.422 Successfully installed libv8-node-16.10.0.0-aarch64-linux
#6 2.422 Building native extensions. This could take a while...
#6 3.766 ERROR: Error installing mini_racer:
#6 3.766 ERROR: Failed to build gem native extension.
#6 3.766
#6 3.766 current directory: /usr/local/bundle/gems/mini_racer-0.6.0/ext/mini_racer_extension
#6 3.766 /usr/local/bin/ruby -I /usr/local/lib/ruby/site_ruby/3.1.0 -r ./siteconf20220103-1-4tadug.rb extconf.rb
#6 3.766 checking for -lpthread... yes
#6 3.766 creating Makefile
#6 3.766
#6 3.766 current directory: /usr/local/bundle/gems/mini_racer-0.6.0/ext/mini_racer_extension
#6 3.766 make DESTDIR\= clean
#6 3.766
#6 3.766 current directory: /usr/local/bundle/gems/mini_racer-0.6.0/ext/mini_racer_extension
#6 3.766 make DESTDIR\=
#6 3.766 compiling mini_racer_extension.cc
#6 3.766 linking shared-object mini_racer_extension.so
#6 3.766 g++: error: /usr/local/bundle/gems/libv8-node-16.10.0.0-aarch64-linux/vendor/v8/aarch64-linux-musl/libv8/obj/libv8_monolith.a: No such file or directory
#6 3.766 make: *** [Makefile:263: mini_racer_extension.so] Error 1
#6 3.766
#6 3.766 make failed, exit code 2
#6 3.766
#6 3.766 Gem files will remain installed in /usr/local/bundle/gems/mini_racer-0.6.0 for inspection.
#6 3.766 Results logged to /usr/local/bundle/extensions/aarch64-linux-musl/3.1.0/mini_racer-0.6.0/gem_make.out
------
executor failed running [/bin/sh -c gem install mini_racer -v 0.6.0]: exit code: 1
Here's my Dockerfile
:
FROM ruby:3.1-alpine
RUN apk update && apk upgrade && \
apk add --no-cache build-base && \
gem update --system && gem install bundler
RUN gem install mini_racer -v 0.6.0
I dug around a bit more and found that aarch64-linux
exists but aarch64-linux-musl
does not:
/ # ls /usr/local/bundle/gems/libv8-node-16.10.0.0-aarch64-linux/vendor/v8/
aarch64-linux include
Thinking this might be an issue in how libv8-node
is configuring the makefile (cc @lloeki).
This appears to be working now @bryanp , just tried your dockerfile and it is passing.
@SamSaffron Unfortunately I still receive the same error with the above Dockerfile
, even after bumping to mini_racer 0.6.1
and specifying --no-cache
. I'm using an M1 Mac—could this be explained by a difference between our platforms?
0.6.2 works fine on M1 for me.
Can confirm that 0.6.2 works fine using the above Dockerfile on x86_64-linux-musl
. How did you get this running on aarch64-linux-musl
I'm running into the issue @bryanp mentioned (libv8-node
is not available for this Ruby platform).
Since https://bugs.ruby-lang.org/issues/17788 fixes the issue on Ruby 3.1 I created a backport request for Ruby 3.0 in https://bugs.ruby-lang.org/issues/18574
Just to clarify, @bryanp: Your Dockerfile works fine on x86_64-linux-musl
(Intel).
You have to build libv8-node
from source if you are running on M1/Apple Silicon. There is no pre-build aarch-linux
build available currently for libv8-node
(see https://rubygems.org/gems/libv8-node/versions).
Building libv8-node
from source takes a while (~35min for me) and you'll need to adjust your Dockerfile
to install needed build dependencies. Since there is still an issue (I think this one https://github.com/rubygems/rubygems/pull/4488, /cc @lloeki) which requires you to force the platform (using --platform ruby
). Otherwise Rubygems gets confused and picks up aarch-linux
instead.
Here is the Dockerfile
I used to get mini_racer
running in ruby:3.1-alpine
on Apple M1:
FROM ruby:3.1-alpine
RUN apk update && apk upgrade && \
apk add --no-cache build-base linux-headers bash python2 python3 git curl tar && \
gem update --system && gem install bundler
RUN gem install mini_racer --platform=ruby
…oh and as @Quintasan mentioned https://bugs.ruby-lang.org/issues/17788 needs backporting to Ruby 3.0, so this will currently only work with Ruby 3.1.
FYI: The backport of bugs.ruby-lang.org/issues/17788 landed in the Ruby 3.0 branch via https://github.com/ruby/ruby/commit/2bb5fa495bf9d366d3c1fefc6b093dc4830f27bf
The backport was released in Ruby 3.0.4 (a little hard to find, but it's in https://github.com/ruby/ruby/compare/v3_0_3...v3_0_4).
Its a PITA to test though, as the Ruby alpine images on Docker Hub have been updated past Alpine 3.15 and you need specific versions of Python to build libv8-node as there is no aarch64-linux-musl
for 16.10.0.0
. I -think- with Ruby 3.0.4 (or the latest 3.0.x) this issue should be resolved, if you setup a proper environment to compile libv8-node.
With a hopefully soonish release of new mini_racer versions, this problem will most likely solve itself, as aarch64-linux-musl
builds are available starting with libv8-node > 16.10.0.0.
With mini_racer 0.6.4 released (which uses libv8-node
16.19.0.1) we can finally close this issue 🥳 mini_racer now builds fine with Ruby 3.0, starting with Ruby 3.0.4.
FROM ruby:3.0.4-alpine
RUN apk update && apk upgrade && \
apk add --no-cache build-base linux-headers bash git curl tar && \
gem update --system && gem install bundler
and
# file: minimal.rb
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "mini_racer"
end
require "libv8-node"
puts "RUBY_VERSION : #{RUBY_VERSION}"
puts "RUBY_PLATFORM: #{RUBY_PLATFORM}"
puts "MiniRacer::VERSION: #{MiniRacer::VERSION}"
puts "MiniRacer::LIBV8_NODE_VERSION: #{MiniRacer::LIBV8_NODE_VERSION}"
puts "Libv8::Node::VERSION: #{Libv8::Node::VERSION}"
puts "Libv8::Node::NODE_VERSION: #{Libv8::Node::NODE_VERSION}"
puts "Libv8::Node::LIBV8_VERSION: #{Libv8::Node::LIBV8_VERSION}"
ctx = MiniRacer::Context.new
puts ctx.eval("1+1")
$ docker run --rm -v "$(pwd)":/app -w /app mini_racer_debug ruby /app/minimal.rb
RUBY_VERSION : 3.0.4
RUBY_PLATFORM: aarch64-linux-musl
MiniRacer::VERSION: 0.6.4
MiniRacer::LIBV8_NODE_VERSION: ~> 16.19.0.0
Libv8::Node::VERSION: 16.19.0.1
Libv8::Node::NODE_VERSION: 16.19.0
Libv8::Node::LIBV8_VERSION: 9.4.146.26
2
With https://github.com/rubyjs/mini_racer/pull/186 being included in
v0.4.0
I was hopeful thatmini_racer
would be installable in alpine containers. Unfortunately, it isn't quite working for me. Here's a minimalDockerfile
to demonstrate the issue that I hit:Here's the error: