diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-02-15 14:29:11 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-02-15 14:29:11 -0600 |
commit | f3e44c1cdce8c6baad67af6323a9fd44c5f42411 (patch) | |
tree | dfd7860598bd9497f09947dbf15cb132e5d9890f /lib/bundler/lazy_specification.rb | |
parent | 573d6f8ac64d604d71e78933117716b4ca77833f (diff) | |
download | bundler-f3e44c1cdce8c6baad67af6323a9fd44c5f42411.tar.gz |
[LazySpecification] Handle when the swapped platform-specfic spec has extra deps
Diffstat (limited to 'lib/bundler/lazy_specification.rb')
-rw-r--r-- | lib/bundler/lazy_specification.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb index 7508347c32..b7dddcbf35 100644 --- a/lib/bundler/lazy_specification.rb +++ b/lib/bundler/lazy_specification.rb @@ -73,7 +73,14 @@ module Bundler @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name source.gemspec.tap {|s| s.source = source } else - source.specs.search(search_object).last + search = source.specs.search(search_object).last + if search.platform != platform && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty? + Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \ + "because it has different dependencies from the #{platform} version. " \ + "To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again." + search = source.specs.search(self).last + end + search end end |