diff options
| author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2026-05-07 20:38:58 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-05-08 06:43:46 +0000 |
| commit | 7988b2c524e7b86a30945919d61ee54b23bf5486 (patch) | |
| tree | ccbf80e76ab0f5bdae79bbb29040b40a417f5468 | |
| parent | dff3200e5ca078977a40d92ad4236b9c8d60499e (diff) | |
[ruby/rubygems] Propagate overrides into Definition#resolve lockfile-reuse paths
Definition#resolve falls back to an existing lockfile when nothing
about the Gemfile or the locked deps changed. The two SpecSet rebuild
paths (deleted_deps subset and the redundant-platform-specific-gems
fallback) constructed fresh SpecSet instances without carrying
@overrides forward, so any LazySpec produced from them lost its
override context. After Step G that mattered: an :all metadata
override does not pre-unlock anything by design, which means it must
flow through these reuse paths intact.
Without it, the materialize layer either silently re-resolved (which
churns the lockfile) or, on the install-time check, fell back to the
spec's strict required_ruby_version metadata. Calling with_overrides
on both rebuilt SpecSets keeps the install-time behavior consistent
across resolve and lockfile-reuse paths.
https://github.com/ruby/rubygems/commit/81fb91a8b1
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| -rw-r--r-- | lib/bundler/definition.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 2aa74804ba..45c6e9a693 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -338,11 +338,11 @@ module Bundler elsif no_resolve_needed? if deleted_deps.any? Bundler.ui.debug "Some dependencies were deleted, using a subset of the resolution from the lockfile" - SpecSet.new(filter_specs(@locked_specs, @dependencies - deleted_deps)) + SpecSet.new(filter_specs(@locked_specs, @dependencies - deleted_deps)).with_overrides(@overrides) else Bundler.ui.debug "Found no changes, using resolution from the lockfile" if @removed_platforms.any? || @locked_gems.may_include_redundant_platform_specific_gems? - SpecSet.new(filter_specs(@locked_specs, @dependencies)) + SpecSet.new(filter_specs(@locked_specs, @dependencies)).with_overrides(@overrides) else @locked_specs end |
