-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Error in Bundler 1.13 with JRuby 1.7.x #4975
Comments
What's the output of |
For JRuby 1.7.26 (latest 1.7.x release):
I also forgot to mention, than Bundler 1.13 works under JRuby 9k:
|
I am experiencing the exact same issue. Manifests in bundler 1.13.1 as well. Dropped back to 1.12.5 and bundler is now functioning correctly. Here's another stack trace if that is helpful.
And here is top of my bundler env output
|
Does that version of jruby have a different ACL level for |
Hi Samuel, I've spend a few minutes in the Jruby source before :) I had a look at the RubyKernel.java class and it looks like Kernel.require is marked as private
By my read MRI Kernel.require is public. Do you want me to raise this with the Jruby team? Regards, |
Hi Samuel, I'm a bit perplexed here. Chatted briefly on IRC and someone mentioned Kernel.public_methods - it does show require. And I confirmed via IRB that I can invoke Kernel.require 'fubar.rb' with no difficultly. I am wondering if something in Bundler is impacting the Kernel methods? Maybe as Bundler fires up you can isolate the culprit by putting "Kernel.require 'fubar.rb'" statements that will fail at first for file not found and then eventually for private method. Yuck, I know, but may be necessary to hunt down an issue in other people's code. I think we'll need to bring this to the JRuby maintainers because the cause is not entirely clear. Your thoughts? |
So I've tried MRI 1.9.3 in Docker and Bundler works. So it is really only problem of JRuby 1.7.x. And yes, #jayjlawrence, something in Bundler is impacting Kernel methods, see my first comment ;o) I found it can be simply tested like this:
The previous implementation of reverse_rubygems_kernel_mixin used alias_method, while current implementation is done via remove_method/define_method which obviously does not play well with JRuby 1.7.x |
A similar issue was reported. Here is a proposed workaround:
See jruby/jruby#4155 |
I propose a couple things. First is to assess if the Kernel.send clears up the issue in bundler and at least release a revision because lots of JRuby users are going to get bit by this issue. The second is to package up @petr666's minimal example and submit as a jruby bug. Clearly the Kernel.require method is getting 'corrupted' as part of the execution of Bundler::RubygemsIntegration.new.reverse_rubygems_kernel_mixin and maybe this is enough of a smoking gun for the JRuby folks to figure out what went wrong. I am happy to report the matter to JRuby or please feel free to submit the issue as you see fit. |
Actually this is being discussed on IRC now. It looks like they might have an idea of what's going wrong... |
@jayjlawrence It's awesome that you keep reporting and compiling the details. |
@segiddins possibly saving you 5 minutes - I have confirmed that Kernel.send(:require, fname) works. Note that there are two places in runtime.rb where Kernel.require is called. This was using JRuby 1.7.24 and Bundler 1.13.1. |
@segiddins I agree with @headius on JRuby team that the best approach is switch to Kernel.send and do a quick release of Bundler. There will be many JRuby deploys that will be impacted by this issue. Over to you. |
I have a new solution...modify the logic in |
To summarize what I posted in jruby/jruby#4155... In JRuby, method visibility is attached to the method rather than the method table, so pulling a private method off one method table and This is a bug, and one we've known about...but nobody ever ran into it because they weren't transplanting methods this way (or at least, they didn't require them to become more visible). This issue could have been avoided in a few ways:
We will fix the root issue in JRuby, but we can't do anything about past JRuby releases in the wild. Therefore we request that bundler use my |
From @headius 's recommendation above here is a proposed patch
|
@jayjlawrence Thank you for confirming and providing a patch! Given that |
The root issue in JRuby was fixed in jruby/jruby@9b4e97b, which went into 9.1.3.0; versions >= 9.1.3.0 should not be affected. I'm backporting the fix to the 1.7.x line now. |
@headius thanks for the explanation! We tried to get the test suite running under jruby on travis but given the reliance on subprocess exec'ing, it just wasn't feasible given the JVM boot time. I have an idea for how to fix this, I'll try and pull together a PR now |
Feedback on #4983 would be appreciated, I don't have the bandwidth right now to download a new ruby |
@segiddins Yeah I'm trying to run the suite locally and it takes a dog's age to finish. We may be able to mitigate that by installing Drip, which will spin up the "next" subprocess JRuby in the background so it's ready when we need it. |
This is necessary until the bundler + Jruby issues are resolved: - rubygems/bundler#4975 - https://github.com/bundler/bundler/issues/4984
This is necessary until the bundler + JRuby issues are resolved: * rubygems/bundler#4975 * bundler/bundler#4984
This is necessary until the bundler + JRuby issues are resolved: * rubygems/bundler#4975 * bundler/bundler#4984
This is necessary until the bundler + JRuby issues are resolved: * rubygems/bundler#4975 * bundler/bundler#4984
This is necessary until the bundler + JRuby issues are resolved: * rubygems/bundler#4975 * bundler/bundler#4984
This is necessary until the bundler + JRuby issues are resolved: * rubygems/bundler#4975 * bundler/bundler#4984
This is necessary until the bundler + JRuby issues are resolved: * rubygems/bundler#4975 * bundler/bundler#4984
* rubygems/bundler#4975 * bundler/bundler#4984
Fix to bypass these bundler + JRuby bugs: * rubygems/bundler#4975 * bundler/bundler#4984
Fix to bypass these bundler + JRuby bugs: * rubygems/bundler#4975 * bundler/bundler#4984 Conflicts: .travis.yml
To whom it may concern, We ran into this issue when running our test suite on Travis-CI. It took many hours of hair pulling, but finally figured out the incantation which I shall leave here for others :)
|
Calling
Bundler.require
fails with
Gem Load Error is: private method
require' called for Kernel:Module Backtrace for gem load error is: /home/test/.gem/gems/bundler-1.13.0/lib/bundler/runtime.rb:91:in
require'org/jruby/RubyArray.java:1613:in
each' /home/test/.gem/gems/bundler-1.13.0/lib/bundler/runtime.rb:86:in
require'org/jruby/RubyArray.java:1613:in
each' /home/test/.gem/gems/bundler-1.13.0/lib/bundler/runtime.rb:75:in
require'/home/test/.gem/gems/bundler-1.13.0/lib/bundler.rb:106:in `require'
The problem is in method reverse_rubygems_kernel_mixin from rubygems_integration.rb which is different from Bundler 1.12. When method implementation from 1.13 is replaced by implementation from 1.12, Bundler is working again.
It might be generic problem with Ruby 1.9 and not specifically JRuby 1.7.x, but I have no environment with MRI 1.9 to test it.
The text was updated successfully, but these errors were encountered: