summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-03-02 20:38:16 +0900
committerNARUSE, Yui <nurse@users.noreply.github.com>2021-03-11 17:24:52 +0900
commit06cd5711e0afc6302052e847863a7fdcc42fe692 (patch)
tree8f6648b83525ce83132075f8fff151aab4d95b4a /lib
parentf375bc77d2f347dd2a44705b8abd29398feae427 (diff)
Merge RubyGems-3.2.12 and Bundler-2.2.12
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/definition.rb2
-rw-r--r--lib/bundler/installer.rb2
-rw-r--r--lib/bundler/rubygems_gem_installer.rb47
-rw-r--r--lib/bundler/stub_specification.rb8
-rw-r--r--lib/bundler/version.rb2
-rw-r--r--lib/rubygems.rb2
6 files changed, 60 insertions, 3 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 3c25149d33..3264cb074c 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -594,7 +594,7 @@ module Bundler
deps_for_source = @dependencies.select {|s| s.source == source }
locked_deps_for_source = @locked_deps.values.select {|dep| dep.source == locked_source }
- deps_for_source.sort != locked_deps_for_source.sort
+ deps_for_source.uniq.sort != locked_deps_for_source.sort
end
def specs_for_source_changed?(source)
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index 8d55784006..09c8b1c157 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -89,6 +89,8 @@ module Bundler
end
install(options)
+ Gem::Specification.reset # invalidate gem specification cache so that installed gems are immediately available
+
lock unless Bundler.frozen_bundle?
Standalone.new(options[:standalone], @definition).generate if options[:standalone]
end
diff --git a/lib/bundler/rubygems_gem_installer.rb b/lib/bundler/rubygems_gem_installer.rb
index cd5eb152f9..f5f3c53309 100644
--- a/lib/bundler/rubygems_gem_installer.rb
+++ b/lib/bundler/rubygems_gem_installer.rb
@@ -8,6 +8,53 @@ module Bundler
# Bundler needs to install gems regardless of binstub overwriting
end
+ def install
+ pre_install_checks
+
+ run_pre_install_hooks
+
+ spec.loaded_from = spec_file
+
+ # Completely remove any previous gem files
+ FileUtils.rm_rf gem_dir
+ FileUtils.rm_rf spec.extension_dir
+
+ FileUtils.mkdir_p gem_dir, :mode => 0o755
+
+ extract_files
+
+ build_extensions
+ write_build_info_file
+ run_post_build_hooks
+
+ generate_bin
+ generate_plugins
+
+ write_spec
+ write_cache_file
+
+ say spec.post_install_message unless spec.post_install_message.nil?
+
+ run_post_install_hooks
+
+ spec
+ end
+
+ def generate_plugins
+ return unless Gem::Installer.instance_methods(false).include?(:generate_plugins)
+
+ latest = Gem::Specification.stubs_for(spec.name).first
+ return if latest && latest.version > spec.version
+
+ ensure_writable_dir @plugins_dir
+
+ if spec.plugins.empty?
+ remove_plugins_for(spec, @plugins_dir)
+ else
+ regenerate_plugins_for(spec, @plugins_dir)
+ end
+ end
+
def pre_install_checks
super && validate_bundler_checksum(options[:bundler_expected_checksum])
end
diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb
index 2456d268da..fa071901e5 100644
--- a/lib/bundler/stub_specification.rb
+++ b/lib/bundler/stub_specification.rb
@@ -26,11 +26,19 @@ module Bundler
# @!group Stub Delegates
+ def manually_installed?
+ # This is for manually installed gems which are gems that were fixed in place after a
+ # failed installation. Once the issue was resolved, the user then manually created
+ # the gem specification using the instructions provided by `gem help install`
+ installed_by_version == Gem::Version.new(0)
+ end
+
# This is defined directly to avoid having to loading the full spec
def missing_extensions?
return false if default_gem?
return false if extensions.empty?
return false if File.exist? gem_build_complete_path
+ return false if manually_installed?
true
end
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb
index 64c46ddb25..ef8a25a2ae 100644
--- a/lib/bundler/version.rb
+++ b/lib/bundler/version.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: false
module Bundler
- VERSION = "2.2.11".freeze
+ VERSION = "2.2.12".freeze
def self.bundler_major_version
@bundler_major_version ||= VERSION.split(".").first.to_i
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index d5f6356822..c6c80637e7 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -8,7 +8,7 @@
require 'rbconfig'
module Gem
- VERSION = "3.2.11".freeze
+ VERSION = "3.2.12".freeze
end
# Must be first since it unloads the prelude from 1.9.2