-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Bundler::SharedHelpers.clean_load_path does cleanup the default load_path on jruby #4565
Comments
jruby does not add default gems explicitly to the load path and the cleaning of the load path wipes out the default laod_path of jruby in cases where JRUBY_HOME == GEM_HOME fixes rubygems#4565
this issue came forward during investigation of jruby/jruby#3850 |
…ruby JRuby sometime produces uri:classloader:/gems/bundler-1.12.3/lib paths and sometimes uri:classloader://gems/bundler-1.12.3/lib due to some file-path normalization not able to keep uri prefixes intact. those uri-like paths mainly happen when loading resources from the jar-file or classloader. fixes rubygems#4565
👍 We need to get this out there ASAP so folks running into problems bundling apps into jars can still deploy their apps. Let me know what I can do to help. |
…ruby JRuby sometime produces uri:classloader:/gems/bundler-1.12.3/lib paths and sometimes uri:classloader://gems/bundler-1.12.3/lib due to some file-path normalization not able to keep uri prefixes intact. those uri-like paths mainly happen when loading resources from the jar-file or classloader. fixes rubygems#4565
@headius you may want to pick up the work @mkristian started doing on #4566 |
@lynnco Pick it up? You mean test that it works? |
@lynnco Ok, so I guess you are saying we should fix #3881 before we consider a patch to Bundler. I'll clarify with @mkristian whether this bug is still valid. |
@headius it seems like this was a jruby issue that Bundler code could have helped solve, so it would be ok to send a patch to resolve it on Bundler's end. But if jruby is no longer experiencing the issue then I dont think it's worth your time to work on the Bundler PR |
on warbler I am working on patch to fix this problem here. packing ruby application with gradle or maven works already with a monkey patch for bundler. it is clearly a jruby issue when jruby tries to normalize those uri-like paths which is still treated as regular path on filesystem. |
Is this issue still relevant? |
…Helpers.clean_load_path: Fix #861 Bundler has had a problem in running with JRuby. See rubygems/bundler#4565 for the details.
I'm also concerned about this issue. Not sure of the status -- will it be fixed on Bundler side, or does jruby/jruby#3881 on JRuby side fix it? |
oh - it never got fixed on the JRuby side :( |
Is this issue still an issue? Can you try with the latest bundler? I think #6502 might've fixed this. |
Closing due to lack of feedback. |
I have not heard of this being an issue for anyone in quite some time, so we'll assume it has been resolved. |
when packing a jruby into jar the internal layout looks as such: let ROOT be the root of the jar.
JRUBY_HOME=ROOT
GEM_PATH=ROOT
GEM_HOME=ROOT
and the default load path of jruby is
$JRUBY_HOME/lib/ruby/2.3/site_ruby, $JRUBY_HOME/lib/ruby/stdlib
in such a setup
Bundler::SharedHelpers.clean_load_path
will wipe out the default load_path and you will see errors like:see https://gist.github.com/mkristian/5738370aba7d6cbe38d516cfdc07d992 for a complete example.
I did monkey patch with jruby-mains like this: https://github.com/jruby/jruby-mains/blob/master/src/main/resources/META-INF/monkey_patches.rb#L9 for some time now. but warbler does not have this monkey patch, so warblers packed jar files can fail when using bundler.
PR is coming
The text was updated successfully, but these errors were encountered: