Skip to content
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

errbit bundle fails in Arch Linux #1492

Open
vahem2lu opened this issue Mar 10, 2021 · 4 comments
Open

errbit bundle fails in Arch Linux #1492

vahem2lu opened this issue Mar 10, 2021 · 4 comments

Comments

@vahem2lu
Copy link

Errbit version: master
OS: Arch Linux, Ruby 2.5.0 and Ruby 2.7

Step 3: Describe the problem:

bundle install fails with error

  LINK(target) /srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems/libv8-3.16.14.19/vendor/v8/out/x64.release/mksnapshot
ACTION tools_gyp_v8_gyp_v8_snapshot_target_run_mksnapshot
/srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems/libv8-3.16.14.19/vendor/v8/out/x64.release/obj.target/v8_snapshot/geni/snapshot.cc
make[1]: *** [tools/gyp/v8_snapshot.target.x64.mk:13:
/srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems/libv8-3.16.14.19/vendor/v8/out/x64.release/obj.target/v8_snapshot/geni/snapshot.cc] Segmentation fault
(core dumped)
make[1]: Leaving directory '/srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems/libv8-3.16.14.19/vendor/v8/out'
make: *** [Makefile:195: x64.release] Error 2
/srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install
properly, expected binary v8 archive
'/srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems/libv8-3.16.14.19/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_snapshot.a'to exist, but it was
not found (Libv8::Location::Vendor::ArchiveNotFound)
        from /srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:35:in `each'
        from /srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:35:in `verify_installation!'
        from /srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:26:in `install!'
        from extconf.rb:7:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems/libv8-3.16.14.19 for inspection.
Results logged to /srv/errbit/git-errbit/.bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/libv8-3.16.14.19/gem_make.out

An error occurred while installing libv8 (3.16.14.19), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.19' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  therubyracer was resolved to 0.12.3, which depends on
    libv8

I have tried installing therubyracer and libv8 with local install etc.

gem install --no-user-install --install-dir /srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems libv8 -v '3.16.14.19' -- --use-system-libraries
which completes successfully, but seems not to help as after a new bundle install libv8 gets installed again and fails.

Steps to reproduce:

  1. Use Arch Linux
  2. Install Ruby and rubygems from arch/aur (depends on version)
  3. clone errbit
  4. run bundle install
@2called-chaos
Copy link
Member

I have no arch to test but you can set flags for bundle to use while building. Maybe one of these two can help you?

bundle config set build.libv8 --use-system-libraries
or
bundle config set build.libv8 --with-system-v8

and then bundle. Note those config settings are global for your user an are saved in ~/.bundle/config as opposed to <project>/.bundle/config

@vahem2lu
Copy link
Author

That's a good tip, thanks, as this helped to install libv8 gem with bundler.

But now therubyracer fails.
I have tried with v8, v8-3.14 and v8-r from AUR, none of them are working. Not sure if they are correct v8 libraries, though.

/opt/ruby2.5/bin/ruby-2.5 -r ./siteconf20210312-481-1yqkz3y.rb extconf.rb
checking for -lpthread... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/opt/ruby2.5/bin/$(RUBY_BASE_NAME)-2.5
        --with-pthreadlib
        --without-pthreadlib
        --enable-debug
        --disable-debug
        --with-v8-dir
        --without-v8-dir
        --with-v8-include
        --without-v8-include=${v8-dir}/include
        --with-v8-lib
        --without-v8-lib=${v8-dir}/lib
/srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version  (Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with
the libv8 rubygem.

However, your system version of v8 could not be located.

Please make sure your system version of v8 that is compatible
with 3.16.14.19 installed. You may need to use the
--with-v8-dir option if it is installed in a non-standard location
        from /srv/errbit/git-errbit/.bundle/ruby/2.5.0/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
        from extconf.rb:32:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /srv/errbit/git-errbit/.bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/therubyracer-0.12.3/mkmf.log

extconf failed, exit code 1

@espen
Copy link
Contributor

espen commented Mar 13, 2021

I'm having the same issue when deploying to Heroku.

@2called-chaos
Copy link
Member

I guess you don't get updates for issue mentions so if you haven't found a solution yet and are still interested I outlined a solution that potentially also fixes your issue. I might have some time in the coming days to make this solution a PR but for the meantime... #1494 (comment)

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

No branches or pull requests

3 participants