Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

do not cleanup load path for jruby #4566

Closed
wants to merge 1 commit into from
Closed

Conversation

mkristian
Copy link
Contributor

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 #4565

@mkristian
Copy link
Contributor Author

please advise on how and where I can add a spec for this !

@@ -192,7 +192,8 @@ def set_rubylib

def clean_load_path
# handle 1.9 where system gems are always on the load path
if defined?(::Gem)
# jruby does not put any system gems explicitly on the load path
if defined?(::Gem) and not defined?(JRUBY_VERSION)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't use keyword and or not

@segiddins
Copy link
Member

in the platform specs, you can simulat_jruby iirc

@RochesterinNYC
Copy link
Contributor

RochesterinNYC commented May 11, 2016

Ex. of jruby/java simulation in a test spec: https://github.com/bundler/bundler/blob/master/spec/install/gemfile/platform_spec.rb#L44

@mkristian
Copy link
Contributor Author

thanks for the hints on testing this. but I realized that my first analyses of the problem was wrong. changed the fix but that new one I have no idea how to test it, since I would bundler running from within a jar-file.

please let me know if such a "hacky" is still OK !

@segiddins
Copy link
Member

Can you please describe how / why this fixes the issue? (And preferably in a comment in the code). I'm also very reticent to merge bug fixes without test coverage, since it makes it so easy to re-break things in the future (especially when the fix is so hack)

…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
@mkristian
Copy link
Contributor Author

@segiddins I understand your point and I thought I explained it already in the comment. obviously I did not succeed. just "normalize" the uri-like paths so compare with the next hits where needed.

@segiddins
Copy link
Member

@mkristian
Copy link
Contributor Author

I thought about this and it is not the right place to fix this problem of jruby. feels like starting to fill the ecosystem with workaround which should/could be fix inside jruby. jruby/jruby#3881

@mkristian
Copy link
Contributor Author

thanks any one to look at this but we are not going this route.

@mkristian mkristian closed this May 16, 2016
@segiddins
Copy link
Member

👍 thanks for digging in and making the PR, @mkristian !

@kares
Copy link

kares commented May 18, 2016

@mkristian couldn't we get uri:classloader:// to be consistent on JRuby? there's special handling on a few places for it so maybe we should just make sure its always "normalized" ... just throwing a dice here.

@mkristian
Copy link
Contributor Author

@kares totally agree with you, that was is the idea behind jruby/jruby#3881 - not sure if I was so clear about this in this issue

@kares
Copy link

kares commented May 18, 2016

@mkristian oh right - sorry. did not check the issue as I was sure its another one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bundler::SharedHelpers.clean_load_path does cleanup the default load_path on jruby
4 participants