titusfortner / webdrivers

Keep your Selenium WebDrivers updated automatically
MIT License
593 stars 111 forks source link

Requiring 'rake/file_list' in gemspec breaks the Gemfile if rake is not already installed #184

Closed kapoorlakshya closed 3 years ago

kapoorlakshya commented 3 years ago

Summary

179 added use of rake/file_list which breaks the Gemfile via the use of bundle install/update if rake is not already installed. This is especially problematic on CI systems where we always start from a clean state.

@utkarsh2102 Could you please take a look at this when you have time? I could attempt to fix this, but don't want to inadvertently break your Debian specific pipeline. Thank you!

CI Failure

https://travis-ci.org/github/titusfortner/webdrivers/builds/727632931

$ bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}

[!] There was an error parsing `Gemfile`: 
[!] There was an error while loading `webdrivers.gemspec`: cannot load such file -- rake/file_list
Does it try to require a relative path? That's been removed in Ruby 1.9. Bundler cannot continue.
 #  from /home/travis/build/titusfortner/webdrivers/webdrivers.gemspec:6
 #  -------------------------------------------
 #  require 'webdrivers/version'
 >  require 'rake/file_list'
 #  
 #  -------------------------------------------
. Bundler cannot continue.
 #  from /home/travis/build/titusfortner/webdrivers/Gemfile:6
 #  -------------------------------------------
 #  # Specify your gem's dependencies in webdrivers.gemspec
 >  gemspec
 #  -------------------------------------------

No errors on Appveyor (example) because it has rake v12.0 pre-installed as part of the CI image.

Workaround

Install rake 12.x prior to bundle install/update - gem install rake -v 12.3.3

utkarsh2102 commented 3 years ago

Hey,

I'm sorry for having caused this! 😪 The best fix, in my opinion, is to use Dir over Rake::FileList. The should omit the need of using our installing Rake in the first place.

What do you think?

utkarsh2102 commented 3 years ago

Giving more thoughts into this, there are a few options here:

From the Debian side, all we care about is to not use git in the gemspec file. You may circumvent that by using Dir or Dir.glob (purely Ruby alternatives) or Rake::FileList (since rake is almost always available to use!) or any other way that doesn't use git! :smile:

kapoorlakshya commented 3 years ago

@utkarsh2102 Thanks for the prompt response! I personally like option 2 - using Dir to keep things simple. Would you have time to put in a PR for this? If not then I'll try to make time this week or the next.

utkarsh2102 commented 3 years ago

Hi @kapoorlakshya,

Thanks for the prompt response! I personally like option 2 - using Dir to keep things simple. Would you have time to put in a PR for this? If not then I'll try to make time this week or the next.

Opened PR #185 for this^

kapoorlakshya commented 3 years ago

Thank you! Closed by #185.