summaryrefslogtreecommitdiff
path: root/lib/bundler/lazy_specification.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-07-23 08:44:47 +0200
committergit <svn-admin@ruby-lang.org>2022-08-02 16:10:18 +0900
commitf4f681463f71c2fc63e1a07f36f2665f2b9db002 (patch)
tree6d9c7f6b576fdfcd480156bdbd2ce6b20141307f /lib/bundler/lazy_specification.rb
parent9189c2d5efa94131050df4994c801fb187d7b43d (diff)
downloadruby-f4f681463f71c2fc63e1a07f36f2665f2b9db002.tar.gz
[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 <ian.kerseymer@shopify.com>
Diffstat (limited to 'lib/bundler/lazy_specification.rb')
-rw-r--r--lib/bundler/lazy_specification.rb6
1 files changed, 4 insertions, 2 deletions
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