Bug#521918: pbuilder --build --binary-arch invokes 'build' target

Lionel Elie Mamane lionel at mamane.lu
Mon May 11 11:46:30 UTC 2009


On Tue, May 05, 2009 at 07:13:23PM +0200, Julien Cristau wrote:

> arch-specific builds run 'debian/rules build && $rootcmd
> debian/rules binary-arch' (where rootcmd is fakeroot or sudo).  They
> can't do anything else, because the build-arch target is (still) not
> required.

Sure they can:

 debian/rules build-arch
 if [ "$?" -eq 2 ] then
   apt-get install ${BUILD_DEPENDS_INDEP_OF_THE_PACKAGE}
   apt-get remove  ${BUILD_CONFLICTS_INDEP_OF_THE_PACKAGE}
   debian/rules build
 fi
 $rootcmd debian/rules binary-arch

Not wanting to do something as convoluted / brittle is another matter
altogether and something I'd support. (Returning error code 2 is
mandatory for debian/rules when called on a non-existing target, if I
remember well.) So, pbuilder can call "build" unconditionally (that in
itself is not a bug), but then it _must_ respect Build-Depends-Indep
and Build-Conflicts-Indep.

> Whatever's needed for this needs to be in Build-Depends.

No, policy is very clear on that: if you call the "build" target, you
_must_ satisfy Build-Depends-Indep and Build-Conflicts-Indep:

 http://www.debian.org/doc/debian-policy/footnotes.html#f46
 http://www.nl.debian.org/doc/debian-policy/ch-relationships.html#s-sourcebinarydeps

I quote (emphasis mine):

Build-Depends-Indep, Build-Conflicts-Indep

 The Build-Depends-Indep and Build-Conflicts-Indep fields must be
 satisfied when any of the following targets is invoked: *build*,
 build-indep, binary and binary-indep.

If you make "build-arch" or "binary-arch", you need Build-Depends. If
you make "build-indep" or "binary-indep", you need Build-Depends and
Build-Depends-Indep. If you make "*build*" or "binary", you need
*both*.


Under the current policy it is a bug for pbuilder to not install the
Build-Depends-Indep.

-- 
Lionel





More information about the debian-science-maintainers mailing list