diff options
author | David Rodriguez <deivid.rodriguez@riseup.net> | 2023-09-30 21:01:36 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-10-16 13:49:49 +0900 |
commit | cbf2e133c10b87bb7d1f858471e600af6c6e62d1 (patch) | |
tree | ecf5636dd15e88381c8843c54df3bade1cc0db2e /lib/bundler/installer/parallel_installer.rb | |
parent | 7e51cadc2e3574996f63e4afd235d6f3e19f3a59 (diff) | |
download | ruby-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.rb | 26 |
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 |