Closed ksylvest closed 2 months ago
@stanhu you might be able to weigh in here. I would think that anything other than maybe a .gitkeep
could be gitignored in /tmp?
@kernelsmith I think that tmp
directory can be removed, but I don't think a .gitkeep
would do anything here because that temporary directory is created by the Rakefile
: https://github.com/ueno/ruby-gpgme/blob/bae97e203246054b9eba69a1b6470a4dcb2e8d21/Rakefile#L11-L16
Do the test / examples need to be included in the gemspec files?
I think they can be excluded, though sometimes it's useful to have the tests to verify the C extension built and installed correctly.
What is the purpose of the ports exactly (can they also be excluded from the finalized version)?
I believe that directory is used to download and build gpgme
, libassuan
, etc. I believe they can be removed.
I spent a long time working on building precompiled gems and ensuring the gems had a minimal footprint in https://github.com/mudge/re2. We can probably borrow the same ideas from there.
We could make the tmp directory ahead of time and stick a .gitkeep in there and then gitignore the rest of the contents. When rake runs, I assume it won't fail if the dir already exists (depends how mkdir
is defined obviously). However, in this case we can just gitignore the entire /tmp
so let's just do that ;)
gpgme v2.0.23 had an issue with cleanup, but I believe this has been fixed in v2.0.24 via #178 and #179:
gem install gpgme -v 2.0.24
cd `dirname $(gem which gpgme)`
cd ..
du -h
28K ./test/support
12K ./test/files
96K ./test
124K ./ext/gpgme
124K ./ext
24K ./examples
108K ./lib/gpgme
876K ./lib
1.1M .
@ueno I think we can close this issue?
I raised https://github.com/rubygems/rubygems/issues/6956 to discuss how to standardize cleanup, but for now the roundabout way does the job: https://github.com/ueno/ruby-gpgme/blob/bae97e203246054b9eba69a1b6470a4dcb2e8d21/ext/gpgme/extconf.rb#L228
The install size for gpgme-2.0.24 is ~45 MB. This seems pretty huge! A quick spot check:
A few questions / thoughts:
If this does seem like an issue happy to help opening a PR to address.