From 1f9e66836b71dd77aaef660628eb2455b4f28a3b Mon Sep 17 00:00:00 2001 From: David Rodríguez Date: Thu, 25 May 2023 13:39:33 +0200 Subject: [rubygems/rubygems] Fix inline mode with multiple sources If we're in inline mode, Bundler first resolves using only local gems, and if some gems are missing, then it re-resolves using remote gems. However, "source resolution" from the initial "local" try was being memoized, resulting in Bundler not looking for some gems remotely in the second resolution. This commit forces a proper re-resolve in this case. https://github.com/rubygems/rubygems/commit/fdc631075e --- spec/bundler/runtime/inline_spec.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'spec') diff --git a/spec/bundler/runtime/inline_spec.rb b/spec/bundler/runtime/inline_spec.rb index 9567d2a3c3..29ef036828 100644 --- a/spec/bundler/runtime/inline_spec.rb +++ b/spec/bundler/runtime/inline_spec.rb @@ -191,6 +191,31 @@ RSpec.describe "bundler/inline#gemfile" do expect(err).to be_empty end + it "installs subdependencies quietly if necessary when the install option is not set, and multiple sources used" do + build_repo4 do + build_gem "rack" do |s| + s.add_dependency "rackdep" + end + + build_gem "rackdep", "1.0.0" + end + + script <<-RUBY + gemfile do + source "#{file_uri_for(gem_repo1)}" + source "#{file_uri_for(gem_repo4)}" do + gem "rack" + end + end + + require "rackdep" + puts RACKDEP + RUBY + + expect(out).to eq("1.0.0") + expect(err).to be_empty + end + it "installs quietly from git if necessary when the install option is not set" do build_git "foo", "1.0.0" baz_ref = build_git("baz", "2.0.0").ref_for("HEAD") -- cgit v1.2.3