[前][次][番号順一覧][スレッド一覧]

ruby-changes:72787

From: David <ko1@a...>
Date: Tue, 2 Aug 2022 16:10:47 +0900 (JST)
Subject: [ruby-changes:72787] bc0de1e162 (master): [rubygems/rubygems] Only need to filter platforms when materialization is not strict

https://git.ruby-lang.org/ruby.git/commit/?id=bc0de1e162

From bc0de1e16250ecb4e8278ec64de86fbc049c5e63 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Sat, 23 Jul 2022 13:47:58 +0200
Subject: [rubygems/rubygems] Only need to filter platforms when
 materialization is not strict

https://github.com/rubygems/rubygems/commit/9d878cbda0
---
 lib/bundler/lazy_specification.rb | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index 3d704a7f12..4a7f528119 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -89,21 +89,19 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/lazy_specification.rb#L89
 
     def __materialize__(platform)
       @specification = begin
-        search_object = if source.is_a?(Source::Path) || !ruby_platform_materializes_to_ruby_platform?
-          Dependency.new(name, version)
+        candidates = if source.is_a?(Source::Path) || !ruby_platform_materializes_to_ruby_platform?
+          source.specs.search(Dependency.new(name, version)).select do |spec|
+            MatchPlatform.platforms_match?(spec.platform, platform)
+          end
         else
-          self
+          source.specs.search(self)
         end
-        candidates = source.specs.search(search_object)
-        same_platform_candidates = candidates.select do |spec|
-          MatchPlatform.platforms_match?(spec.platform, platform)
-        end
-        installable_candidates = same_platform_candidates.select do |spec|
+        installable_candidates = candidates.select do |spec|
           spec.is_a?(StubSpecification) ||
             (spec.required_ruby_version.satisfied_by?(Gem.ruby_version) &&
               spec.required_rubygems_version.satisfied_by?(Gem.rubygems_version))
         end
-        search = installable_candidates.last || same_platform_candidates.last
+        search = installable_candidates.last || candidates.last
         search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
         search
       end
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]