summaryrefslogtreecommitdiff
path: root/lib/bundler/spec_set.rb
diff options
context:
space:
mode:
authorDavid Rodriguez <deivid.rodriguez@riseup.net>2023-11-20 12:20:08 +0100
committergit <svn-admin@ruby-lang.org>2023-11-22 13:17:12 +0000
commitc05495530e0308d82a39bb5b248f711f0a485921 (patch)
tree19f244221d648ab6ff66a52e23d5318a56aed2cc /lib/bundler/spec_set.rb
parent018e6abf8509c7de2a8efb49741d594b15f49fbf (diff)
[rubygems/rubygems] Fix universal lockfiles regression
If a platform specific variant would not match the current Ruby, we would still be considering it compatible with the initial resolution and adding its platform to the lockfile, but we would later fail to materialize it for installation due to not really being compatible. Fix is to only add platforms for variants that are also compatible with current Ruby and RubyGems versions. https://github.com/rubygems/rubygems/commit/75d1290843
Diffstat (limited to 'lib/bundler/spec_set.rb')
-rw-r--r--lib/bundler/spec_set.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb
index f4fc005ef2..a0ef3c2cb5 100644
--- a/lib/bundler/spec_set.rb
+++ b/lib/bundler/spec_set.rb
@@ -64,7 +64,7 @@ module Bundler
valid_platform = lookup.all? do |_, specs|
spec = specs.first
matching_specs = spec.source.specs.search([spec.name, spec.version])
- platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).first
+ platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).find(&:matches_current_metadata?)
if platform_spec
new_specs << LazySpecification.from_spec(platform_spec)