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

ruby-changes:74088

From: Hiroshi <ko1@a...>
Date: Tue, 18 Oct 2022 16:33:46 +0900 (JST)
Subject: [ruby-changes:74088] f5df47d1f3 (master): Merge RubyGems/Bundler master

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

From f5df47d1f3ec403d057f823375f1dfeea711caa6 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Tue, 18 Oct 2022 15:24:42 +0900
Subject: Merge RubyGems/Bundler master

  https://github.com/rubygems/rubygems/commit/6214d00b2315ed37c76b1fbc1c72f61f92ba5a65
---
 lib/bundler.rb                                    |  1 -
 lib/bundler/definition.rb                         | 10 +--
 lib/bundler/dep_proxy.rb                          | 55 ----------------
 lib/bundler/endpoint_specification.rb             |  4 ++
 lib/bundler/index.rb                              |  1 -
 lib/bundler/lazy_specification.rb                 |  9 +--
 lib/bundler/remote_specification.rb               |  8 ++-
 lib/bundler/resolver.rb                           | 76 +++++++----------------
 lib/bundler/resolver/base.rb                      |  2 +-
 lib/bundler/resolver/spec_group.rb                | 52 ++++++----------
 spec/bundler/bundler/dep_proxy_spec.rb            | 32 ----------
 spec/bundler/bundler/gem_version_promoter_spec.rb |  2 +-
 spec/bundler/bundler/remote_specification_spec.rb |  2 +-
 spec/bundler/install/gems/resolving_spec.rb       |  2 +-
 spec/bundler/install/yanked_spec.rb               | 66 ++++++++++++++++++++
 spec/bundler/realworld/slow_perf_spec.rb          | 17 +++++
 spec/bundler/resolver/basic_spec.rb               |  7 +--
 spec/bundler/support/indexes.rb                   |  8 +--
 test/rubygems/alternate_cert.pem                  | 28 ++++-----
 test/rubygems/alternate_cert_32.pem               | 30 ++++-----
 test/rubygems/alternate_key.pem                   | 50 +++++++--------
 test/rubygems/child_cert.pem                      | 31 +++++----
 test/rubygems/child_cert_32.pem                   | 31 +++++----
 test/rubygems/child_key.pem                       | 50 +++++++--------
 test/rubygems/encrypted_private_key.pem           | 52 ++++++++--------
 test/rubygems/expired_cert.pem                    | 30 ++++-----
 test/rubygems/future_cert.pem                     | 30 ++++-----
 test/rubygems/future_cert_32.pem                  | 30 ++++-----
 test/rubygems/grandchild_cert.pem                 | 31 +++++----
 test/rubygems/grandchild_cert_32.pem              | 31 +++++----
 test/rubygems/grandchild_key.pem                  | 50 +++++++--------
 test/rubygems/invalid_issuer_cert.pem             | 32 +++++-----
 test/rubygems/invalid_issuer_cert_32.pem          | 32 +++++-----
 test/rubygems/invalid_key.pem                     | 50 +++++++--------
 test/rubygems/invalid_signer_cert.pem             | 30 ++++-----
 test/rubygems/invalid_signer_cert_32.pem          | 30 ++++-----
 test/rubygems/invalidchild_cert.pem               | 31 +++++----
 test/rubygems/invalidchild_cert_32.pem            | 31 +++++----
 test/rubygems/invalidchild_key.pem                | 50 +++++++--------
 test/rubygems/private_key.pem                     | 50 +++++++--------
 test/rubygems/public_cert.pem                     | 32 +++++-----
 test/rubygems/public_cert_32.pem                  | 30 ++++-----
 test/rubygems/public_key.pem                      | 14 ++---
 test/rubygems/wrong_key_cert.pem                  | 30 ++++-----
 test/rubygems/wrong_key_cert_32.pem               | 30 ++++-----
 45 files changed, 613 insertions(+), 687 deletions(-)
 delete mode 100644 lib/bundler/dep_proxy.rb
 delete mode 100644 spec/bundler/bundler/dep_proxy_spec.rb

diff --git a/lib/bundler.rb b/lib/bundler.rb
index dc88bbdcb9..1a94e0c963 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -41,7 +41,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler.rb#L41
 
   autoload :Definition,             File.expand_path("bundler/definition", __dir__)
   autoload :Dependency,             File.expand_path("bundler/dependency", __dir__)
-  autoload :DepProxy,               File.expand_path("bundler/dep_proxy", __dir__)
   autoload :Deprecate,              File.expand_path("bundler/deprecate", __dir__)
   autoload :Digest,                 File.expand_path("bundler/digest", __dir__)
   autoload :Dsl,                    File.expand_path("bundler/dsl", __dir__)
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index a3042e06a3..95be7a7e27 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -479,7 +479,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/definition.rb#L479
     end
 
     def expanded_dependencies
-      @expanded_dependencies ||= expand_dependencies(dependencies + metadata_dependencies)
+      @expanded_dependencies ||= dependencies + metadata_dependencies
     end
 
     def filter_specs(specs, deps)
