lib/bundler/definition.rb in bundler-2.5.3 vs lib/bundler/definition.rb in bundler-2.5.4

- old
+ new

@@ -310,14 +310,10 @@ Bundler.ui.debug "Found changes from the lockfile, re-resolving dependencies because #{change_reason}" start_resolution end end - def should_complete_platforms? - !lockfile_exists? && generic_local_platform_is_ruby? && !Bundler.settings[:force_ruby_platform] - end - def spec_git_paths sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact end def groups @@ -515,10 +511,14 @@ @unlocking end private + def should_add_extra_platforms? + !lockfile_exists? && generic_local_platform_is_ruby? && !Bundler.settings[:force_ruby_platform] + end + def lockfile_exists? lockfile && File.exist?(lockfile) end def resolver @@ -598,10 +598,12 @@ def start_resolution result = SpecSet.new(resolver.start) @resolved_bundler_version = result.find {|spec| spec.name == "bundler" }&.version - @platforms = result.complete_platforms!(platforms) if should_complete_platforms? + @platforms = result.add_extra_platforms!(platforms) if should_add_extra_platforms? + + result.complete_platforms!(platforms) SpecSet.new(result.for(dependencies, false, @platforms)) end def precompute_source_requirements_for_indirect_dependencies?