-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Conversation
I'd love to add some test case for this, but unfortunately, I can't see too many $LOAD_PATH tests in current test suite. Any help is appreciated. |
Most of the existing tests are integration tests for real-world types of scenarios. What's the problem that this change fixes? |
I don't think that Bundler does good job cleaning load path. And there are several concerns:
This patch is changing this. It asks RubyGems "what are the load paths of the stuff you loaded" and removes just that paths. Since these paths were cleaned from load path, it cleans also the Gem.loaded_specs and later just adds Bundler back on load path. [1] https://github.com/bundler/bundler/blob/master/lib/bundler/rubygems_ext.rb#L37 |
4c316c1
to
331a493
Compare
@voxik could you rebase this onto the upstream master? There was a recent fix for the build failures on Ruby 1.8.7. |
331a493
to
c3a70aa
Compare
@TimMoore I did that, but it does not help :/ |
You're right... that fix doesn't work deterministically. Still, though, some jobs failed due to a spec failure that appears to be related to this change. |
Are you referring to
or something else? That would be weird if it is related to my change. But let me investigate ... |
c3a70aa
to
c1cc4ca
Compare
Hi, I updated the patch and now all tests are passing. I'd appreciate if you could merge. |
This is a good fix, thanks. Unfortunately, Bundler can't use any |
6b28248
to
e8d764e
Compare
@indirect Sure! I modified the code. However, I am unsure if that is enough. May be I should move the whole |
@voxik I would prefer that, yes. If you could make that change it would be great. How can we test this to make sure it does not break in the future? We can create a gem with a binary extension for the test. |
RubyGems since version 2.2 allows to reconfigure place, where binary extensions are stored. This might allow easier sharing of gems between various Ruby interpreters. It can be enabled by redefining Gem.default_ext_dir_for method. This patch is adding support for this feature into Bundler.
@indirect Ok, I'll try to update the patch in that direction. |
e8d764e
to
fe0a6e4
Compare
I pushed updated patch, if you could review. And I have to take look on some test case .... |
The bang variant returns nil in case there was no change needed.
Ok, so I put also test case in place. There appears to be single test failure [1] related to this test case on travis, but I have no clue how it may happens. I tend to believe, that the error is exhibited just by coincidence. I the PR is acceptable in its current form, I'd prefer to squash the commits prior merge. |
@voxik I've rerun https://travis-ci.org/bundler/bundler/jobs/43453419 a few times and the failure happens consistently. This backtrace is in the logs:
Can you take a look? |
I believe the fail is connected with rubygems/rubygems#784, so I would say it's safe to merge. |
Sorry, but we're not going to merge something that breaks the build. |
@TimMoore I added several comments to rubygems/rubygems#784 which is indeed the reason for the failures, not this patch (although this patch may lead to issues such as the one with rdiscount), but this is again issue of RubyGems or rdiscount and orthogonal to this patch. |
@voxik I'm happy to merge this as soon as Rubygems fixes rubygems/rubygems#784, but we can only allow these changes to happen in versions of Rubygems that have fixed that bug. This patch needs to either: 1) work around the rubygems issue by not activating unless the rubygems issue is already fixed or 2) fix the rubygems issue via monkeypatching for the exact versions of 2.2 that are broken. Is either one of those feasible for you? |
Submitted rubygems/rubygems#1137 to unblock rubygems/rubygems#784. Credit to @voxik |
ping @steakknife @voxik can either of you rebase this and check the rubygems version for a compatible one before applying the fix? |
@indirect @voxik Can you guys confirm that a patch is even needed for MRI 2.2 functionality? Latest RubyGems@master reverted conflicting native/Ruby loading behavior. The cleaning of |
This is follow up of #3234