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

Unable to resolve dependencies since 1.6.0 #3059

Closed
fphilipe opened this issue Jun 6, 2014 · 5 comments
Closed

Unable to resolve dependencies since 1.6.0 #3059

fphilipe opened this issue Jun 6, 2014 · 5 comments

Comments

@fphilipe
Copy link

fphilipe commented Jun 6, 2014

@dentarg just reported the issue atmos/warden-github#39. The issue is that running bundle on atmos/warden-github@dae6b8e fails with the following error:

$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "addressable":
  In Gemfile:
    webmock (~> 1.9) ruby depends on
      addressable (>= 2.2.7) ruby

    addressable (2.2.0)

I verified that this fails with all versions >= 1.6.0 of bundler but does work with 1.5.3, the last version prior to 1.6.0. Using the latest commit be3c166 also doesn't work.

The output when running bundler v1.5.3 on the repo mentioned above is:

$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using diff-lcs (1.2.5)
Using rake (10.3.2)
Using safe_yaml (1.0.3)
Using docile (1.1.3)
Using addressable (2.2.8)
Using multipart-post (2.0.0)
Using multi_json (1.10.1)
Using uri_template (0.5.3)
Using rack (1.4.5)
Using rspec-mocks (2.99.0)
Using rspec-core (2.99.0)
Using simplecov-html (0.8.0)
Using tilt (1.4.1)
Using yajl-ruby (1.2.1)
Using bundler (1.5.3)
Using crack (0.4.2)
Using rspec-expectations (2.99.0)
Using faraday (0.9.0)
Using rack-protection (1.5.3)
Using rack-test (0.5.7)
Using shotgun (0.9)
Using warden (1.2.3)
Using simplecov (0.8.2)
Using webmock (1.17.4)
Using sinatra (1.4.5)
Using sawyer (0.3.0)
Using rspec (2.99.0)
Using octokit (2.1.1)
Using warden-github (1.0.1) from source at .
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

This is what my environment looks like:

Bundler 1.6.2
Ruby 2.1.2 (2014-05-08 patchlevel 95) [x86_64-darwin13.0]
Rubygems 2.2.2
@indirect
Copy link
Member

indirect commented Jun 6, 2014

@Who828 hey, look, an actual resolver bug! :)

@wyattisimo
Copy link

I'm having an issue that may be related...

Here's my output:

Resolving dependencies...
Bundler could not find compatible versions for gem "hashie":
  In Gemfile:
    foursquare2 (~> 2.0.1) ruby depends on
      hashie (< 3.0.0, >= 1.0) ruby

    grape (~> 0.9.0) ruby depends on
      hashie (3.3.1)

grape 0.9.0 actually requires hashie >= 2.1.0 (see http://rubygems.org/gems/grape). So, although hashie 3.3.1 is a valid version for grape, I would expect bundler to use hashie >= 2.1.0, < 3.0.0 since foursquare2 requires hashie < 3.0.0.

@indirect
Copy link
Member

indirect commented Nov 5, 2014

So this seems like a bug at first, because warden-github depends on addressable ~> 2.2.0, and webmock depends on addressable >= 2.2.7. Those should match and everything should be fine. But then the resolver says something totally confusing:

==== Iterating ====

Activated:
  warden-github (1.0.1)
  rack (1.4.5)
  rack-test (0.5.7)
  shotgun (0.9)
  rspec (2.99.0)
  rspec-mocks (2.99.2)
  rspec-expectations (2.99.2)
  rspec-core (2.99.2)
  diff-lcs (1.2.5)
  addressable (2.2.7)
  warden (1.2.3)
  simplecov (0.9.1)
  simplecov-html (0.8.0)
  docile (1.1.5)
  octokit (3.5.2)
  sawyer (0.5.4)
Requirements:
  addressable (~> 2.3.5) ruby
  faraday (< 0.10, ~> 0.8) ruby
  debugger (>= 0) ruby
  webmock (~> 1.9) ruby
  yajl-ruby (>= 0) ruby
  ruby-debug (>= 0) ruby
  multi_json (~> 1.0) ruby
  rake (>= 0) ruby
  sinatra (>= 0) ruby
Attempting:
  addressable (~> 2.3.5) ruby
    * [FAIL] Already activated
    -> Going to: sawyer state
  Activating: sawyer (0.5.3)
    * warden-github (>= 0)
    * octokit (> 2.1.0)
    * sawyer (~> 0.5.3)
    Dependencies
==== Iterating ====

Activated:
  warden-github (1.0.1)
  rack (1.4.5)
  rack-test (0.5.7)
  shotgun (0.9)
  rspec (2.99.0)
  rspec-mocks (2.99.2)
  rspec-expectations (2.99.2)
  rspec-core (2.99.2)
  diff-lcs (1.2.5)
  addressable (2.2.7)
  warden (1.2.3)
  simplecov (0.9.1)
  simplecov-html (0.8.0)
  docile (1.1.5)
  octokit (3.5.2)
  sawyer (0.5.3)
Requirements:
  addressable (~> 2.3.5) ruby
  faraday (< 0.10, ~> 0.8) ruby
  debugger (>= 0) ruby
  webmock (~> 1.9) ruby
  yajl-ruby (>= 0) ruby
  ruby-debug (>= 0) ruby
  multi_json (~> 1.0) ruby
  rake (>= 0) ruby
  sinatra (>= 0) ruby
Attempting:
  addressable (~> 2.3.5) ruby
    * [FAIL] Already activated
    -> Going to: addressable state
  Activating: addressable (2.2.6)
    * addressable (~> 2.2.0)
    Dependencies

Addressable version requirements ~> 2.3.5 and ~> 2.2.0 are explicitly conflicting, and can never be resolved to agree. So how is that happening? :P

Who828 added a commit that referenced this issue Nov 24, 2014
Currently Bundler tries different versions
of current gem and than it's parents and finally
existing gems.

However, when trying different versions of current gem
will cause it to conflict with existing gem version and
sometimes it will be unable to resolve the dependency tree
correctly.

Now, we will try to resolve current gems parent first then
current gem and then finally the exisiting gems.
@Who828
Copy link
Contributor

Who828 commented Nov 24, 2014

I have fixed this issue (hopefully) in this branch, https://github.com/bundler/bundler/tree/resolver_bug_fix

Can you please try it once to ensure things are fixed at your end?

Meanwhile I will do some regression testing before we push out a pre release version.

@TimMoore
Copy link
Contributor

Should be fixed in v1.7.9.

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

5 participants