diff --git a/bundler/lib/bundler/resolver.rb b/bundler/lib/bundler/resolver.rb index f031368758e1..926c08c4c966 100644 --- a/bundler/lib/bundler/resolver.rb +++ b/bundler/lib/bundler/resolver.rb @@ -158,10 +158,10 @@ def search_for(dependency) # spec group. sg_ruby = sg.copy_for(Gem::Platform::RUBY) selected_sgs << sg_ruby if sg_ruby - sg_all_platforms = nil all_platforms = @platforms + [platform] - sorted_all_platforms = self.class.sort_platforms(all_platforms) - sorted_all_platforms.reverse_each do |other_platform| + next if all_platforms.to_a == [Gem::Platform::RUBY] + sg_all_platforms = nil + self.class.sort_platforms(all_platforms).reverse_each do |other_platform| if sg_all_platforms.nil? sg_all_platforms = sg.copy_for(other_platform) else diff --git a/bundler/spec/install/gems/resolving_spec.rb b/bundler/spec/install/gems/resolving_spec.rb index 7e10b9fbeedc..f621b0136672 100644 --- a/bundler/spec/install/gems/resolving_spec.rb +++ b/bundler/spec/install/gems/resolving_spec.rb @@ -107,10 +107,13 @@ bundle :install, :env => { "DEBUG_RESOLVER_TREE" => "1" } + activated_groups = "net_b (1.0) (ruby)" + activated_groups += ", net_b (1.0) (#{local_platforms.join(", ")})" if local_platforms.any? && local_platforms != ["ruby"] + expect(err).to include(" net_b"). and include("BUNDLER: Starting resolution"). and include("BUNDLER: Finished resolution"). - and include("Attempting to activate") + and include("Attempting to activate [#{activated_groups}]") end end end