Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Inconsistent evaluation of "~>" depending on whether it is a binding constraint or has slack #1113

Closed
hedgehog opened this issue Apr 7, 2011 · 3 comments

Comments

@hedgehog
Copy link

hedgehog commented Apr 7, 2011

With Chef 0.9.14 installed this Gemfile has cucumber introduced into it:

gem 'chef', "~>0.9.14"
gem "cucumber", ">= 0"

and is processed by bundle update and you'll see the correct error:

Bundler could not find compatible versions for gem "json":
  In Gemfile:
    chef (~> 0.9.14) depends on
      json (<= 1.4.6, >= 1.4.4)

    aruba (~> 0.3.5) depends on
      json (1.5.1)

However, if you update the Gemfile in the following way:

gem 'chef', "~>0.9.12"
gem "cucumber", ">= 0"

then you can side step the json gem restriction and bundle update runs with out complaint - bug.

@indirect
Copy link
Member

indirect commented Jun 1, 2011

Your two example Gemfiles are identical, perhaps the description has a typo?

@hedgehog
Copy link
Author

hedgehog commented Jun 2, 2011

No they are not identical. My mistake was assuming everyone knows what binding and slack constraints are. The critical difference is that the change of value to 0.9.12 means the constraint ~>0.9.12 has slack when the latest is 0.9.14. When the the constraint value is 0.9.14 it is binding. Hope that explains better what is going on?

HTH?

@mscottford
Copy link

I'm having trouble reproducing this. https://gist.github.com/4689100 @hedgehog Do you know of a Gemfile that will reproduce this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants