From f4f681463f71c2fc63e1a07f36f2665f2b9db002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sat, 23 Jul 2022 08:44:47 +0200 Subject: [rubygems/rubygems] Don't discard candidates matching ruby metadata Do dependency filtering and materialization in one step. Before, dependency filtering would not consider ruby metadata so it would discard variants that end up not being materializable in the end. https://github.com/rubygems/rubygems/commit/0c0d40d417 Co-authored-by: Ian Ker-Seymer --- lib/bundler/lazy_specification.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/bundler/lazy_specification.rb') diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb index 805afba51f..a88172d96b 100644 --- a/lib/bundler/lazy_specification.rb +++ b/lib/bundler/lazy_specification.rb @@ -88,6 +88,8 @@ module Bundler source.specs.search(self) end + return self if candidates.empty? + __materialize__(candidates) end @@ -105,8 +107,8 @@ module Bundler spec.is_a?(StubSpecification) || (spec.required_ruby_version.satisfied_by?(Gem.ruby_version) && spec.required_rubygems_version.satisfied_by?(Gem.rubygems_version)) - end || candidates.last - search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification)) + end + search.dependencies = dependencies if search && search.full_name == full_name && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification)) search end end -- cgit v1.2.1