summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2025-04-12 18:02:51 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2025-04-15 16:47:18 +0900
commit806fbb1e477c4e70f3239a117a31ccef13f7aa2d (patch)
tree0d0e4f64d6c87136b0d6ca2038bacfcfe62b48fe /lib
parent3cb573ee55f3d3af03f3a232ba442bd949277f17 (diff)
[rubygems/rubygems] Comparing platforms is only needed for dependency validation
If we materialized to a different platform, then the dependencies may actually be different so the validation does not really make sense. https://github.com/rubygems/rubygems/commit/68fad98e6f
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/lazy_specification.rb22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index b9c6070005..94a5b21e3d 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -215,16 +215,18 @@ module Bundler
search = candidates.last
end
- if search && search.platform == platform
- # We don't validate locally installed dependencies but accept what's in
- # the lockfile instead for performance, since loading locally installed
- # dependencies would mean evaluating all gemspecs, which would affect
- # `bundler/setup` performance
- if search.is_a?(StubSpecification)
- search.dependencies = dependencies
- else
- if !source.is_a?(Source::Path) && search.runtime_dependencies.sort != dependencies.sort
- raise IncorrectLockfileDependencies.new(self)
+ if search
+ if search.platform == platform
+ # We don't validate locally installed dependencies but accept what's in
+ # the lockfile instead for performance, since loading locally installed
+ # dependencies would mean evaluating all gemspecs, which would affect
+ # `bundler/setup` performance
+ if search.is_a?(StubSpecification)
+ search.dependencies = dependencies
+ else
+ if !source.is_a?(Source::Path) && search.runtime_dependencies.sort != dependencies.sort
+ raise IncorrectLockfileDependencies.new(self)
+ end
end
end