rubyjs / mini_racer

Minimal embedded v8
MIT License
598 stars 93 forks source link

Alpine linux - symbol not found while launch #63

Closed quolpr closed 7 years ago

quolpr commented 7 years ago

Gem was installed, but when rails is launching I get the error:

LoadError: Error relocating /usr/local/bundle/gems/mini_racer-0.1.12/lib/mini_racer_extension.so: __fprintf_chk: symbol not found - /usr/local/bundle/gems/mini_racer-0.1.12/lib/mini_racer_extension.so
/usr/local/bundle/gems/mini_racer-0.1.12/lib/mini_racer.rb:2:in `require'
/usr/local/bundle/gems/mini_racer-0.1.12/lib/mini_racer.rb:2:in `<top (required)>'
....
quolpr commented 7 years ago

https://github.com/sgerrand/alpine-pkg-glibc/issues/27 is related

ignisf commented 7 years ago

Hello @quolpr, thank you for taking the time to file this issue.

Could you please paste the output of gem env for the system you are experiencing the issue on?

quolpr commented 7 years ago

@ignisf yes, of course:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.12
  - RUBY VERSION: 2.4.1 (2017-03-22 patchlevel 111) [x86_64-linux-musl]
  - INSTALLATION DIRECTORY: /usr/local/bundle
  - USER INSTALLATION DIRECTORY: /root/.gem/ruby/2.4.0
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bundle/bin
  - SPEC CACHE DIRECTORY: /root/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/bundle
     - /root/.gem/ruby/2.4.0
     - /usr/local/lib/ruby/gems/2.4.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--no-document"
     - "update" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/bundle/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
ignisf commented 7 years ago

Ah, I see

  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux

Your error is probably due to rubygems downloading a version of the libv8 gem linked against glibc. Please take a look at the note here for more info: https://github.com/cowboyd/libv8#use-with-different-standard-c-libraries.

You could try to lock the libv8 version to the latest source release and try again. See https://github.com/cowboyd/libv8#source-and-binary-releases for more info.

I'm hoping that at some point there will be a mechanism for us to provide musl-linked binaries :(. Unfortunately at this point rubygems has no such feature.

quolpr commented 7 years ago

Wow, thank you! I think your solution will work, but I can't test it :(. We took Debian-slim instead and everything work fine. When I will use alpine - I will test it.

Big thanks!

ignisf commented 7 years ago

Closing this for now as it is in essence not a bug in mini_racer :)