Thursday, 8 August 2013

Re: speeding up package builds

> I had to look at many "core" packages, which are needed for a normal and a
> buildd chroot, and and which are needed to build these packages for the
> chroots.

Given that the core packages are almost all maintained in Debian with
minimal if any changes, perhaps it would be useful to discuss this on
debian-devel [as well|instead]?

> Parallel builds

> Unfortunately not enabled very often. The buildds set
> DEB_BUILD_OPTIONS="parallel=<N>", and if the build supports parallel builds, it
> can speed up the build substantially. Common mistakes:

> - debhelper based packages don't call with --parallel

So for dh(1) rules, this just means calling 'dh [email protected] --parallel'. Easy to
implement once you know it, but not very widely advertised. Perhaps we
should get this into the default debhelper rules.tiny example, so that
maintainers are encouraged to do the "sensible" thing by default and only
disable parallel builds when there are problems?

If you are overriding dh_auto_build to call dh_auto_build with additional
options, this isn't needed. dh --parallel will set the following variable
in the environment:

DH_INTERNAL_OPTIONS=-O--parallel

This will be picked up by dh_auto_build. So there's only an issue if you
are skipping dh_auto_build in favor of your own invocation, in which case
--parallel probably doesn't do what you want anyway?

> Documentation builds

> Many packages always build the documentation, even when only building the
> architecture dependent packages (that is, on our slowest buildds). The
> easy solution where the upstream docs are not built by default is to build
> these in an extra target.

> However I didn't find any good recipes how to write a modern debhelper or
> semi-modern cdbs rules file how to correctly configure a package to
> disable the docs build for an arch-only build, and enable the docs for an
> arch-indep build. Pointers welcome.

In the past, the problem here was that the build-arch target was optional,
so dpkg-buildpackage always called the 'build' target instead which meant
documentation was included.

But although the build-arch target will now be used by dpkg-buildpackage,
this isn't a very good interface for controlling dh(1) behavior, since
overriding these targets would bypass more than just dh_auto_build.