Skip to content

bundle install fails since #5215 #5280

Closed

Description

@yahonda

Environment

  • JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc)
$ jruby -v
jruby 9.2.1.0-SNAPSHOT (2.5.0) 2018-07-31 cbccb8d Java HotSpot(TM) 64-Bit Server VM 25.181-b13 on 1.8.0_181-b13 [linux-x86_64]
  • Operating system and platform (e.g. uname -a)
$ uname -a
Linux li1554-157.members.linode.com 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Other relevant info you may wish to add:

  • Installed or activated gems - Rails
  • Application/framework version (e.g. Rails, Sinatra)
  • Environment variables
$ env |grep RUBY
JRUBY_OPTS=--dev -J-Xmx2048M
RUBY_CONFIGURE_OPTS=--disable-install-doc

Steps to reproduce

  • Create Gemfile
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem "rails"
  • Execute gem install bundler
$ gem install bundler
  • Execute bundle install
$ bundle install

Expected Behavior

Bundle should pass.

Actual Behavior

NoMethodError: undefined method `dep' for #<Gem::Dependency:0x100c8b75>
Did you mean?  dup
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/dep_proxy.rb:18:in `=='
  org/jruby/ext/set/RubySet.java:639:in `add?'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/spec_set.rb:27:in `block in for'
  org/jruby/RubyKernel.java:1412:in `loop'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/spec_set.rb:25:in `for'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/definition.rb:810:in `converge_locked_specs'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/definition.rb:248:in `resolve'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/definition.rb:204:in `missing_specs'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/definition.rb:209:in `missing_specs?'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/installer.rb:284:in `resolve_if_needed'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/installer.rb:83:in `block in run'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/process_lock.rb:12:in `block in lock'
  org/jruby/RubyIO.java:1154:in `open'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/process_lock.rb:9:in `lock'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/installer.rb:72:in `run'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/installer.rb:25:in `install'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/cli/install.rb:65:in `run'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/cli.rb:224:in `block in install'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/settings.rb:136:in `temporary'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/cli.rb:223:in `install'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/cli.rb:27:in `dispatch'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/cli.rb:18:in `start'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/exe/bundle:30:in `block in <main>'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
  /home/yahonda/git/jruby/lib/ruby/gems/shared/gems/bundler-1.16.3/exe/bundle:22:in `<main>'
  org/jruby/RubyKernel.java:997:in `load'
  /home/yahonda/git/jruby/bin/bundle:1:in `<main>'

Activity

  1. yahonda commented on Aug 14, 2018

    @yahonda
    Author

    This issue has been triggered since #5215. Then reverting this merge commit workaround this issue.

    $ git revert -m1 e483fb2251845b7bb3ff1ac99aa5760699438ffe
  2. headius commented on Aug 16, 2018

    @headius
    Member

    @yahonda Thank you for the report!

    @ChrisBr Guess we still have a few kinks to work out.

  3. added this to the JRuby 9.2.1.0 milestone on Aug 16, 2018
  4. ChrisBr commented on Aug 20, 2018

    @ChrisBr
    Contributor

    Grml 😢 I will look into it @headius ...

  5. added a commit that references this issue on Aug 22, 2018
    fdd15fa
  6. ChrisBr commented on Aug 22, 2018

    @ChrisBr
    Contributor

    Ok, I tracked this down now. This is a combination of two things:

    1. When using the open addressing strategy, we do not cache the hash value of the keys anymore (we only do that for linear search). This means when a collision happens, we do == on the keys.

    2. In bundler the DepProxy class implements == but does not check the class of the other object. This is combination with 1) causes this error.

    I already submitted a fix to bundler, see rubygems/bundler#6669. However, probably we need to fix this on JRuby side as well as we don't know if bundler accepts the fix and when the will release a new version (and also we can not rely that all our users update to the new bundler version ...) 😢 So the only solution I see for now is that we always cache the hash value now.

    cc @headius @enebo what do you think?

  7. added 3 commits that reference this issue on Aug 22, 2018
    b939e3c
    fd43f11
    d6fde97
  8. added a commit that references this issue on Aug 24, 2018
    067b279
  9. yahonda commented on Aug 25, 2018

    @yahonda
    Author

    Thanks for the fix. I have confirmed this issue has been addressed by this version.

    $ ruby -v
    jruby 9.2.1.0-SNAPSHOT (2.5.0) 2018-07-31 067b279 Java HotSpot(TM) 64-Bit Server VM 25.181-b13 on 1.8.0_181-b13 [linux-x86_64]
  10. added a commit that references this issue on Aug 27, 2018
  11. added a commit that references this issue on Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions