diff options
| author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2026-05-07 18:56:28 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-05-08 06:43:41 +0000 |
| commit | 217d53b0a6db31927bd1e2325e9385c267eedb8a (patch) | |
| tree | 58e23a695b1ccc0e871dcbb9e40d332e2e0df147 | |
| parent | 54a07500ef98aac350afaa22fd06be5648807424 (diff) | |
[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) <noreply@anthropic.com>
| -rw-r--r-- | lib/bundler/definition.rb | 14 |
1 files changed, 14 insertions, 0 deletions
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 |
