Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove hardcoded platform specific dependencies. #54

Closed
wants to merge 1 commit into from

5 participants

@voxik

Hi,

This gem works independently of its dependencies. Is not good idea to force people on some platform to install other platform specific code. More over, it explodes the amount of gems I need on my system, it pollutes my load path as is shown in example bellow and as least but not last, it makes packaging for Linux distribution pain. Thank you for consideration.

irb
irb(main):001:0> puts $:
/usr/local/share/ruby/site_ruby
/usr/local/lib64/ruby/site_ruby
/usr/share/ruby/vendor_ruby
/usr/lib64/ruby/vendor_ruby
/usr/share/rubygems
/usr/share/ruby
/usr/lib64/ruby
=> nil
irb(main):002:0> require 'listen'
=> true
irb(main):003:0> puts $:
/home/vondruch/gem_home/listen/gems/rb-fsevent-0.9.1/lib
/usr/share/gems/gems/ffi-1.0.9/lib
/usr/share/gems/gems/ffi-1.0.9/ext
/usr/lib64/gems/exts/ffi-1.0.9/lib
/home/vondruch/gem_home/listen/gems/rb-inotify-0.8.8/lib
/home/vondruch/gem_home/listen/gems/rb-fchange-0.0.5/lib
/home/vondruch/gem_home/listen/gems/listen-0.4.7/lib
/usr/local/share/ruby/site_ruby
/usr/local/lib64/ruby/site_ruby
/usr/share/ruby/vendor_ruby
/usr/lib64/ruby/vendor_ruby
/usr/share/rubygems
/usr/share/ruby
/usr/lib64/ruby
=> nil
@voxik

The hardcoded dependencies even don't let me used polling if I want to use them for whatever reason.

@voxik

Also note that FSSM gem never hardcoded such dependencies.

@travisbot

This pull request fails (merged 9926921 into e985b25).

@rymai
Owner

Hi,

this might interest you on why the core team made this choice: #5

Also, if you want to use polling explicitly, you can use force_polling(true) (see README.

@voxik

@rymai

Thank you for pointers. Yes, I am aware that there is no way to install platform specific dependencies. But I still prefer to remove the dependencies. And there was no objections at that time, so I have to come with them later :)

To put things a bit into context. I come to the listen gem, because it is used by the sass gem. So I am not in control if polling will be used or not. And I am running now the test suite on Fedora and with rb-inotify installed, it just randomly crashes. If it would be optional, I would simply not install the platform specific bits and stayed with polling. Also, you are forcing me to package 3 more gems for Fedora where 2 of them has no meaning on my system and I am afraid they will be not easy to package. So at the end, everybody will be just disappointed.

I decided that I will patch the gem for Fedora that it will not require the dependencies, however that will break even more systems, because there will be application shipped with Gemfile.lock which will specify some dependencies which are not needed by Fedora.

Please, reconsider your decision and accept this pull request if you don't want to make life harder to us, packagers for various distros and to our users. Thank you.

@rymai
Owner

Thanks for these info, however I'd like to have the opinion of @Maher4Ever and @thibaudgg (he's in vacation right now but he'll be online next week) about that and anyways, I'll let them choose to merge or not this pull-request.

Regarding rb-inotify crashes, this probably need to be fixed (either in listen or in rb-inotify) in order for Fedora users to take advantage of it instead of polling. If you think that's a Listen issue, please feel free to open a new issue ticket.

@voxik

@rymai NP, thank you.

@Maher4Ever
Collaborator

Personally I'm not in favor of the fact that our users have to install some gems which they don't need. It works fine, but It's not elegant. Listen doesn't really need the platform-specific gems to function. It can always work with the polling adapter, so I don't think the gems need to be specified in the gemspec as dependencies.

We can treat the platform-specific gems as extra functionality, just like Guard does with the interactors. We can even go a step further and inform the user about the best choice for his environment at runtime.

@thibaudgg
Owner

Ok, so it would be polling by default if there's no system gem present with a nice invitation message to install the gem if force-polling message isn't used? I also think it could be a better approach.

@Maher4Ever
Collaborator

Great! I'll try to get this done tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 24, 2012
  1. @voxik
This page is out of date. Refresh to see the latest.
Showing with 0 additions and 4 deletions.
  1. +0 −4 listen.gemspec
View
4 listen.gemspec
@@ -15,10 +15,6 @@ Gem::Specification.new do |s|
s.required_rubygems_version = '>= 1.3.6'
s.rubyforge_project = 'listen'
- s.add_dependency 'rb-fsevent', '~> 0.9.1'
- s.add_dependency 'rb-inotify', '~> 0.8.8'
- s.add_dependency 'rb-fchange', '~> 0.0.5'
-
s.add_development_dependency 'bundler'
s.files = Dir.glob('{lib}/**/*') + %w[CHANGELOG.md LICENSE README.md]
Something went wrong with that request. Please try again.