Skip to content
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

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

Closed
kapoorlakshya opened this issue Sep 29, 2020 · 5 comments

Comments

@kapoorlakshya
Copy link
Collaborator

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

@kapoorlakshya kapoorlakshya changed the title Requiring 'rake/file_list' in gemspec breaks the Gemfile Requiring 'rake/file_list' in gemspec breaks the Gemfile if rake is not already installed Sep 29, 2020
@utkarsh2102
Copy link
Contributor

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
Copy link
Contributor

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

  • The straightforward one here is to add gem install rake thingy so the CI works fine (though I am not sure why it doesn't in the first place!).
  • The other way is the one I mentioned above^. Using Dir over Rake::FileList is the simplest thing in my opinion. But that's your call.
  • Another way to fix this is to have a Manifest.txt file, explicitly listing the files that you want to ship and that file will be read by s.files. That's a bit of an overkill but for some, it works best.

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! 😄

@kapoorlakshya
Copy link
Collaborator Author

@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 added a commit to utkarsh2102/webdrivers that referenced this issue Oct 1, 2020
This also fixes all the CI inconsistencies.

Fixes: titusfortner#184

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
utkarsh2102 added a commit to utkarsh2102/webdrivers that referenced this issue Oct 1, 2020
This also fixes all the CI inconsistencies.

Fixes: titusfortner#184

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
@utkarsh2102
Copy link
Contributor

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
Copy link
Collaborator Author

kapoorlakshya commented Oct 1, 2020

Thank you! Closed by #185.

kapoorlakshya pushed a commit that referenced this issue Oct 1, 2020
* Prefer `Dir` over `Rake::FileList`

This also fixes all the CI inconsistencies.

Fixes: #184

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

* Update RuboCop::Packaging to v0.5.0

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants