summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2024-11-18 13:41:41 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-11-26 15:11:05 +0900
commit6386d49f9e2443db8ecb59b9be7ce5b2be9f1cd3 (patch)
tree838edd7315bac4e29b764ae50c2fad6908eabf95 /lib
parent7c9346033197128a40c76dffa1745757132ff623 (diff)
[rubygems/rubygems] Fix development dependencies considered unnecessarily sometimes
When used with `LazySpecification` objects, `SpecSet#for` was incorrectly considering development dependencies. This did not cause any issues because all usages of this method with `LazySpecification`'s are not strict, meaning the pass `check = false` and ignore incomplete specifications. But it was still doing more work than necessary because development dependencies were still added to the `deps` array for processing and then ignored because of not being found in the spec set. Same when converging path specifications and replacing their dependencies. https://github.com/rubygems/rubygems/commit/6afca8a95f
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/definition.rb2
-rw-r--r--lib/bundler/lazy_specification.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index fe6441d5a5..8a81f4cc4f 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -1002,7 +1002,7 @@ module Bundler
if source.instance_of?(Source::Path) || source.instance_of?(Source::Gemspec) || (source.instance_of?(Source::Git) && !@gems_to_unlock.include?(name) && deps.include?(dep))
new_spec = source.specs[s].first
if new_spec
- s.dependencies.replace(new_spec.dependencies)
+ s.runtime_dependencies.replace(new_spec.runtime_dependencies)
else
# If the spec is no longer in the path source, unlock it. This
# commonly happens if the version changed in the gemspec
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index 4c21297b0e..d6bcec22dc 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -15,7 +15,7 @@ module Bundler
def self.from_spec(s)
lazy_spec = new(s.name, s.version, s.platform, s.source)
- lazy_spec.dependencies = s.dependencies
+ lazy_spec.dependencies = s.runtime_dependencies
lazy_spec.required_ruby_version = s.required_ruby_version
lazy_spec.required_rubygems_version = s.required_rubygems_version
lazy_spec