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

Bundle install fails on CircleCI for mini_racer 0.6.0 #227

Closed
chrisalley opened this issue Jan 10, 2022 · 11 comments
Closed

Bundle install fails on CircleCI for mini_racer 0.6.0 #227

chrisalley opened this issue Jan 10, 2022 · 11 comments

Comments

@chrisalley
Copy link

chrisalley commented Jan 10, 2022

When running the bundle install command on CircleCI with mini_racer 0.6.0 in the Gemfile, the build fails. This did not occur with mini_racer 0.3.1. Output:

Installing libv8-node 16.10.0.0 (x86_64-linux-musl)
Fetching mini_racer 0.6.0
Installing mini_racer 0.6.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/circleci/project/vendor/bundle/ruby/3.0.0/gems/mini_racer-0.6.0/ext/mini_racer_extension
/usr/local/bin/ruby -I /usr/local/lib/ruby/3.0.0 -r
./siteconf20220110-93-zv602o.rb extconf.rb
checking for -lpthread... yes
creating Makefile

current directory:
/home/circleci/project/vendor/bundle/ruby/3.0.0/gems/mini_racer-0.6.0/ext/mini_racer_extension
make DESTDIR\= clean

current directory:
/home/circleci/project/vendor/bundle/ruby/3.0.0/gems/mini_racer-0.6.0/ext/mini_racer_extension
make DESTDIR\=
compiling mini_racer_extension.cc
linking shared-object mini_racer_extension.so
g++: error:
/home/circleci/project/vendor/bundle/ruby/3.0.0/gems/libv8-node-16.10.0.0-x86_64-linux-musl/vendor/v8/x86_64-linux/libv8/obj/libv8_monolith.a:
No such file or directory
make: *** [Makefile:262: mini_racer_extension.so] Error 1

make failed, exit code 2

Gem files will remain installed in
/home/circleci/project/vendor/bundle/ruby/3.0.0/gems/mini_racer-0.6.0 for
inspection.
Results logged to
/home/circleci/project/vendor/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/mini_racer-0.6.0/gem_make.out

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

In Gemfile:
  mini_racer

Exited with code exit status 5
CircleCI received exit code 5

@chrisalley chrisalley changed the title Bundle install fails on CircleCI Bundle install fails on CircleCI for mini_racer 0.6.0 Jan 10, 2022
@tisba
Copy link
Collaborator

tisba commented Jan 10, 2022

Just a sanity check: Are you running on alpine?

@chrisalley
Copy link
Author

It's not alpine based; the specific image/tag is ruby:3.0.3.

@tisba
Copy link
Collaborator

tisba commented Jan 10, 2022

This looks very similar to #218

@tisba
Copy link
Collaborator

tisba commented Jan 10, 2022

Installing libv8-node 16.10.0.0 (x86_64-linux-musl)

This looks wrong then, @chrisalley.

@cmoad
Copy link

cmoad commented Jan 13, 2022

Seeing the same issue in GitHub Actions with the latest ruby/setup-ruby@v1.91.0

Error output
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
  
  current directory:
  /home/runner/work/gandalf/gandalf/vendor/bundle/ruby/2.7.0/gems/mini_racer-0.6.1/ext/mini_racer_extension
  /opt/hostedtoolcache/Ruby/2.7.5/x64/bin/ruby -I
  /opt/hostedtoolcache/Ruby/2.7.5/x64/lib/ruby/2.7.0 -r
  ./siteconf20220113-1736-1e9g79d.rb extconf.rb
  checking for -lpthread... yes
  creating Makefile
  
  current directory:
  /home/runner/work/gandalf/gandalf/vendor/bundle/ruby/2.7.0/gems/mini_racer-0.6.1/ext/mini_racer_extension
  make "DESTDIR=" clean
  
  current directory:
  /home/runner/work/gandalf/gandalf/vendor/bundle/ruby/2.7.0/gems/mini_racer-0.6.1/ext/mini_racer_extension
  make "DESTDIR="
  compiling mini_racer_extension.cc
  mini_racer_extension.cc: In function ‘VALUE convert_v8_to_ruby(v8::Isolate*,
  v8::Local<v8::Context>, v8::Local<v8::Value>)’:
  mini_racer_extension.cc:560:18: warning: ‘stackCounter.StackCounter::isolate’
  may be used uninitialized in this function [-Wmaybe-uninitialized]
    560 |     StackCounter stackCounter(isolate);
        |                  ^~~~~~~~~~~~
  linking shared-object mini_racer_extension.so
  g++: error:
  /home/runner/work/gandalf/gandalf/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.10.0.0-x86_64-linux-musl/vendor/v8/x86_64-linux/libv8/obj/libv8_monolith.a:
  No such file or directory
  make: *** [Makefile:262: mini_racer_extension.so] Error 1
  
  make failed, exit code 2
  
  Gem files will remain installed in
  /home/runner/work/gandalf/gandalf/vendor/bundle/ruby/2.7.0/gems/mini_racer-0.6.1
  for inspection.
  Results logged to
  /home/runner/work/gandalf/gandalf/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/mini_racer-0.6.1/gem_make.out
  
  An error occurred while installing mini_racer (0.6.1), and Bundler cannot
  continue.
  Make sure that `gem install mini_racer -v '0.6.1'` succeeds before bundling.
  
  In Gemfile:
    mini_racer

@justinsnair
Copy link

Same issue here with the ruby:3.0.2 image and mini_racer 0.5.0

@mdh
Copy link
Contributor

mdh commented Jan 14, 2022

Fwiw, we were finally able to resolve our issue by updating to latest bundler(2.3.5), as well as specifying platforms in Gemfile.lock. We are still running Ruby 2.7.x.

@tisba
Copy link
Collaborator

tisba commented Jan 17, 2022

If you are running into this issue, please make sure to update bundler (currently 2.3.5) and check if the platform you're running on is properly set in Gemfile.lock (via bundle lock --add-platform aarch64-linux).

mini_racer 0.6.2 should work fine with Ruby 2.6.9, 2.7.5, 3.0.x and 3.1.0 (I tested a lot of those combination across x86 and aarch64 recently). Especially with the recent 0.6.2 the last issues with pre Ruby 3 environments got fixed.

@mdh: awesome 👍
@justinsnair, @cmoad: Could you try with mini_racer 0.6.2?

@chrisalley
Copy link
Author

chrisalley commented Jan 18, 2022

Solved with:

bundle lock --add-platform aarch64-linux
bundle lock --add-platform x86_64-linux

In Gemfile:

gem 'mini_racer', '~> 0.6.2'

In Dockerfile:

FROM ruby:3.0.3
...
RUN gem install bundler --version=2.3.5
RUN bundle install

Only aarch64-linux was required as an added platform for CircleCI to succeed in installing mini_racer, but another gem (ransack) failed to install without x86_64-linux being added also.

@tisba
Copy link
Collaborator

tisba commented Jan 18, 2022

Great! I'm glad this worked out for you, @chrisalley!

Only aarch64-linux was required as an added platform for CircleCI to succeed

Interesting 🤔 Didn't knew that CircleCI has an ARM offering :)

gbp added a commit to mysociety/alaveteli that referenced this issue Jan 21, 2022
Fixes issues installing libv8-node gem on CI.

See: rubyjs/mini_racer#227
gbp added a commit to mysociety/alaveteli that referenced this issue Jan 21, 2022
Fixes issues installing libv8-node gem on CI.

See: rubyjs/mini_racer#227
gbp added a commit to mysociety/alaveteli that referenced this issue Jan 21, 2022
Fixes issues installing libv8-node gem on CI.

See: rubyjs/mini_racer#227
kr8n3r added a commit to alphagov/paas-team-manual that referenced this issue May 11, 2022
kr8n3r added a commit to alphagov/paas-team-manual that referenced this issue May 11, 2022
- update image
  https://discuss.circleci.com/t/legacy-convenience-image-deprecation/41034
- reset bundle cache with updated image
- Set target bundle platforms
  rubyjs/mini_racer#227 (comment)
- force circleCI to install latesr bundler version before building
- update bundler `path` setting to resolved:
[DEPRECATED] The `--path` flag is deprecated because it relies on being
remembered across bundler invocations, which bundler will no longer do
in future versions. Instead please use `bundle config set path
'vendor/bundle'`, and stop using this flag
@vertalm
Copy link

vertalm commented Aug 9, 2022

My point to this issue
gem install libv8-node --version 16.10.0.0 --platform x86_64-linux-libc

yndajas added a commit to UKGovernmentBEIS/beis-report-official-development-assistance that referenced this issue Sep 6, 2022
This fixes `bundle install` issues on ARM-based Macs (e.g. Macs
with M1/M2 chips) by adding `arm64-darwin-21` to the platforms
in Gemfile.lock. It also adds arm64 versions of a few gems, which
were added automatically by bundler after fixing `bundle install`

@see rubyjs/mini_racer#227 (comment)
yndajas added a commit to UKGovernmentBEIS/beis-report-official-development-assistance that referenced this issue Sep 6, 2022
This fixes `bundle install` issues on ARM-based Macs (e.g. Macs
with M1/M2 chips) by adding `arm64-darwin-21` to the platforms
in Gemfile.lock. It also adds arm64 versions of a few gems, which
were added automatically by bundler after fixing `bundle install`

@see rubyjs/mini_racer#227 (comment)
CristinaRO pushed a commit to UKGovernmentBEIS/beis-report-official-development-assistance that referenced this issue Sep 8, 2022
This fixes `bundle install` issues on ARM-based Macs (e.g. Macs
with M1/M2 chips) by adding `arm64-darwin-21` to the platforms
in Gemfile.lock. It also adds arm64 versions of a few gems, which
were added automatically by bundler after fixing `bundle install`

@see rubyjs/mini_racer#227 (comment)
erbridge added a commit to thedatascilab/ScenicOrNot that referenced this issue Sep 15, 2022
This resolves an issue where native extensions wouldn't install when
running `bundle install`.

See
rubyjs/mini_racer#227 (comment)
erbridge added a commit to thedatascilab/ScenicOrNot that referenced this issue Sep 16, 2022
This resolves an issue where native extensions wouldn't install when
running `bundle install`.

See
rubyjs/mini_racer#227 (comment)
erbridge added a commit to thedatascilab/ScenicOrNot that referenced this issue Sep 20, 2022
This resolves an issue where native extensions wouldn't install when
running `bundle install`.

See
rubyjs/mini_racer#227 (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

6 participants