gem install rspec --pre fails to resolve dependencies #813

Closed
indirect opened this Issue Feb 6, 2014 · 7 comments

Projects

None yet

3 participants

Owner
indirect commented Feb 6, 2014
travis@debug-andre-arko-ruby-1391682530:~$ gem -v
2.2.1

travis@debug-andre-arko-ruby-1391682530:~$ gem install rspec -v '~> 3.0.beta' --no-ri --no-rdoc
Fetching: rspec-core-3.0.0.beta1.gem (100%)
ERROR:  Error installing rspec:
    rspec-core requires rspec-support (= 3.0.0.beta1)

travis@debug-andre-arko-ruby-1391682530:~$ gem install rspec -v '~> 3.0.0.beta.1' --no-ri --no-rdoc
ERROR:  Error installing rspec:
    rspec-core requires rspec-support (= 3.0.0.beta1)

travis@debug-andre-arko-ruby-1391682530:~$ gem install rspec --pre
ERROR:  Error installing rspec:
    rspec-core requires rspec-support (= 3.0.0.beta1)

travis@debug-andre-arko-ruby-1391682530:~$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.2.1
  - RUBY VERSION: 1.9.3 (2013-11-22 patchlevel 484) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/travis/.rvm/gems/ruby-1.9.3-p484
  - RUBY EXECUTABLE: /home/travis/.rvm/rubies/ruby-1.9.3-p484/bin/ruby
  - EXECUTABLE DIRECTORY: /home/travis/.rvm/gems/ruby-1.9.3-p484/bin
  - SPEC CACHE DIRECTORY: /home/travis/.gem/specs
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/travis/.rvm/gems/ruby-1.9.3-p484
     - /home/travis/.rvm/gems/ruby-1.9.3-p484@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/travis/.gvm/pkgsets/go1.2/global/bin
     - /home/travis/.gvm/gos/go1.2/bin
     - /home/travis/.gvm/pkgsets/go1.2/global/overlay/bin
     - /home/travis/.gvm/bin
     - /home/travis/.gvm/bin
     - /home/travis/.rvm/bin
     - /home/travis/.rvm/gems/ruby-1.9.3-p484/bin
     - /home/travis/.rvm/gems/ruby-1.9.3-p484@global/bin
     - /home/travis/.rvm/rubies/ruby-1.9.3-p484/bin
     - /usr/local/phantomjs/bin
     - /home/travis/.nvm/v0.10.24/bin
     - ./node_modules/.bin
     - /home/travis/.gvm/pkgsets/go1.2/global/bin
     - /home/travis/.gvm/gos/go1.2/bin
     - /home/travis/.gvm/pkgsets/go1.2/global/overlay/bin
     - /home/travis/.gvm/bin
     - /home/travis/.gvm/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/local/maven-3.1.1/bin
     - /home/travis/.rvm/bin
     - /home/travis/.rvm/bin
Owner
indirect commented Feb 6, 2014

This is a regression, as Rubygems 2.0.10 works perfectly fine.

Owner
indirect commented Feb 6, 2014

On further testing, this is a Rubygems 2.2.1 regression. Rubygems 2.2.0 also works, but 2.2.1 and 2.2.2 both fail.

Member
zzak commented Feb 6, 2014

I think it has something to do with 204d1b9, but haven't nailed it down yet.

@drbrain drbrain added this to the 2.3 milestone Apr 3, 2014
Owner
drbrain commented Apr 23, 2014

I think there is some missing data in the gem dependencies API that prevent verification of a fix. I'm trying the following command for installation of an rspec prerelease (this explicit dependency will automatically trigger --prerelease):

$ rm -fr ~/tmp/gems; ruby -Ilib bin/gem install rspec -v '= 3.0.0.beta.1' --no-doc -i ~/tmp/gems --backtrace
Fetching: rspec-mocks-3.0.0.beta1.gem (100%)
ERROR:  Error installing rspec:
    rspec-mocks requires rspec-support (= 3.0.0.beta1)

Why is rspec-mocks being installed before rspec-support then? What order is RubyGems trying to use?

$ rm -fr ~/tmp/gems; ruby -Ilib bin/gem install rspec --explain -v '= 3.0.0.beta.1' --no-doc -i ~/tmp/gems --backtrace
Gems to install:
  rspec-mocks-3.0.0.beta1
  diff-lcs-1.2.5
  rspec-support-3.0.0.beta1
  rspec-expectations-3.0.0.beta1
  rspec-core-3.0.0.beta1
  rspec-3.0.0.beta1

That's strange, why rspec-mocks before rspec-support if rspec-mocks depends on rspec-support? Is there a dependency missing?

$ gem dep -r rspec-mocks -v 3.0.0.beta1
Gem rspec-mocks-3.0.0.beta1
  aruba (~> 0.5, development)
  cucumber (~> 1.1.9, development)
  rake (~> 10.0.0, development)
  rspec-support (= 3.0.0.beta1)

Not according to the .gemspec hosted on S3…

$ curl -s https://api.rubygems.org/api/v1/dependencies?gems=rspec-mocks | ri --dump /dev/stdin
[…]
 {:name=>"rspec-mocks",
  :number=>"3.0.0.beta1",
  :platform=>"ruby",
  :dependencies=>[]},
[…]

But yes according to the dependency API.

@indirect @evanphx do you have any ideas why the dependencies are empty for 3.0.0.beta1?

@drbrain drbrain added a commit that referenced this issue Apr 23, 2014
@drbrain drbrain Switch InstallCommand to use RequestSet to install
Gem::DependencyInstaller is still used to set up the RequestSet but the
installation actions occur via RequestSet#install.  This makes --explain
and gem installation use the same gem installation order.

This also moves documentation generation into RequestSet#install.

This makes explain order and install order the same as part of #813
7cd50b0
Owner

A data error, I guess. 3.0.0.beta2 lists the dependency correctly:

    {
        "dependencies": [
            [
                "rspec-support",
                "= 3.0.0.beta2"
            ]
        ],
        "name": "rspec-mocks",
        "number": "3.0.0.beta2",
        "platform": "ruby"
    },
    {
        "dependencies": [],
        "name": "rspec-mocks",
        "number": "3.0.0.beta1",
        "platform": "ruby"
    },
Owner

Fixed it by forcing an insert of the dependencies into the Bundler API database. No idea how it wasn't already there. :\

    {
        "dependencies": [
            [
                "rspec-support",
                "= 3.0.0.beta1"
            ]
        ],
        "name": "rspec-mocks",
        "number": "3.0.0.beta1",
        "platform": "ruby"
    },
Owner
drbrain commented Apr 24, 2014

Thanks!

I'm marking this closed as rspec prereleases now install thanks to the fixes to the metadata.

@drbrain drbrain closed this Apr 24, 2014
@drbrain drbrain added a commit that referenced this issue Apr 24, 2014
@drbrain drbrain Add #813 to History 5fdb6ce
@zzak zzak added a commit to zzak/rubygems that referenced this issue May 9, 2014
@drbrain @zzak drbrain + zzak Switch InstallCommand to use RequestSet to install
Gem::DependencyInstaller is still used to set up the RequestSet but the
installation actions occur via RequestSet#install.  This makes --explain
and gem installation use the same gem installation order.

This also moves documentation generation into RequestSet#install.

This makes explain order and install order the same as part of #813
be7d5db
@zzak zzak added a commit to zzak/rubygems that referenced this issue May 9, 2014
@drbrain @zzak drbrain + zzak Add #813 to History 14e3cd0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment