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

ruby-changes:70144

From: David <ko1@a...>
Date: Fri, 10 Dec 2021 19:10:11 +0900 (JST)
Subject: [ruby-changes:70144] 0e60bc118b (master): [rubygems/rubygems] Ignore dependencies not actually locked from frozen check

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

From 0e60bc118b66d626d7e1f985dbd15cfba5e62715 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Wed, 8 Dec 2021 18:36:13 +0100
Subject: [rubygems/rubygems] Ignore dependencies not actually locked from
 frozen check

Only needed if there can be no explicit global source (bundler < 3).

https://github.com/rubygems/rubygems/commit/73923f4af5
---
 lib/bundler/definition.rb           |  7 ++++++-
 spec/bundler/install/deploy_spec.rb | 11 +++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index c2a8e2ba42f..84f0367ac70 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -379,7 +379,12 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/definition.rb#L379
 
       both_sources = Hash.new {|h, k| h[k] = [] }
       @dependencies.each {|d| both_sources[d.name][0] = d }
-      locked_dependencies.each {|d| both_sources[d.name][1] = d }
+
+      locked_dependencies.each do |d|
+        next if !Bundler.feature_flag.bundler_3_mode? && @locked_specs[d.name].empty?
+
+        both_sources[d.name][1] = d
+      end
 
       both_sources.each do |name, (dep, lock_dep)|
         next if dep.nil? || lock_dep.nil?
diff --git a/spec/bundler/install/deploy_spec.rb b/spec/bundler/install/deploy_spec.rb
index 54fc6371cb0..3bcb6a703eb 100644
--- a/spec/bundler/install/deploy_spec.rb
+++ b/spec/bundler/install/deploy_spec.rb
@@ -258,6 +258,17 @@ RSpec.describe "install in deployment or frozen mode" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/deploy_spec.rb#L258
       expect(out).to eq("WIN")
     end
 
+    it "works if a gem is missing, but it's on a different platform, and the Gemfile has no global source", :bundler => "< 3" do
+      install_gemfile <<-G
+        source "#{file_uri_for(gem_repo1)}" do
+          gem "rake", platform: :#{not_local_tag}
+        end
+      G
+
+      bundle :install, :env => { "BUNDLE_FROZEN" => "true" }
+      expect(last_command).to be_success
+    end
+
     it "explodes if a path gem is missing" do
       build_lib "path_gem"
       install_gemfile <<-G
-- 
cgit v1.2.1


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

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