From 80f35d96ae60fdf238ff62982094b4b4dbd13ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Fri, 25 Aug 2023 16:18:01 +0200 Subject: [rubygems/rubygems] Don't check for circular deps on full index sources https://github.com/rubygems/rubygems/commit/d275cdccb1 --- lib/bundler/resolver.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3