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

ruby-changes:69957

From: David <ko1@a...>
Date: Sat, 27 Nov 2021 05:32:11 +0900 (JST)
Subject: [ruby-changes:69957] 59439446d9 (master): [rubygems/rubygems] Fix missing locked specs when depended on other platform

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

From 59439446d9432cabf106c700943b29773b4a264f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Wed, 24 Nov 2021 22:01:45 +0100
Subject: [rubygems/rubygems] Fix missing locked specs when depended on other
 platform

https://github.com/rubygems/rubygems/commit/0396e899db
---
 lib/bundler/definition.rb                     |  2 +-
 spec/bundler/install/gemfile/platform_spec.rb | 43 +++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index d88436bdbd4..97b592da7eb 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -751,7 +751,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/definition.rb#L751
           s.dependencies.replace(new_spec.dependencies)
         end
 
-        if dep.nil? && @dependencies.find {|d| s.name == d.name }
+        if dep.nil? && requested_dependencies.find {|d| s.name == d.name }
           @unlock[:gems] << s.name
         else
           converged << s
diff --git a/spec/bundler/install/gemfile/platform_spec.rb b/spec/bundler/install/gemfile/platform_spec.rb
index 221c52c4485..35a3872c032 100644
--- a/spec/bundler/install/gemfile/platform_spec.rb
+++ b/spec/bundler/install/gemfile/platform_spec.rb
@@ -358,6 +358,49 @@ RSpec.describe "bundle install with platform conditionals" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/platform_spec.rb#L358
     expect(the_bundle).not_to include_gems "nokogiri 1.4.2"
   end
 
+  it "installs gems tagged w/ another platform but also dependent on the current one transitively" do
+    build_repo4 do
+      build_gem "activesupport", "6.1.4.1" do |s|
+        s.add_dependency "tzinfo", "~> 2.0"
+      end
+
+      build_gem "tzinfo", "2.0.4"
+    end
+
+    gemfile <<~G
+      source "#{file_uri_for(gem_repo4)}"
+
+      gem "activesupport"
+
+      platforms :#{not_local_tag} do
+        gem "tzinfo", "~> 1.2"
+      end
+    G
+
+    lockfile <<~L
+      GEM
+        remote: #{file_uri_for(gem_repo4)}/
+        specs:
+          activesupport (6.1.4.1)
+            tzinfo (~> 2.0)
+          tzinfo (2.0.4)
+
+      PLATFORMS
+        #{specific_local_platform}
+
+      DEPENDENCIES
+        activesupport
+        tzinfo (~> 1.2)
+
+      BUNDLED WITH
+         #{Bundler::VERSION}
+    L
+
+    bundle "install --verbose"
+
+    expect(the_bundle).to include_gems "tzinfo 2.0.4"
+  end
+
   it "installs gems tagged w/ the current platforms inline" do
     skip "platform issues" if Gem.win_platform?
 
-- 
cgit v1.2.1


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

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