aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/installer/parallel_installer.rb
diff options
context:
space:
mode:
authorDavid Rodriguez <deivid.rodriguez@riseup.net>2023-09-30 21:01:36 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-10-16 13:49:49 +0900
commitcbf2e133c10b87bb7d1f858471e600af6c6e62d1 (patch)
treeecf5636dd15e88381c8843c54df3bade1cc0db2e /lib/bundler/installer/parallel_installer.rb
parent7e51cadc2e3574996f63e4afd235d6f3e19f3a59 (diff)
downloadruby-cbf2e133c10b87bb7d1f858471e600af6c6e62d1.tar.gz
Re-resolve when lockfile is invalid
Move the check for unmet dependencies in lockfile just in time to be able to re-resolve if unmet dependencies are found.
Diffstat (limited to 'lib/bundler/installer/parallel_installer.rb')
-rw-r--r--lib/bundler/installer/parallel_installer.rb26
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/bundler/installer/parallel_installer.rb b/lib/bundler/installer/parallel_installer.rb
index 83a381f592..11a90b36cb 100644
--- a/lib/bundler/installer/parallel_installer.rb
+++ b/lib/bundler/installer/parallel_installer.rb
@@ -91,38 +91,12 @@ module Bundler
install_serially
end
- check_for_unmet_dependencies
-
handle_error if failed_specs.any?
@specs
ensure
worker_pool&.stop
end
- def check_for_unmet_dependencies
- unmet_dependencies = @specs.map do |s|
- [
- s,
- s.dependencies.reject {|dep| @specs.any? {|spec| dep.matches_spec?(spec.spec) } },
- ]
- end.reject {|a| a.last.empty? }
- return if unmet_dependencies.empty?
-
- warning = []
- warning << "Your lockfile doesn't include a valid resolution."
- warning << "You can fix this by regenerating your lockfile or manually editing the bad locked gems to a version that satisfies all dependencies."
- warning << "The unmet dependencies are:"
-
- unmet_dependencies.each do |spec, unmet_spec_dependencies|
- unmet_spec_dependencies.each do |unmet_spec_dependency|
- found = @specs.find {|s| s.name == unmet_spec_dependency.name && !unmet_spec_dependency.matches_spec?(s.spec) }
- warning << "* #{unmet_spec_dependency}, dependency of #{spec.full_name}, unsatisfied by #{found.full_name}"
- end
- end
-
- Bundler.ui.warn(warning.join("\n"))
- end
-
private
def failed_specs