On Fri, Jan 21, 2011 at 12:09:55PM +0000, Hector Oron wrote: > I would love sbuild to gain the ability to handle cross builds. […] Thanks for the informative explanation, it has helped to make the problem a bit clearer for me. > It seems that sbuild triggers dpkg --print-architecture to find out chroot architecture, but when doing cross it should try to follow dpkg-architecture's DEB_HOST_ARCH. > > Would it be possible to modify Build.pm in some way, either calling dpkg-architecture or autodetecting -a$arch has been passed and it should follow other architecture changes file? We can definitely do this. I think that the several uses of the --arch option are going to need separating into separate options. Does the following make sense, or am I missing out anything major? 1) Selection of the build chroot We look for a chroot named $distribution-$arch-sbuild or $distribution-$arch When we are genuinely building for a different arch, then this works. When we're cross-compiling, we want to build on a chroot using the host arch (most likely, though you /could/ use a different arch with qemu and do an emulated cross-build once we have such support!) 2) Selection of the host architecture Linked to (1). We are assuming that the build and host architectures are the same, so --host is implicitly setting both. I think we should add two additional options: --host select host arch --build select build arch (or whatever are most commonly used in existing Debian tools; these are from autoconf configure) and have "--arch=foo" be equivalent to "--host=foo --build=foo". The chroot selection will use the host arch only. So this will typically be the "real" host arch, but it will also allow "native" (non-cross) building using qemu as well as kernel personalities (i386 on amd64 etc, which is already supported). When we come to run dpkg-buildpackage, we will then pass the build arch which will result in a cross-build if this differs from the host arch. Hopefully this will implement support fairly cleanly and flexibly. Following on from that there's the issue of resolver support and use of xapt. Some examples of how xapt would be used would help here; I'm a bit unsure of if it's used directly as an apt-get wrapper, or if it's a multi-step process. Understanding the workflow would be most useful. 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.
Description: Digital signature