ruby-changes:71059
From: David <ko1@a...>
Date: Tue, 1 Feb 2022 08:09:41 +0900 (JST)
Subject: [ruby-changes:71059] 517d7c3221 (master): Sync latest Bundler & RubyGems
https://git.ruby-lang.org/ruby.git/commit/?id=517d7c3221 From 517d7c3221e3ca0ca76d79cc67cb9efefc01ece3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Mon, 31 Jan 2022 17:45:12 +0100 Subject: Sync latest Bundler & RubyGems --- lib/bundler/definition.rb | 2 +- lib/bundler/resolver.rb | 9 ++-- spec/bundler/commands/binstubs_spec.rb | 8 +-- spec/bundler/commands/cache_spec.rb | 16 +++--- spec/bundler/commands/clean_spec.rb | 7 ++- spec/bundler/commands/lock_spec.rb | 8 ++- spec/bundler/install/gemfile/gemspec_spec.rb | 71 +++++++++++++++++++++++-- spec/bundler/install/gemfile/git_spec.rb | 8 +-- spec/bundler/install/gemfile/platform_spec.rb | 10 ++-- spec/bundler/install/gems/standalone_spec.rb | 7 ++- spec/bundler/runtime/inline_spec.rb | 2 +- spec/bundler/support/hax.rb | 10 ---- spec/bundler/support/path.rb | 12 +++-- test/rubygems/test_rubygems.rb | 6 +-- tool/bundler/dev_gems.rb | 24 +++++++++ tool/bundler/dev_gems.rb.lock | 75 +++++++++++++++++++++++++++ tool/sync_default_gems.rb | 1 + 17 files changed, 221 insertions(+), 55 deletions(-) create mode 100644 tool/bundler/dev_gems.rb create mode 100644 tool/bundler/dev_gems.rb.lock diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index b4a860f519d..77f065c5c78 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -266,7 +266,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/definition.rb#L266 else # Run a resolve against the locally available gems Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}") - expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, @remote) + expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true) Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms) end end diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index bd579a5f0c2..be0751d9d20 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -249,10 +249,11 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/resolver.rb#L249 end def verify_gemfile_dependencies_are_found!(requirements) - requirements.each do |requirement| + requirements.map! do |requirement| name = requirement.name - next if name == "bundler" - next unless search_for(requirement).empty? + next requirement if name == "bundler" + next requirement unless search_for(requirement).empty? + next unless requirement.current_platform? if (base = @base[name]) && !base.empty? version = base.first.version @@ -266,7 +267,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/resolver.rb#L267 message = gem_not_found_message(name, requirement, source_for(name)) end raise GemNotFound, message - end + end.compact! end def gem_not_found_message(name, requirement, source, extra_message = "") diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb index 9e446ff2674..198226207bc 100644 --- a/spec/bundler/commands/binstubs_spec.rb +++ b/spec/bundler/commands/binstubs_spec.rb @@ -182,7 +182,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L182 end context "and the version is older and the same major" do - let(:system_bundler_version) { "2.3.3" } + let(:system_bundler_version) { "2.999.999" } before do lockfile lockfile.gsub(/BUNDLED WITH\n .*$/m, "BUNDLED WITH\n 2.3.0") @@ -191,7 +191,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L191 it "installs and runs the exact version of bundler", :rubygems => ">= 3.3.0.dev" do sys_exec "bin/bundle install --verbose", :artifice => "vcr" expect(exitstatus).not_to eq(42) - expect(out).to include("Bundler 2.3.3 is running, but your lockfile was generated with 2.3.0. Installing Bundler 2.3.0 and restarting using that version.") + expect(out).to include("Bundler 2.999.999 is running, but your lockfile was generated with 2.3.0. Installing Bundler 2.3.0 and restarting using that version.") expect(out).to include("Using bundler 2.3.0") expect(err).not_to include("Activating bundler (~> 2.3.0) failed:") end @@ -199,8 +199,8 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L199 it "runs the available version of bundler", :rubygems => "< 3.3.0.dev" do sys_exec "bin/bundle install --verbose" expect(exitstatus).not_to eq(42) - expect(out).not_to include("Bundler 2.3.3 is running, but your lockfile was generated with 2.3.0. Installing Bundler 2.3.0 and restarting using that version.") - expect(out).to include("Using bundler 2.3.3") + expect(out).not_to include("Bundler 2.999.999 is running, but your lockfile was generated with 2.3.0. Installing Bundler 2.3.0 and restarting using that version.") + expect(out).to include("Using bundler 2.999.999") expect(err).not_to include("Activating bundler (~> 2.3.0) failed:") end end diff --git a/spec/bundler/commands/cache_spec.rb b/spec/bundler/commands/cache_spec.rb index 4f9c1c26c45..356a658e7c7 100644 --- a/spec/bundler/commands/cache_spec.rb +++ b/spec/bundler/commands/cache_spec.rb @@ -403,14 +403,14 @@ RSpec.describe "bundle install with gem sources" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/cache_spec.rb#L403 simulate_new_machine - simulate_platform "ruby" do - install_gemfile <<-G - source "#{file_uri_for(gem_repo1)}" - gem "platform_specific" - G - run "require 'platform_specific' ; puts PLATFORM_SPECIFIC" - expect(out).to eq("1.0.0 RUBY") - end + bundle "config set --local force_ruby_platform true" + + install_gemfile <<-G + source "#{file_uri_for(gem_repo1)}" + gem "platform_specific" + G + run "require 'platform_specific' ; puts PLATFORM_SPECIFIC" + expect(out).to eq("1.0.0 RUBY") end it "does not update the cache if --no-cache is passed" do diff --git a/spec/bundler/commands/clean_spec.rb b/spec/bundler/commands/clean_spec.rb index 65231b35fac..576872b0f6c 100644 --- a/spec/bundler/commands/clean_spec.rb +++ b/spec/bundler/commands/clean_spec.rb @@ -638,7 +638,12 @@ RSpec.describe "bundle clean" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/clean_spec.rb#L638 s.executables = "irb" end - realworld_system_gems "fiddle --version 1.0.8", "tsort --version 0.1.0", "pathname --version 0.1.0", "set --version 1.0.1" + if Gem.win_platform? && RUBY_VERSION < "3.1.0" + default_fiddle_version = ruby "require 'fiddle'; puts Gem.loaded_specs['fiddle'].version" + realworld_system_gems "fiddle --version #{default_fiddle_version}" + end + + realworld_system_gems "tsort --version 0.1.0", "pathname --version 0.1.0", "set --version 1.0.1" install_gemfile <<-G source "#{file_uri_for(gem_repo2)}" diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb index 22709f45286..131b46de0d3 100644 --- a/spec/bundler/commands/lock_spec.rb +++ b/spec/bundler/commands/lock_spec.rb @@ -337,7 +337,8 @@ RSpec.describe "bundle lock" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/lock_spec.rb#L337 #{Bundler::VERSION} G - simulate_platform(rb) { bundle :lock } + bundle "config set --local force_ruby_platform true" + bundle :lock expect(lockfile).to eq <<~G GEM @@ -509,6 +510,11 @@ RSpec.describe "bundle lock" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/lock_spec.rb#L510 s.platform = "x64-mingw32" s.required_ruby_version = "< #{next_minor}.dev" end + + build_gem "raygun-apm", "1.0.78" do |s| + s.platform = "x64-mingw-ucrt" + s.required_ruby_version = "< #{next_minor}.dev" + end end gemfile <<-G diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb index e7cf8f08d2f..6bcfadab7e6 100644 --- a/spec/bundler/install/gemfile/gemspec_spec.rb +++ b/spec/bundler/install/gemfile/gemspec_spec.rb @@ -429,13 +429,16 @@ RSpec.describe "bundle install from an existing gemspec" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/gemspec_spec.rb#L429 gemspec G - simulate_platform("ruby") { bundle "install" } + bundle "config set --local force_ruby_platform true" + bundle "install" + + simulate_new_machine simulate_platform("jruby") { bundle "install" } end context "on ruby" do before do - simulate_platform("ruby") + bundle "config set --local force_ruby_platform true" bundle :install end @@ -546,7 +549,7 @@ RSpec.describe "bundle install from an existing gemspec" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/gemspec_spec.rb#L549 end it "installs the ruby platform gemspec" do - simulate_platform "ruby" + bundle "config set --local force_ruby_platform true" install_gemfile <<-G source "#{file_uri_for( (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/