[ruby/rubygems] Pass locked_platforms by keyword to candidate_platforms

Keeps the locked platform argument keyworded along the whole
resolve_best_platform path instead of switching to a positional at the
last hop.

https://github.com/ruby/rubygems/commit/1d5f35ad0e

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hiroshi SHIBATA 2026-06-25 11:37:00 +09:00 committed by git
parent fc013062f9
commit c818da03e6

View File

@ -192,7 +192,7 @@ module Bundler
end
def find_compatible_platform_spec(specs, locked_platforms: nil)
candidate_platforms(locked_platforms).each do |plat|
candidate_platforms(locked_platforms: locked_platforms).each do |plat|
candidates = MatchPlatform.select_best_platform_match(specs, plat)
spec = choose_compatible(candidates, fallback_to_non_installable: false)
return spec if spec
@ -204,7 +204,7 @@ module Bundler
# requires compilation, but works when precompiled gems are incompatible.
# When a set of locked platforms is given (frozen mode), restrict the
# candidates to those, so we never materialize a platform that wasn't locked.
def candidate_platforms(locked_platforms = nil)
def candidate_platforms(locked_platforms: nil)
target = source.is_a?(Source::Path) ? platform : Bundler.local_platform
platforms = [target, platform, Gem::Platform::RUBY].uniq
return platforms unless locked_platforms