ruby-changes:69849
From: Hiroshi <ko1@a...>
Date: Mon, 22 Nov 2021 10:51:58 +0900 (JST)
Subject: [ruby-changes:69849] e27381d289 (ruby_3_0): Merge RubyGems 3.2.30 and Bundler 2.2.30
https://git.ruby-lang.org/ruby.git/commit/?id=e27381d289 From e27381d289cbdbdca434bcc957c2cd1beab1c82c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Thu, 11 Nov 2021 11:00:30 +0900 Subject: Merge RubyGems 3.2.30 and Bundler 2.2.30 --- lib/bundler.rb | 3 +- lib/bundler/cli/info.rb | 15 +- lib/bundler/cli/issue.rb | 7 +- lib/bundler/compact_index_client.rb | 4 +- lib/bundler/definition.rb | 16 +- lib/bundler/digest.rb | 71 ++++ lib/bundler/errors.rb | 20 +- lib/bundler/fetcher.rb | 3 +- lib/bundler/friendly_errors.rb | 35 +- lib/bundler/gem_helper.rb | 21 +- lib/bundler/rubygems_ext.rb | 4 + lib/bundler/rubygems_gem_installer.rb | 24 +- lib/bundler/rubygems_integration.rb | 35 +- lib/bundler/runtime.rb | 2 +- lib/bundler/source/git.rb | 4 +- lib/bundler/source/rubygems.rb | 106 ++--- .../vendor/connection_pool/lib/connection_pool.rb | 113 ++---- .../lib/connection_pool/monotonic_time.rb | 66 ---- .../lib/connection_pool/timed_stack.rb | 40 +- .../connection_pool/lib/connection_pool/version.rb | 2 +- .../connection_pool/lib/connection_pool/wrapper.rb | 57 +++ lib/bundler/version.rb | 2 +- lib/bundler/worker.rb | 4 +- lib/rubygems.rb | 4 +- lib/rubygems/commands/cert_command.rb | 19 +- lib/rubygems/commands/setup_command.rb | 2 +- lib/rubygems/core_ext/tcpsocket_init.rb | 4 +- lib/rubygems/installer.rb | 2 +- lib/rubygems/package.rb | 58 ++- lib/rubygems/query_utils.rb | 8 +- lib/rubygems/remote_fetcher.rb | 4 +- lib/rubygems/request.rb | 2 + lib/rubygems/request/connection_pools.rb | 2 +- lib/rubygems/request/http_pool.rb | 2 +- lib/rubygems/request_set.rb | 2 +- lib/rubygems/s3_uri_signer.rb | 9 +- lib/rubygems/security.rb | 64 ++- lib/rubygems/security/policy.rb | 8 +- lib/rubygems/security/signer.rb | 7 +- lib/rubygems/source.rb | 2 +- lib/rubygems/source/git.rb | 4 +- lib/rubygems/specification.rb | 2 +- lib/rubygems/user_interaction.rb | 2 +- lib/rubygems/util.rb | 2 +- spec/bundler/bundler/definition_spec.rb | 3 +- spec/bundler/bundler/digest_spec.rb | 17 + spec/bundler/bundler/gem_helper_spec.rb | 2 +- spec/bundler/bundler/rubygems_integration_spec.rb | 12 +- spec/bundler/cache/gems_spec.rb | 24 +- spec/bundler/commands/binstubs_spec.rb | 2 +- spec/bundler/commands/clean_spec.rb | 2 +- spec/bundler/commands/info_spec.rb | 10 +- spec/bundler/commands/install_spec.rb | 181 +++++++++ spec/bundler/install/gemfile/git_spec.rb | 4 +- spec/bundler/install/gemspecs_spec.rb | 4 +- spec/bundler/install/global_cache_spec.rb | 16 +- spec/bundler/lock/lockfile_spec.rb | 3 +- spec/bundler/runtime/platform_spec.rb | 3 +- spec/bundler/runtime/setup_spec.rb | 35 ++ .../support/artifice/compact_index_rate_limited.rb | 2 +- spec/bundler/support/artifice/endpoint.rb | 2 +- spec/bundler/support/builders.rb | 14 +- spec/bundler/support/platforms.rb | 6 +- spec/bundler/update/git_spec.rb | 4 +- test/rubygems/helper.rb | 14 +- test/rubygems/private_ec_key.pem | 9 + test/rubygems/test_gem.rb | 130 +++---- test/rubygems/test_gem_commands_cert_command.rb | 67 +++- test/rubygems/test_gem_package.rb | 53 +-- test/rubygems/test_gem_security.rb | 36 +- test/rubygems/test_gem_specification.rb | 432 ++++++++++----------- tool/bundler/rubocop_gems.rb.lock | 2 +- tool/bundler/test_gems.rb.lock | 2 +- 73 files changed, 1147 insertions(+), 807 deletions(-) create mode 100644 lib/bundler/digest.rb delete mode 100644 lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb create mode 100644 lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb create mode 100644 spec/bundler/bundler/digest_spec.rb create mode 100644 test/rubygems/private_ec_key.pem diff --git a/lib/bundler.rb b/lib/bundler.rb index a7676cd497b..1ab87ac2995 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -37,12 +37,13 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler.rb#L37 environment_preserver = EnvironmentPreserver.from_env ORIGINAL_ENV = environment_preserver.restore environment_preserver.replace_with_backup - SUDO_MUTEX = Mutex.new + SUDO_MUTEX = Thread::Mutex.new 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__) autoload :EndpointSpecification, File.expand_path("bundler/endpoint_specification", __dir__) autoload :Env, File.expand_path("bundler/env", __dir__) diff --git a/lib/bundler/cli/info.rb b/lib/bundler/cli/info.rb index 3111b64a33a..3afed89cebf 100644 --- a/lib/bundler/cli/info.rb +++ b/lib/bundler/cli/info.rb @@ -40,12 +40,13 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/info.rb#L40 end def print_gem_path(spec) - if spec.name == "bundler" + name = spec.name + if name == "bundler" path = File.expand_path("../../../..", __FILE__) else path = spec.full_gem_path - unless File.directory?(path) - return Bundler.ui.warn "The gem #{gem_name} has been deleted. It was installed at: #{path}" + if spec.deleted_gem? + return Bundler.ui.warn "The gem #{name} has been deleted. It was installed at: #{path}" end end @@ -54,8 +55,9 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/info.rb#L55 def print_gem_info(spec) metadata = spec.metadata + name = spec.name gem_info = String.new - gem_info << " * #{spec.name} (#{spec.version}#{spec.git_version})\n" + gem_info << " * #{name} (#{spec.version}#{spec.git_version})\n" gem_info << "\tSummary: #{spec.summary}\n" if spec.summary gem_info << "\tHomepage: #{spec.homepage}\n" if spec.homepage gem_info << "\tDocumentation: #{metadata["documentation_uri"]}\n" if metadata.key?("documentation_uri") @@ -67,6 +69,11 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/info.rb#L69 gem_info << "\tMailing List: #{metadata["mailing_list_uri"]}\n" if metadata.key?("mailing_list_uri") gem_info << "\tPath: #{spec.full_gem_path}\n" gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem? + + if spec.deleted_gem? + return Bundler.ui.warn "The gem #{name} has been deleted. Gemspec information is still available though:\n#{gem_info}" + end + Bundler.ui.info gem_info end end diff --git a/lib/bundler/cli/issue.rb b/lib/bundler/cli/issue.rb index f4cd5ac4df6..b891ecb1d2b 100644 --- a/lib/bundler/cli/issue.rb +++ b/lib/bundler/cli/issue.rb @@ -20,9 +20,10 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/issue.rb#L20 Hopefully the troubleshooting steps above resolved your problem! If things still aren't working the way you expect them to, please let us know so - that we can diagnose and help fix the problem you're having. Please - view the Filing Issues guide for more information: - https://github.com/rubygems/rubygems/blob/master/bundler/doc/contributing/ISSUES.md + that we can diagnose and help fix the problem you're having, by filling + in the new issue form located at + https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md, + and copy and pasting the information below. EOS diff --git a/lib/bundler/compact_index_client.rb b/lib/bundler/compact_index_client.rb index cf67f0e7a05..d5dbeb3b108 100644 --- a/lib/bundler/compact_index_client.rb +++ b/lib/bundler/compact_index_client.rb @@ -5,7 +5,7 @@ require "set" https://github.com/ruby/ruby/blob/trunk/lib/bundler/compact_index_client.rb#L5 module Bundler class CompactIndexClient - DEBUG_MUTEX = Mutex.new + DEBUG_MUTEX = Thread::Mutex.new def self.debug return unless ENV["DEBUG_COMPACT_INDEX"] DEBUG_MUTEX.synchronize { warn("[#{self}] #{yield}") } @@ -25,7 +25,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/compact_index_client.rb#L25 @endpoints = Set.new @info_checksums_by_name = {} @parsed_checksums = false - @mutex = Mutex.new + @mutex = Thread::Mutex.new end def execution_m (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/