Build dependencies: some thoughts
OK, I've just tried to calculate the build-time dependencies for
debian-policy, and here are some thoughts.
It's not easy. In fact it's *really* not easy.
I first tried running strace on the build process, but due to the
presence of a vfork, I missed most of the interesting stuff.
So strace is not a particularly useful way of figuring out
I then tried looking through the debian/rules file, noting every
command used, running dpkg -S on it to locate the containing
package, sort | uniq on the result, and then examining what I had
The list of packages used is as follows:
Essential/Required packages: dpkg, fileutils, grep, gzip, sed,
As these are essential, they do not need listing in the build
Standard packages: dpkg-dev, lynx, make
Now these should need listing, as they are not marked essential.
Depends: perl5, sgml-base, sgml-data, sp, sgmlspm
Suggests: debiandoc-sgml-doc, liburi-perl, libpaperg, tetex-bin,
tetex-extra, lout, psutils
Depends: libc6 (>= 2.1), libstdc++2.10, libsp1 (>= 1.3.2-1.2-1),
Suggests: doc-base, sgml-data
Now I can assume that apt-get will be used to install any
dependent packages, so it should be sufficient to list
debiandoc-sgml and sp in the Build-Depends-Indep field to pull
in perl5, sgml-base, etc.
But hey! debiandoc-sgml itself depends on sp, so I could
optimise and not list sp. This would, however, be dangerous, as
what happened if the dependencies (maybe not in this example,
but elsewhere) changed? So I'll still list both of these.
And I would think that I was done. Except that I have noticed,
following the build process, that debiandoc2latexps is called. So I
must manually examine the Suggests: list for debiandoc-sgml. (For
sp, I notice that doc-base and sgml-data are suggested. But sgml-data
is a dependency of debiandoc-sgml and doc-base is only used at
configure time by the postinst. So I may ignore these.)
So let's go through the suggestions one-by-one:
debiandoc-sgml-doc: obviously unnecessary
liburi-perl: well, it turns out that debian/rules uses
debiandoc2html which uses/usr/lib/debiandoc-sgml/\
lib/DebianDoc_SGML/Format/HTML.pm uses URI::URL, so
this is needed
libpaperg: I don't think it's used, but who would know?
tetex-bin: latex and pdflatex are needed from here for
tetex-extra: Hmm. I don't know about this one either
lout: No, debiandoc2lout is not used
psutils: I don't think this one is used either
So at the end of it, I'm still confused. Some more careful
experimentation using strace on individual commands leads to the
conclusion that I actually need the extra packages:
latex2html: for url.sty, used by the debiandoc2latex* programs
and there were no hints of this!
libgdbmg1: but hey: that's a pre-dependency of perl-5.00x-base, so
it should be required, not standard. So I don't need to list
libpaperg: paperconf called from
tetex-extra: lots of fonts and hyperref
And I may still have missed some.
Thus my Build-Depends-Indep would list:
dpkg-dev, lynx, make, debiandoc-sgml, sp, liburi-perl, libpaperg,
tetex-bin, tetex-extra, latex2html
What are my thoughts after all of this?
Firstly, that if we are now demanding build-time dependencies, we are
asking maintainers to do a *lot* of work. (This took me about 2
hours, maybe a little bit more.) We ought to think of a better way of
performing this task if we want maintainers to take it seriously.
Secondly, the chances of getting it right are small; although this
does not matter so much given that errors can just be filed as bug
Thirdly, of the packages listed, dpkg-dev and make are needed by every
package build, so should not be needed to be listed. I wonder whether
we can have a tag "Build-Essential: yes" for a small number of
packages which are assumed to be present on any builder, and that do
not need to be listed?
Finally, a small point. It may be worth stating that if a package is
required to satisfy an (install-time) dependency of a listed
dependency, then it does not need to be listed itself. Although,
having said this, I think this is obvious.
Julian Gilbey, Dept of Maths, QMW, Univ. of London. J.D.Gilbey@qmw.ac.uk
Debian GNU/Linux Developer, see http://www.debian.org/~jdg