diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2022-08-02 17:45:28 +0200 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-08-05 16:36:42 +0900 |
commit | 5a9db23734e76c2915f1ccb8f87e992bc831598b (patch) | |
tree | 7ffe7a2bec90b4c77e6e35d2e1b12feb2f13f56b /lib/bundler/definition.rb | |
parent | 73f0573cb3be4e1c7e315ee61833f3c9c3252be9 (diff) | |
download | ruby-5a9db23734e76c2915f1ccb8f87e992bc831598b.tar.gz |
[rubygems/rubygems] Automatically remove "ruby" from lockfile if incomplete
https://github.com/rubygems/rubygems/commit/69d0b4e10b
Diffstat (limited to 'lib/bundler/definition.rb')
-rw-r--r-- | lib/bundler/definition.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 34c23796e8..ccb3ab1cec 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -484,6 +484,7 @@ module Bundler def reresolve last_resolve = converge_locked_specs + remove_ruby_from_platforms_if_necessary!(dependencies) expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true) Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms) end @@ -865,6 +866,17 @@ module Bundler end end + def remove_ruby_from_platforms_if_necessary!(dependencies) + return if Bundler.frozen_bundle? || + Bundler.local_platform == Gem::Platform::RUBY || + !platforms.include?(Gem::Platform::RUBY) || + (@new_platform && platforms.last == Gem::Platform::RUBY) || + !@originally_locked_specs.incomplete_ruby_specs?(dependencies) + + remove_platform(Gem::Platform::RUBY) + add_current_platform + end + def source_map @source_map ||= SourceMap.new(sources, dependencies, @locked_specs) end |