New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spot-removing Gem dependencies #374

Closed
astrostl opened this Issue Mar 5, 2013 · 6 comments

Comments

Projects
None yet
3 participants
@astrostl

astrostl commented Mar 5, 2013

Passenger depends on Rake, which is already provided by my Ruby. Rather than uninstall a "built-in" Gem, I thought I would override the dependency list. I did this by building Passenger as-is, attempting to install it, and using the resulting dep error:

error: Failed dependencies:
    rubygem(rake) >= 0.8.1 is needed by rubygem-passenger-1:3.0.19-1.noarch
    rubygem(fastthread) >= 1.0.1 is needed by rubygem-passenger-1:3.0.19-1.noarch
    rubygem(daemon_controller) >= 1.0.0 is needed by rubygem-passenger-1:3.0.19-1.noarch
    rubygem(rack) >= 0 is needed by rubygem-passenger-1:3.0.19-1.noarch

with everything but Rake. So,

fpm -s gem -t rpm -v 3.0.19 --no-depends -d 'rubygem(fastthread) >= 1.0.1' -d 'rubygem(daemon_controller) >= 1.0.0' -d 'rubygem(rack) >= 0' passenger

I thought that using '-d' might implicitly blow out any automatically-determined dependencies, and use just my list. It kept Rake, though:

error: Failed dependencies:
    rubygem(rake) >= 0.8.1 is needed by rubygem-passenger-1:3.0.19-1.noarch
    rubygem(fastthread) >= 1.0.1 is needed by rubygem-passenger-1:3.0.19-1.noarch
    rubygem(daemon_controller) >= 1.0.0 is needed by rubygem-passenger-1:3.0.19-1.noarch
    rubygem(rack) >= 0 is needed by rubygem-passenger-1:3.0.19-1.noarch

which led me to try dropping dependencies before adding them:

fpm -s gem -t rpm -v '3.0.19' --no-depends -d 'rubygem(fastthread) >= 1.0.1' -d 'rubygem(daemon_controller) >= 1.0.0' -d 'rubygem(rack) >= 0' passenger

Which resulted in no dependencies at all, even the ones I specified.

How do I get Rake out of there?

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 5, 2013

Looking problem another way, here's what I think -

Ideal World

If your ruby provides rake already, it should declare that it provides rubygems(rake) with a given version, and as a result anything requiring 'rubygems(rake) > 0.8.1' should not cause any package cahnges as long as your version of ruby provides rake that meets that dependency

Actual World

Stuff is messed up and things are wonky.

How about a flag that lets you exclude dependencies by pattern? --exclude-depends rake

Thoughts?

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 5, 2013

Example of that 'ideal world' situation:

% GEM_HOME= GEM_PATH= ruby -e 'require "rake"; puts RUBY_VERSION => Rake::VERSION'     
{"1.9.3"=>"0.9.2.2"}

Guessing that rake 0.9.2.2 ships with ruby 1.9.3; so in the view of a packager, your ruby 1.9.3 package should "provide rubygem(rake) = 0.9.2.2"

But again, ideal worlds are not the real world - and I'm still open to adding an --exclude-depends flag if that helps.

@astrostl

This comment has been minimized.

astrostl commented Mar 6, 2013

An exclusion flag or a behavior where '--no-depends' and '-d foo' put together would result in just a 'foo' dependency would be helpful, I think. The latter was my second guess on how it might already work.

@r4um

This comment has been minimized.

Contributor

r4um commented Mar 6, 2013

👍 for --exclude-depends.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 6, 2013

We could add a '--no-auto-depends' or something like that where only flag-derived dependency info is used? Could be useful.

@astrostl

This comment has been minimized.

astrostl commented Mar 6, 2013

Any of those would be welcome to me.

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 18, 2014

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 27, 2014

jordansissel added a commit that referenced this issue Apr 24, 2015

Merge pull request #386 from r4um/fix_374
Closes #374 Add --no-auto-depends flag.

jordansissel added a commit that referenced this issue Jun 20, 2016

Merge pull request #386 from r4um/fix_374
Closes #374 Add --no-auto-depends flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment