From 9f8c907c3369d98a5488066c44521d465bce271c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 13 Oct 2020 20:48:28 +0200 Subject: [PATCH] Probably better fix to previous issue With specific platforms by default, it sounds like we can fix a previous "duplicated spec groups" issue by calling uniq on the array of definition platforms. --- bundler/lib/bundler/definition.rb | 2 +- bundler/lib/bundler/resolver.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bundler/lib/bundler/definition.rb b/bundler/lib/bundler/definition.rb index 3df6b974823c..02dc4d3cc13c 100644 --- a/bundler/lib/bundler/definition.rb +++ b/bundler/lib/bundler/definition.rb @@ -561,7 +561,7 @@ def add_platforms end def current_platforms - [local_platform, generic_local_platform] + [local_platform, generic_local_platform].uniq end def change_reason diff --git a/bundler/lib/bundler/resolver.rb b/bundler/lib/bundler/resolver.rb index 926c08c4c966..2cbf8a925c72 100644 --- a/bundler/lib/bundler/resolver.rb +++ b/bundler/lib/bundler/resolver.rb @@ -158,9 +158,8 @@ def search_for(dependency) # spec group. sg_ruby = sg.copy_for(Gem::Platform::RUBY) selected_sgs << sg_ruby if sg_ruby - all_platforms = @platforms + [platform] - next if all_platforms.to_a == [Gem::Platform::RUBY] sg_all_platforms = nil + all_platforms = @platforms + [platform] self.class.sort_platforms(all_platforms).reverse_each do |other_platform| if sg_all_platforms.nil? sg_all_platforms = sg.copy_for(other_platform)