summaryrefslogtreecommitdiff
path: root/lib/bundler/resolver.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/resolver.rb')
-rw-r--r--lib/bundler/resolver.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index fa95ff879b..3263913b7f 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -37,8 +37,16 @@ module Bundler
root_version = Resolver::Candidate.new(0)
@all_specs = Hash.new do |specs, name|
- matches = source_for(name).specs.search(name)
- matches = filter_invalid_self_dependencies(matches, name)
+ source = source_for(name)
+ matches = source.specs.search(name)
+
+ # Don't bother to check for circular deps when no dependency API are
+ # available, since it's too slow to be usable. That edge case won't work
+ # but resolution other than that should work fine and reasonably fast.
+ if source.respond_to?(:dependency_api_available?) && source.dependency_api_available?
+ matches = filter_invalid_self_dependencies(matches, name)
+ end
+
specs[name] = matches.sort_by {|s| [s.version, s.platform.to_s] }
end