[buildd-tools-devel] Bug#655215: Bug#655215: sbuild: Do not do run "fakeroot ./debian/rules clean" before building source

Roger Leigh rleigh at codelibre.net
Mon Jan 9 11:26:00 UTC 2012


On Mon, Jan 09, 2012 at 12:00:31PM +0100, Daniel Dehennin wrote:
> I use it to build my personal packages but I run into troubles: the kvm
> is minimal, it does not have any build package and sbuild does a
> "fakeroot debian/rules clean"[1] before building the source.
> 
> This may require several packages to add in my kvm wheezy, like cdbs for
> packages using it.
> 
> Is it possible to make that optional?

When you run dpkg-buildpackage, it also runs debian/rules clean
prior to running dpkg-source -b to pack up the source package.  sbuild
is simply copying the behaviour of dpkg-buildpackage here.  From what
I understand, if we omit the clean, we would potentially pack up a
dirty source tree.  We don't build the source tree directly--it's a
requirement that we pack it up prior to building.

I think it's important to point out that sbuild itself /does not
build source trees/.  It builds Debian packages from a .dsc.  I.e.
from a Debian source package.  If you run sbuild with a .dsc or
package_version rather than a directory, it will do all its work
inside the chroot.  Part of the job of sbuild is doing clean builds
of packages; you can't do a clean build starting from a dirty tree.

When you run in a source tree, we support purely as a convenience
and for dpkg-buildpackage compatibility, it will pack up the source
into a .dsc prior to running normally as above.  This can never be
done inside the chroot, because you run sbuild outside.  The
working directory isn't guaranteed to be inside the chroot either,
and in the medium term it's also incompatible with privelege
separation inside and outside the chroot.

We could potentially copy the entire unpacked tree into the chroot.
But internally sbuild only deals with .dsc files; we need a .dsc
to get the build-deps and the other metadata required for the build.
While it would technically be possible to also obtain the information
from debian/control, this would introduce multiple codepaths to do
the same thing, and the new codepaths would be untested and would be
used far less than the existing ones.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.





More information about the Buildd-tools-devel mailing list