-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Conversation
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) |
There was a problem hiding this comment.
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
in the platform specs, you can simulat_jruby iirc |
Ex. of jruby/java simulation in a test spec: https://github.com/bundler/bundler/blob/master/spec/install/gemfile/platform_spec.rb#L44 |
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 ! |
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
@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. |
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 |
thanks any one to look at this but we are not going this route. |
👍 thanks for digging in and making the PR, @mkristian ! |
@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. |
@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 |
@mkristian oh right - sorry. did not check the issue as I was sure its another one. |
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