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
Drop git ls-files in gemspec
#580
Conversation
cbfa128
to
0cd54a2
Compare
|
Thank you again @utkarsh2012 for your help with the downstream maintenance of Debian package I think that there are three gemspec modifications suggested in this PR, and I suggest that we consider each individually:
Thank you again @utkarsh2012! |
|
Let me help give you a broad perspective on this:
You're welcome! ❤️
This is of course a problem whilst maintaining this downstream.
Originally,
Can do, I have been doing similar patching, so yeah, I'll amend this PR to use
Indeed, this is very helpful. This is a win-win! 🚀
These files are not really needed by end-users. These will be needed for development purposes or other things.
Yes, rubocop-packaging was born because we had been facing a lot of problems downstream. This project is being mentored by Antonio (the Ruby "guru" in Debian 🛐) and David (the upstream maintainer of rubygems/bundler, byebug, pry-byebug, and so many more things! 🛐)
Of course, another cop dropping by this month (the PR is almost ready there!) and 2 more the next month! I'll soon create a RubyGems guide, so it'll help enlighten and aware more upstream maintainers 😄
Ouch, well, this kinda hurt :) However, I'd like to point out that even if it's a month old, there's a mention of it in the known extensions: (I plan to reach out to more once we release the new cop tomorrow or day after or by max, this Friday!) Lastly, some of the development dependencies of sup are already using
No, thanks to you both for the maintenance ❤️ Anyway, once we reach the conclusion of what's to be done here, I'll be happy to amend this PR. |
|
I think it's reasonable to expect to able to evaluate the gemspec using only "pure" Ruby, without shelling out to external commands like git. It makes the build simpler in restrictive build environments like distro build systems. So I am fine with a patch which swaps out the As to the question of whether the gem should include all sources... in my view it absolutely should. I know some maintainers prefer to treat Rubygems as more like a "binary" distribution platform, or make some distinction between "sources needed at runtime vs. sources needed for development". But that distinction is not meaningful. For one thing, the letter and spirit of the GPL require us to distribute "complete corresponding source code" which means all the sources, including tests. And those are actually useful for downstream distributors, for example in the Fedora package which runs the tests. I think one reason for the point of difference here is that some packages treat Github as their authoritative source tarballs and Rubygems as a convenient way to install the code. But for Sup (which predates both Github and Rubygems, it was originally hosted on Rubyforge) the authoritative source tarballs are really the Rubygems. So I want to continue including all sources as before. And I would prefer not to gain a hard dependency on the rubocop-packaging gem (and its dependency chain), at least while it's relatively new. (edited because I bumped the button too early) |
|
I made a bit of a mess of the previous comment, and accidentally closed the PR in the process. I didn't mean to do that. I've edited it to fill out what I was trying to say, although the PR subscribers probably got emailed a half-written version. Sorry for all the mess. @utkarsh2102 based on my comment above, would you mind amending the PR to include just the changes to replace |
|
Thank you @utkarsh2102, and thank you @danc86!
That makes perfect sense, thank you!
Don't worry, there are no C extensions here. :-) However, there are some files generated during (for example)
That's great! I wish you all the very best for
Sorry, this was not intended to hurt in any way - I wish you all the very best for the project, and I think you have some exciting momentum behind you for such a new project already. It solves a real problem, and I think it would be great if it becomes widely used. I just, with my Sup maintainer hat on, would look for it to be more established before we add it in here - Sup is 14 years old, so a 1 month project is extremely new in Sup terms! Other projects are much faster-moving than Sup. @danc86 -
Compelling reasoning - I'm convinced.
I agree on not gaining a hard dependency at this stage (fuller reasoning in earlier part of my post). However, what about a soft dependency? I am certainly planning to regularly run rubocop-packaging against Sup. So could we perhaps add an easy way to install the gem and execute the checks off to the side in, say,
I suggest perhaps If we're looking for all sources, then we'd also need to include the dot files. So we might need something along the lines of this, @utkarsh2102 (this is untried, but hopefully gives the idea): |
Sure, but let's take the question of how to run rubocop-packaging to a separate PR. My main issue is that a gem-level dependency will require me to get it packaged into Fedora. I would be interested in having it hooked up to Travis though. That's even better than having to remember to run it yourself.
I have no strong preference between There is a downside I can see with your suggestion of globbing everything and excluding files listed in .gitignore. I often leave random junk uncommitted in the root of git trees, like files called There is a very good chance I would accidentally publish a gem containing stuff like that, if the gemspec was globbing for all files. With @utkarsh2102 's current approach, using Also (a more theoretical concern) .gitignore can contain syntax beyond just plain globs that |
|
Good points, @danc86 - how about another option? We could create a git pre-commit hook that runs |
Manifest.txt was removed in commit 9690617 (2009-08-25). We are re-adding Manifest.txt now as a prerequisite for PR sup-heliotrope#580, which will remove `git ls-files` from the gemspec, and so avoid a dependency on git to build the gem. New Rake tasks added: - "manifest" - Regenerate Manifest.txt from `git ls-files` - "check_manifest" - Called by task "travis" (used by Travis CI), to check that the committed Manifest.txt matches `git ls-files`
|
(I steered away from a git pre-commit hook, because they run locally, and it is a pain to ensure that everyone clones the repository using the same hooks.) After further research, I've found that we used to have an authoritative list of filenames inside There are so many edge cases here with file globbing includes/excludes that I suggest that we instead simply re-add We can ensure that I will raise a new (prerequisite) PR today to recreate |
|
It's better to Rake task do this. It's better and simpler this way. |
Thanks! We're thinking on exactly the same lines. :-) I'm halfway through adding a Rake task to generate |
Manifest.txt was removed in commit 9690617 (2009-08-25). We are re-adding Manifest.txt now as a prerequisite for PR sup-heliotrope#580 (to allow the removal of `git ls-files` from the gemspec). New Rake tasks added: - "manifest" - Regenerate Manifest.txt from `git ls-files` - "check_manifest" - Called by task "travis" (used by Travis CI), to check that the committed Manifest.txt matches `git ls-files`
|
I have worked on such a task before, d'you want me to paste the diff here? |
|
Heh, great. Can fix this PR tomorrow (and also once that is merged!). |
PR #581 |
Manifest.txt was removed in commit 9690617 (2009-08-25). We are re-adding Manifest.txt now as a prerequisite for PR #580 (to allow the removal of `git ls-files` from the gemspec). New Rake tasks added: - "manifest" - Regenerate Manifest.txt from `git ls-files` - "check_manifest" - Called by task "travis" (used by Travis CI), to check that the committed Manifest.txt matches `git ls-files`
|
Thanks @danc86 for approving PR #581. Now merged, and we have a @utkarsh2102 - Over to you to modify this PR please, should be a one-liner change now to read |
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @utkarsh2102
RuboCop::Packaging automatically detects common packaging issues which may make life more difficult for downstream maintainers. We add and execute off-to-the-side, i.e., contained entirely within a new subdirectory inside "contrib". This is to avoid a hard development dependency on RuboCop::Packaging, because it is currently a very new project - started one month ago in 2020-06. Rake task "rubocop_packaging" added to execute the checks. Called by task "travis", used by Travis CI. With thanks to Utkarsh Gupta <utkarsh@debian.org> for the original idea (see PR sup-heliotrope#580).
rubocop-packaging automatically detects common packaging issues which may make life more difficult for downstream maintainers. We add and execute off-to-the-side, i.e., contained entirely within a new subdirectory inside "contrib". This is to avoid a hard development dependency on the rubocop-packaging gem, because it is currently a very new project - started one month ago in 2020-06. Rake task "rubocop_packaging" added to execute the checks. Called by task "travis", used by Travis CI. With thanks to Utkarsh Gupta <utkarsh@debian.org> for the original idea (see PR sup-heliotrope#580).
rubocop-packaging automatically detects common packaging issues which may make life more difficult for downstream maintainers. We add and execute off to the side, i.e., contained entirely within a new subdirectory inside "contrib", including its own separate Bundler directory for gems. This is to avoid a hard development dependency in the main Sup project on the rubocop-packaging gem, because it is currently a very new project - started one month ago in 2020-06. Rake task "rubocop_packaging" added to execute the checks. Called by task "travis", used by Travis CI. With thanks to Utkarsh Gupta <utkarsh@debian.org> for the original idea (see PR sup-heliotrope#580).
|
(Thanks again, @utkarsh2102 & @danc86!)
Raised new PR #582 for the This installs |
rubocop-packaging automatically detects common packaging issues which may make life more difficult for downstream maintainers. We add and execute off to the side, i.e., contained entirely within a new subdirectory inside "contrib", including its own separate Bundler directory for gems. This is to avoid a hard development dependency in the main Sup project on the rubocop-packaging gem, because it is currently a very new project - started one month ago in 2020-06. Rake task "rubocop_packaging" added to execute the checks. Called by task "travis", used by Travis CI. With thanks to Utkarsh Gupta <utkarsh@debian.org> for the original idea (see PR #580).
Hi @IPv2 and @danc86,
Thanks for the active maintenance of
supagain! ❤️However, while maintaining this in Debian, we found that
suprelies ongitto list the files which could be done via pure Ruby alternative -- which is what this PR does.As an addition, this PR makes sure that this gem only ships the required files to the end-users and not other things which are not needed by them! 🚀
Also, added
rubocop-packagingas adevelopment_dependencywhich will ensure the best practices (and therefore help us in the Debian maintenance!)Here's what it shows us:
And this PR fixes the same, which helps us in shipping this in Debian! 🎉
Hope this would make sense and you'll be open to this change 💯
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>