diff options
author | Sutou Kouhei <kou@clear-code.com> | 2019-12-30 06:36:42 +0900 |
---|---|---|
committer | Sutou Kouhei <kou@clear-code.com> | 2020-01-15 06:27:03 +0900 |
commit | 22857e2d63b700077b33398b0ae86201d06ebc79 (patch) | |
tree | a3af1895e0b43f5af5c2f432c01716966a8542fe /spec | |
parent | 121305c0655dde7de600e62150f053c07d3dade5 (diff) | |
download | bundler-22857e2d63b700077b33398b0ae86201d06ebc79.tar.gz |
Improve platform specific gem resolution
It resolves #6247. This changes includes the patches that add (RSpec)
specs for this situation in #6247.
If there is a platform specific gem but it can't be resolved available
version, Bundler reports an error.
For example,
@index = build_index do
gem "bar", "1.0.0"
gem "foo", "1.0.0"
gem "foo", "1.0.0", "x64-mingw32" do
dep "bar", "< 1"
end
end
dep "foo"
platforms "x64-mingw32"
raises an error because foo-1.0.0-x64-mingw32 requires bar<1 but there
isn't bar<1.
With this change, foo-1.0.0 (no x64-mingw32) is used as
fallback. Because foo-1.0.0 doesn't depend on bar<1.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/resolver/platform_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/resolver/platform_spec.rb b/spec/resolver/platform_spec.rb index 223320fe7b..9a97a2c67c 100644 --- a/spec/resolver/platform_spec.rb +++ b/spec/resolver/platform_spec.rb @@ -54,6 +54,17 @@ RSpec.describe "Resolving platform craziness" do should_resolve_as %w[foo-1.0.0] end + it "prefers the platform specific gem to the ruby version" do + @index = build_index do + gem "foo", "1.0.0" + gem "foo", "1.0.0", "x64-mingw32" + end + dep "foo" + platforms "x64-mingw32" + + should_resolve_as %w[foo-1.0.0-x64-mingw32] + end + it "takes the latest ruby gem if the platform specific gem doesn't match the required_ruby_version" do @index = build_index do gem "foo", "1.0.0" |