Otto Kekäläinen <o...@debian.org> writes:

> Hi!
>
> While working on Go packages recently, I noticed many of them have the
> subdirectories
> examples/
> testdata/
>
> The stuff in examples/ is shipped in many Debian packages currently in
> the binary deb files. In one case the examples/ even lead to a
> /usr/bin/example being generated and it would have gone into the
> package if I hadn't noticed it and explicitly removed it.
>
> To my understanding no package that uses another -dev package as a
> build dependency would ever have any need for neither the examples nor
> testdata. Those files are more relevant to the person developing the
> library, right?
>
> Should we aim to remove examples/ and testdata/ in future Go libraries
> (*-dev packages)?
>
> In addition to them being useless and taking up disk space, and
> occasionally affecting the build, they also generate tons of Lintian
> nags such as:
> I: golang-github-charmbracelet-glamour source:
> very-long-line-length-in-source-file 1271 > 512
> [ansi/testdata/TestRenderer/task.golden:2]
> I: golang-github-charmbracelet-glamour-dev:
> package-contains-documentation-outside-usr-share-doc
> [usr/share/gocode/src/github.com/charmbracelet/glamour/styles/examples/ordered_list.md]

I also generally find them useless.  However, some packages use the
files in self-tests and they would fail (sometimes silently) if the
files are excluded.  It can also be that compiling an example file
against the library catches a real problem, that you may want to catch
early rather than shipping something and later find out it wasn't
working.  So there are some arguments for not just blindly removing
things.  It may be that these concerns show up later on in a later
version of the package, so even if you audit and review a current
release for this problem, you may cause things to be broken later on
(and not be caught because nobody is likely to re-review this).

There is another related question: sometimes useless files takes up a
really large portion of the package.  I'm working on
golang-github-open-policy-agent-opa which has a 100MB+ source tarball,
and naive packaging resulted in a huge *-dev package (cannot remember,
but guessing 100MB+ size too).  I've now added Files-Excluded-statements
to strip all the useless files I could identify (a Files-Included: would
be much simpler...), and made it into what is actually necessary in
Debian.  The source tarball is now around 2MB and the installed *-dev
package is around 1.5MB.  Is it justifiable to do this?  Creating
debian/copyright for the large 100MB+ source tarball would be a
deal-breaker for use of my time, but creating it for the stripped down
variant is more feasible.

/Simon

Attachment: signature.asc
Description: PGP signature

Reply via email to