exclude headers and static libraries from package output
Summary
Use project.exclude
to exclude headers and other static libraries
Proposal
In order to reduce the size of out output package, we can use the project.exclude
handle of omnibus packaging to specify that headers/static libraries should not be included in the output package.
This is a little better than using the delete
or command "find #{install_dir} -name '*.gem' -type -f -print -delete
patterns:
- The file is still available for dependencies to use in their build phases
- It is evaluated at packaging time, so other ordering issues are less of a problem
This will save around 31Mb if done across all definitions.
We could do this at the project level:
# config/projects/gitlab.rb snippet
# exclude static libraries, libtool cruft, and headers from the final package
exclude 'embedded/lib/*.a'
exclude 'embedded/lib/*.la'
exclude 'embedded/include'
Or in each software definition:
# config/software/libxml2.rb snippet
# exclude static libraries, headers, and build helpers from the package
project.exclude 'embedded/lib/libxml2.a'
project.exclude 'embedded/lib/libxml2.la'
project.exclude 'embedded/lib/xml2Conf.sh'
project.exclude 'embedded/include/libxml2'
project.exclude 'embedded/bin/xml2-config'
Making each software definition declare what it's bringing in and wasn't wanted seems like the cleaner way to model it, but global exclusions will let us get much of the benefit for just a few lines added.
A mixed approach is probably better: globally exclude the common stuff, and then in each package clean up any extra helper it brought in.
# config/projects/gitlab.rb snippet
# exclude static libraries, libtool cruft, and headers from the final package
exclude 'embedded/lib/*.a'
exclude 'embedded/lib/*.la'
exclude 'embedded/include'
# config/software/libxml2.rb snippet
# exclude build helpers from the package
project.exclude 'embedded/lib/xml2Conf.sh'
project.exclude 'embedded/bin/xml2-config'