moneta-rb / moneta

a unified interface to key/value stores
https://github.com/moneta-rb/moneta
MIT License
1.12k stars 87 forks source link

use Dir.glob instead of git ls-files in gemspec #232

Closed anarcat closed 1 year ago

anarcat commented 2 years ago

Moneta is packaged in Debian, but only at version 1.0. Updating to the latest version leads to build failures because we do not have Git installed in the build tree: we instead copy a git archive to the build servers. Details of the build errors are here:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1010286#12

I'm not so familiar with the Ruby build process, but from what I understand, it is actually discouraged to use git in the gemspec in that way:

https://packaging.rubystyle.guide/#using-git-in-gemspec

I am therefore using the recommended Dir.glob() instead of git ls-files.

asppsa commented 2 years ago

Looks good - thanks for this. I'll review and merge ASAP

asppsa commented 2 years ago

I'm going to use the Rake::FileList example from the style guide you linked instead, as this will retain the existing behaviour of not publishing files that are listed in the .gitignore (which in my case could be a bunch of stuff) that didn't work!

This is a bit tricky. I'm concerned for example that the PR as-is will end up publishing the contents of the .git folder to rubygems, in the "normal" (not Debian) use-case of using the gemspec file to publish the package; and it will also publish any git-ignored scratch files (e.g. *~) if I am lazy and run gem build ... from the same directory that I've been developing in (I am indeed lazy).

I'll have to have a look around at some other projects to see how they are handling this...

asppsa commented 1 year ago

@anarcat I've come up with a solution that removes references to git from the gemspec in #251. Obviously apologies that this took so long to work out. I'm going to close this, but if the fix doesn't work for you for some reason, we can reopen.