-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v0.4.0 fails to build on ruby:3.0-alpine #199
Comments
@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 |
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++:
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
But then it strangely fails on a locale test:
|
FWIW I have that same failing test in my local development environment (macos):
The test was introduced here with a hardcoded date string: I opened #200 to fix it. |
Good catch, thanks @bryanp. |
OK, so a workaround would be to install and use clang:
... if it were not for the required
|
Do we need platform-specific configuration in |
Because of rubyjs#199
I used the suggestions here and was able to get it working with a patch. My Dockerfile:
So confirming that the suggestions are working. |
Confirmed that @sagarjauhari works for me as well. @lloeki @SamSaffron Can we make changes to |
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 So after experimenting a bit I figured out that |
FYI, it's known upstream in Ruby and a PR is open. |
I tried this again now that Ruby 3.1 is out but hit a new issue, this time in
|
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
<#199 (comment)>,
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
Here's my 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
Thinking this might be an issue in how |
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 |
0.6.2 works fine on M1 for me. |
Can confirm that 0.6.2 works fine using the above Dockerfile on |
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 You have to build Building Here is the 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 ruby/ruby@2bb5fa4 |
The backport was released in Ruby 3.0.4 (a little hard to find, but it's in ruby/ruby@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 With a hopefully soonish release of new mini_racer versions, this problem will most likely solve itself, as |
With mini_racer 0.6.4 released (which uses 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")
|
With #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:
The text was updated successfully, but these errors were encountered: