summaryrefslogtreecommitdiff
path: root/lib/bundler/resolver.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-08-25 16:18:01 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-08-28 11:15:34 +0900
commit80f35d96ae60fdf238ff62982094b4b4dbd13ecf (patch)
treec95db7a866182d2ecdc6a47b21156d730208aede /lib/bundler/resolver.rb
parent2edf9fa23a78da59b5ff0d67a16037aecd38a00f (diff)
[rubygems/rubygems] Don't check for circular deps on full index sources
https://github.com/rubygems/rubygems/commit/d275cdccb1
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