summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-11-29 08:13:12 +0000
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-12-11 20:42:18 +0900
commit47c4bbb340be1d09e38dd3f9dcb4bc764d9f09ca (patch)
treeed0718b7b6fefbd0b69c4e0825b6ad8dd099e675 /spec/support
parent45c2679de96d1dd0b762ff5660c1462ee66249c4 (diff)
downloadbundler-47c4bbb340be1d09e38dd3f9dcb4bc764d9f09ca.tar.gz
Auto merge of #6186 - greysteil:treat-release-preference-as-constraint, r=indirect
Resolver: treat dependencies with prerelease versions as slightly constrained Fixes https://github.com/bundler/bundler/issues/6181. In Bundler 1.15.4, the way we checked for pre-releases meant that dependencies with a lot of them sorted as more constrained than those with few/none. When we moved to our updated resolution strategy in 1.16.0 we accidentally lost that behaviour. I'm not wild about this PR, but it fixes the resolver regression. It's unsatisfying because it would be nice to believe the resolver will always resolve performantly, regardless of the sort order thrown at it, but clearly that isn't the case. Conceptually, this can be justified as "when two resolutions are possible, we prefer the one that does not require one dependency to be at a pre-release version". If others are happy with this I can write a test for it.
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/indexes.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/support/indexes.rb b/spec/support/indexes.rb
index 05605195b1..c56d6145a7 100644
--- a/spec/support/indexes.rb
+++ b/spec/support/indexes.rb
@@ -401,5 +401,20 @@ module Spec
gem("d", %w[1.0.0 2.0.0])
end
end
+
+ def optional_prereleases_index
+ build_index do
+ gem("a", %w[1.0.0])
+
+ gem("a", "2.0.0") do
+ dep "b", ">= 2.0.0.pre"
+ end
+
+ gem("b", %w[0.9.0 1.5.0 2.0.0.pre])
+
+ # --- Pre-release support
+ gem "rubygems\0", ["1.3.2"]
+ end
+ end
end
end