summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSmit Shah <who828@gmail.com>2014-11-24 10:52:40 +0530
committerSmit Shah <who828@gmail.com>2014-11-24 10:52:40 +0530
commit3999dc05e231936f508278b064cd673146f22dc7 (patch)
treec699c0d16751d6c0bfbae0c5ca51570851ee0158
parenta28f318d257e540522d01ccdf5a95467d71a5f8c (diff)
downloadbundler-3999dc05e231936f508278b064cd673146f22dc7.tar.gz
A fix for issues #3089, #3216 and #3248
Currently Bundler is aggressive to try different versions of exsiting gem parents before exhausting different versions of parents of current conflicting gem. By making sure we travase the current conflicting dependency tree before trying to make use of exsiting (activated) gem dependency tree, we reduce the number of conflicts and activation of gems older then the latest compitable version. However, a long term solution would be to make the resolver smarter by making it understand if current requirement conflict is caused by either by it's parent or existing gem parent by looking at each of their dependency requirements.
-rw-r--r--lib/bundler/resolver.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 7c4a10482e..f44e03a60e 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -171,13 +171,16 @@ module Bundler
end
def handle_conflict(current, states, existing=nil)
- until current.nil? && existing.nil?
+ until current.nil?
current_state = find_state(current, states)
- existing_state = find_state(existing, states)
return current if state_any?(current_state)
+ current = current.required_by.last if current
+ end
+
+ until existing.nil?
+ existing_state = find_state(existing, states)
return existing if state_any?(existing_state)
existing = existing.required_by.last if existing
- current = current.required_by.last if current
end
end