Package: debian-policy Version: 3.9.1.0 Severity: normal Tags: patch Hi,
As a goal for wheezy, I'd like the Build-Depends and Build-Depends-Indep fields to be fully functional and usable for autobuilding. Currently, Build-Depends-Indep isn't useful, and only Build-Depends is used in practice on our autobuilder infrastructure (despite it being perfectly capable of handling and using B-D-I internally). The reason for this is that we do our building using dpkg-buildpackage, and while binary-arch and binary-indep are required targets used by dpkg-buildpackage, the corresponding build-arch and build-indep targets are not required and are not used by dpkg-buildpackage at present. There's some history to this in #374029. Most of the information about sbuild/buildds in there is outdated and incorrect. The only sticking point to using Build-Depends-Indep and autobuilding arch-all packages is the lack of support for build-arch and build-all in dpkg-buildpackage. Simply enabling this in dpkg-buildpackage would cause widespread breakage. build-arch and build-indep have been suggested in Policy for some time, and they are used by a low percentage of the archive at present (<400 packages), while 50% of the archive uses dh or cdbs rules which would allow trivial support in all those packages once the tools are updated. I'd like to propose that build-arch and build-indep be changed in Policy from "may be provided" to "must be provided" in preparation for enabling their use. We've wanted to fix the root problem for at least half a decade, and I'd like to get it done for wheezy. This should probably also be accompanied by a new lintian check which can warn if these rules are missing. Note, this patch obviates the need for the patch in #601839. Regards, Roger -- System Information: Debian Release: 5.0.6 APT prefers stable APT policy: (500, 'stable') Architecture: powerpc (ppc) Kernel: Linux 2.6.26-2-powerpc Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash debian-policy depends on no packages. debian-policy recommends no packages. Versions of packages debian-policy suggests: ii doc-base 0.8.20 utilities to manage online documen -- no debconf information
diff --git a/policy.sgml b/policy.sgml index 642f672..29a7db4 100644 --- a/policy.sgml +++ b/policy.sgml @@ -1858,8 +1858,9 @@ <p> The following targets are required and must be implemented by <file>debian/rules</file>: <tt>clean</tt>, <tt>binary</tt>, - <tt>binary-arch</tt>, <tt>binary-indep</tt>, and <tt>build</tt>. - These are the targets called by <prgn>dpkg-buildpackage</prgn>. + <tt>binary-arch</tt>, <tt>binary-indep</tt>, <tt>build</tt>, + <tt>build-arch</tt>, and <tt>build-indep</tt>. These are the + targets called by <prgn>dpkg-buildpackage</prgn>. </p> <p> @@ -1943,43 +1944,35 @@ </tag> <item> <p> - A package may also provide both of the targets + A package must also provide both of the targets <tt>build-arch</tt> and <tt>build-indep</tt>. - The <tt>build-arch</tt> target, if provided, should - perform all the configuration and compilation required for - producing all architecture-dependant binary packages - (those packages for which the body of the - <tt>Architecture</tt> field in <tt>debian/control</tt> is - not <tt>all</tt>). Similarly, the <tt>build-indep</tt> - target, if provided, should perform all the configuration - and compilation required for producing all - architecture-independent binary packages (those packages - for which the body of the <tt>Architecture</tt> field + The <tt>build-arch</tt> target should perform all the + configuration and compilation required for producing + all architecture-dependant binary packages (those + packages for which the body of the + <tt>Architecture</tt> field in <tt>debian/control</tt> + is not <tt>all</tt>). Similarly, + the <tt>build-indep</tt> target, should perform all + the configuration and compilation required for + producing all architecture-independent binary packages + (those packages for which the body of + the <tt>Architecture</tt> field in <tt>debian/control</tt> is <tt>all</tt>). - The <tt>build</tt> target should depend on those of the - targets <tt>build-arch</tt> and <tt>build-indep</tt> that - are provided in the rules file.<footnote> - The intent of this split is so that binary-only builds - need not install the dependencies required for - the <tt>build-indep</tt> target. However, this is not - yet used in practice since <tt>dpkg-buildpackage - -B</tt>, and therefore the autobuilders, - invoke <tt>build</tt> rather than <tt>build-arch</tt> - due to the difficulties in determining whether the - optional <tt>build-arch</tt> target exists. + The <tt>build</tt> target should depend on + the <tt>build-arch</tt> and <tt>build-indep</tt> + targets.<footnote> The intent of this split is so + that binary-only builds need not install the + dependencies required for the <tt>build-indep</tt> + target. However, this is not yet used in practice + since <tt>dpkg-buildpackage -B</tt>, and therefore the + autobuilders, invoke <tt>build</tt> rather + than <tt>build-arch</tt> due to the difficulties in + determining whether the optional <tt>build-arch</tt> + target exists. </footnote> </p> <p> - If one or both of the targets <tt>build-arch</tt> and - <tt>build-indep</tt> are not provided, then invoking - <file>debian/rules</file> with one of the not-provided - targets as arguments should produce a exit status code - of 2. Usually this is provided automatically by make - if the target is missing. - </p> - - <p> The <tt>build-arch</tt> and <tt>build-indep</tt> targets must not do anything that might require root privilege. </p> @@ -2006,13 +1999,13 @@ <p> Both <tt>binary-*</tt> targets should depend on the <tt>build</tt> target, or on the appropriate - <tt>build-arch</tt> or <tt>build-indep</tt> target, if - provided, so that the package is built if it has not - been already. It should then create the relevant - binary package(s), using <prgn>dpkg-gencontrol</prgn> to - make their control files and <prgn>dpkg-deb</prgn> to - build them and place them in the parent of the top - level directory. + <tt>build-arch</tt> or <tt>build-indep</tt> target, so + that the package is built if it has not been already. + It should then create the relevant binary package(s), + using <prgn>dpkg-gencontrol</prgn> to make their + control files and <prgn>dpkg-deb</prgn> to build them + and place them in the parent of the top level + directory. </p> <p>