lib/bundler/definition.rb in bundler-2.5.12 vs lib/bundler/definition.rb in bundler-2.5.13

- old
+ new

@@ -619,15 +619,17 @@ specs end def start_resolution + @platforms |= [local_platform] + result = SpecSet.new(resolver.start) @resolved_bundler_version = result.find {|spec| spec.name == "bundler" }&.version - if @current_ruby_locked_platform && @current_ruby_locked_platform != local_platform + if most_specific_ruby_locked_platform_is_not_local_platform? @platforms.delete(result.incomplete_for_platform?(dependencies, @current_ruby_locked_platform) ? @current_ruby_locked_platform : local_platform) end @platforms = result.add_extra_platforms!(platforms) if should_add_extra_platforms? @@ -665,11 +667,16 @@ end end def add_current_platform @current_ruby_locked_platform = most_specific_locked_platform if current_ruby_platform_locked? + return if most_specific_ruby_locked_platform_is_not_local_platform? add_platform(local_platform) + end + + def most_specific_ruby_locked_platform_is_not_local_platform? + @current_ruby_locked_platform && @current_ruby_locked_platform != local_platform end def change_reason if unlocking? unlock_targets = if @gems_to_unlock.any?