@@ -791,14 +791,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/definition.rb#L791
       ]
     end
 
-    def expand_dependencies(dependencies)
-      dependencies.flat_map do |dep|
-        dep.gem_platforms(@platforms).map do |p|
-          DepProxy.get_proxy(dep, p)
-        end
-      end
-    end
-
     def source_requirements
       # Record the specs available in each gem's source, so that those
       # specs will be available later when the resolver knows where to
diff --git a/lib/bundler/dep_proxy.rb b/lib/bundler/dep_proxy.rb
deleted file mode 100644
index a32dc37b49..0000000000
--- a/lib/bundler/dep_proxy.rb
+++ /dev/null
@@ -1,55 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/lib/bundler/definition.rb#L0
-# frozen_string_literal: true
-
-module Bundler
-  class DepProxy
-    attr_reader :__platform, :dep
-
-    @proxies = {}
-
-    def self.get_proxy(dep, platform)
-      @proxies[[dep, platform]] ||= new(dep, platform).freeze
-    end
-
-    def initialize(dep, platform)
-      @dep = dep
-      @__platform = platform
-    end
-
-    private_class_method :new
-
-    alias_method :eql?, :==
-
-    def type
-      @dep.type
-    end
-
-    def name
-      @dep.name
-    end
-
-    def requirement
-      @dep.requirement
-    end
-
-    def to_s
-      s = name.dup
-      s << " (#{requirement})" unless requirement == Gem::Requirement.default
-      s << " #{__platform}" unless __platform == Gem::Platform::RUBY
-      s
-    end
-
-    def dup
-      raise NoMethodError.new("DepProxy cannot be duplicated")
-    end
-
-    def clone
-      raise NoMethodError.new("DepProxy cannot be cloned")
-    end
-
-    private
-
-    def method_missing(*args, &blk)
-      @dep.send(*args, &blk)
-    end
-  end
-end
diff --git a/lib/bundler/endpoint_specification.rb b/lib/bundler/endpoint_specification.rb
index 863544b1f9..d315d1cc68 100644
--- a/lib/bundler/endpoint_specification.rb
+++ b/lib/bundler/endpoint_specification.rb
@@ -26,6 +26,10 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/endpoint_specification.rb#L26
       @platform
     end
 
+    def identifier
+      @__identifier ||= [name, version, platform.to_s]
+    end
+
     # needed for standalone, load required_paths from local gemspec
     # after the gem is installed
     def require_paths
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index d3743adb68..ed16c90a3a 100644
--- a/lib/bundler/index.rb
+++ b/lib/bundler/index.rb
@@ -71,7 +71,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/index.rb#L71
       when Gem::Specification, RemoteSpecification, LazySpecification, EndpointSpecification then search_by_spec(query)
       when String then specs_by_name(query)
       when Gem::Dependency then search_by_dependency(query)
-      when DepProxy then search_by_dependency(query.dep)
       else
         raise "You can't search for a #{query.inspect}."
       end
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index 7100d822b4..f5fe2e64ae 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -120,7 +120,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/lazy_specification.rb#L120
     end
 
     def identifier
-      @__identifier ||= [name, version, platform_string]
+      @__identifier ||= [name, version, platform.to_s]
     end
 
     def git_version
@@ -128,13 +128,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/lazy_specification.rb#L128
       " #{source.revision[0..6]}"
     end
 
-    protected
-
-    def platform_string
-      platform_string = platform.to_s
-      platform_string == Index::RUBY ? Index::NULL : platform_string
-    end
-
     private
 
     def to_ary
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb
index 601957746f..34d7fd116c 100644
--- a/lib/bundler/remote_specification.rb
+++ b/lib/bundler/remote_specification.rb
@@ -29,11 +29,15 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/remote_specification.rb#L29
       @platform = _remote_specification.platform
     end
 
+    def identifier
+      @__identifier ||= [name, version, @platform.to_s]
+    end
+
     def full_name
-      if @original_platform == Gem::Platform::RUBY
+      if @platform == Gem::Platform::RUBY
         "#{@name}-#{@version}"
       else
-        "#{@name}-#{@version}-#{@original_platform}"
+        "#{@name}-#{@version}-#{@platform}"
       end
     end
 
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 80ad39e896..115c5cfcc4 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -8,22 +8,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/resolver.rb#L8
 
     include GemHelpers
 
-    # Figures out the best possible configuration of gems that satisfies
-    # the list of passed dependencies and any child dependencies without
-    # causing any gem activation errors.
-    #
-    # ==== Parameters
-    # *dependencies<Gem::Dependency>:: The list of dependencies to resolve
-    #
-    # ==== Returns
-    # <GemBundle>,nil:: If the list of dependencies can be resolved, a
-    #   collection of gemspecs is returned. Otherwise, nil is returned.
-    def self.resolve(requirements, source_requirem (... truncated)

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

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