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

Build using jruby-head has been failing NoMethodError: undefined method dep' for #<Gem::Dependency:0x7ee955a8>` #9994

Closed
yahonda opened this issue Aug 13, 2018 · 1 comment

Comments

@yahonda
Copy link

yahonda commented Aug 13, 2018

As far as I can see, all of CI running jruby-head have been failing with NoMethodError: undefined method dep' for #Gem::Dependency:0x7ee955a8`

https://travis-ci.org/rails/rails/jobs/415262108

Running command: bundle exec rake test
Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
NoMethodError: undefined method `dep' for #<Gem::Dependency:0x7ee955a8>
Did you mean?  dup
                     == at /home/travis/.rvm/gems/jruby-head/gems/bundler-1.16.3/lib/bundler/dep_proxy.rb:18
                   add? at org/jruby/ext/set/RubySet.java:639
                    for at /home/travis/.rvm/gems/jruby-head/gems/bundler-1.16.3/lib/bundler/spec_set.rb:27
                   loop at org/jruby/RubyKernel.java:1412
                    for at /home/travis/.rvm/gems/jruby-head/gems/bundler-1.16.3/lib/bundler/spec_set.rb:25
  converge_locked_specs at /home/travis/.rvm/gems/jruby-head/gems/bundler-1.16.3/lib/bundler/definition.rb:810
                resolve at /home/travis/.rvm/gems/jruby-head/gems/bundler-1.16.3/lib/bundler/definition.rb:248
                  specs at /home/travis/.rvm/gems/jruby-head/gems/bundler-1.16.3/lib/bundler/definition.rb:171
              specs_for at /home/travis/.rvm/gems/jruby-head/gems/bundler-1.16.3/lib/bundler/definition.rb:238
        requested_specs at /home/travis/.rvm/gems/jruby-head/gems/bundler-1.16.3/lib/bundler/definition.rb:227
        requested_specs at /home/travis/.rvm/gems/jruby-head/gems/bundler-1.16.3/lib/bundler/runtime.rb:108
                  setup at /home/travis/.rvm/gems/jruby-head/gems/bundler-1.16.3/lib/bundler/runtime.rb:20
                  setup at /home/travis/.rvm/gems/jruby-head/gems/bundler-1.16.3/lib/bundler.rb:107
                 <main> at /home/travis/.rvm/gems/jruby-head/gems/bundler-1.16.3/lib/bundler/setup.rb:20
                require at org/jruby/RubyKernel.java:973
                 (root) at /home/travis/.rvm/rubies/jruby-head/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
  • Here are links to some failing ones:

https://travis-ci.org/rails/rails/jobs/415262109
https://travis-ci.org/rsim/oracle-enhanced/jobs/414956709
https://travis-ci.org/rubocop-hq/rubocop/jobs/415267612

cc @koic who told me that this error.

@yahonda
Copy link
Author

yahonda commented Aug 14, 2018

I've found it reproduces locally then opened jruby/jruby#5280

@yahonda yahonda closed this as completed Aug 14, 2018
ChrisBr added a commit to ChrisBr/bundler that referenced this issue Aug 22, 2018
Checking now also that other class is the same as self.
Otherwise it will crash for anything other than DepProxy class
or nil.

Fixes jruby/jruby#5280 travis-ci/travis-ci#9994
ChrisBr added a commit to ChrisBr/bundler that referenced this issue Aug 22, 2018
DepProxy#== crashed with an undefind method error
for anything other than a DepProxy class or nil
as parameter. This was caused that it was assumed
only DepProxy instances or nil can get passed as
parameter. This commit implements checking the class
as well and returns false if the classes are not
the same.

Fixes jruby/jruby#5280 travis-ci/travis-ci#9994
ChrisBr added a commit to ChrisBr/bundler that referenced this issue Aug 23, 2018
DepProxy#== crashed with an undefind method error
for anything other than a DepProxy class or nil
as parameter. This was caused that it was assumed
only DepProxy instances or nil can get passed as
parameter. This commit implements checking the class
as well and returns false if the classes are not
the same.

Fixes jruby/jruby#5280 travis-ci/travis-ci#9994
ChrisBr added a commit to ChrisBr/jruby that referenced this issue Aug 23, 2018
To save memory we decided to not cache the hash value of the keys anymore
when using open addressing as this was only necessary for a fast bucket
skip when a bin collision happens. With the current approach, when a bin collision
happens we call eql? on the keys. This was reasonable as this only happens
when a collision occours.

However, with this approach we always call eql? when a bin collision happens even
when the hashes are different as we only use the lower bits of the hash
to calculate the bin where the key / value pair is stored. This causes now
that wrong implementation of eql? will crash always on a bin collisions and not
only on a bin AND hash collision.

As this is the case for bundler, there is no other way than caching the hash values
again to reduce the probability that this happens.

Fixes jruby#5280 travis-ci/travis-ci#9994
bundlerbot added a commit to rubygems/bundler that referenced this issue Aug 27, 2018
Fix DepProxy == method

### What was the end-user problem that led to this PR?
After implementing a new hash table strategy in JRuby, bundle is broken for JRuby. The problem is caused that the ``==`` method in bundler does not check the class of the ``other`` object. This causes problems now when calling ``==`` on object other than DepProxy or nil.

 jruby/jruby#5280 travis-ci/travis-ci#9994

### What was your diagnosis of the problem?
The code crashes for anything other than DepProxy class or nil.

### What is your fix for the problem, implemented in this PR?
Checking now also that other class is the same as self.
colby-swandale pushed a commit to rubygems/bundler that referenced this issue Sep 14, 2018
Fix DepProxy == method

### What was the end-user problem that led to this PR?
After implementing a new hash table strategy in JRuby, bundle is broken for JRuby. The problem is caused that the ``==`` method in bundler does not check the class of the ``other`` object. This causes problems now when calling ``==`` on object other than DepProxy or nil.

 jruby/jruby#5280 travis-ci/travis-ci#9994

### What was your diagnosis of the problem?
The code crashes for anything other than DepProxy class or nil.

### What is your fix for the problem, implemented in this PR?
Checking now also that other class is the same as self.

(cherry picked from commit 1856133)
hsbt pushed a commit to rubygems/bundler-graph that referenced this issue Oct 19, 2021
Fix DepProxy == method

### What was the end-user problem that led to this PR?
After implementing a new hash table strategy in JRuby, bundle is broken for JRuby. The problem is caused that the ``==`` method in bundler does not check the class of the ``other`` object. This causes problems now when calling ``==`` on object other than DepProxy or nil.

 jruby/jruby#5280 travis-ci/travis-ci#9994

### What was your diagnosis of the problem?
The code crashes for anything other than DepProxy class or nil.

### What is your fix for the problem, implemented in this PR?
Checking now also that other class is the same as self.
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

1 participant