From 217d53b0a6db31927bd1e2325e9385c267eedb8a Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 7 May 2026 18:56:28 +0900 Subject: [ruby/rubygems] Unlock every locked spec when an :all override is present An :all override applies to every gem's metadata, so we have no way to know which locked entries it affects without re-resolving. Force-unlock them all when an :all override appears so the resolver gets a fresh chance to apply the override. https://github.com/ruby/rubygems/commit/4f61f6813e Co-Authored-By: Claude Opus 4.7 (1M context) --- lib/bundler/definition.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 7f5a72f0eb..aa21b5eb01 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -1061,6 +1061,11 @@ module Bundler def converge_overrides_outside_dependencies @overrides.each do |override| + if override.target == :all + unlock_all_locked_specs_for_override + next + end + next unless override.target.is_a?(String) name = override.target @@ -1076,6 +1081,15 @@ module Bundler end end + def unlock_all_locked_specs_for_override + @originally_locked_specs.each do |locked_spec| + name = locked_spec.name + next if @changed_dependencies.include?(name) + @gems_to_unlock << name + @changed_dependencies << name + end + end + # Remove elements from the locked specs that are expired. This will most # commonly happen if the Gemfile has changed since the lockfile was last # generated -- cgit v1.2.3