Debian Bug report logs - #695287
sbuild: synthetic cross-build-dependencies for compilers

version graph

Package: sbuild; Maintainer for sbuild is Debian buildd-tools Developers <buildd-tools-devel@lists.alioth.debian.org>; Source for sbuild is src:sbuild.

Reported by: Colin Watson <cjwatson@ubuntu.com>

Date: Thu, 6 Dec 2012 16:57:01 UTC

Severity: wishlist

Found in version sbuild/0.63.2-1

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, wookey@debian.org, debian-dpkg@lists.debian.org, Debian buildd-tools Developers <buildd-tools-devel@lists.alioth.debian.org>:
Bug#695287; Package sbuild. (Thu, 06 Dec 2012 16:57:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Colin Watson <cjwatson@ubuntu.com>:
New Bug report received and forwarded. Copy sent to wookey@debian.org, debian-dpkg@lists.debian.org, Debian buildd-tools Developers <buildd-tools-devel@lists.alioth.debian.org>. (Thu, 06 Dec 2012 16:57:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Colin Watson <cjwatson@ubuntu.com>
To: submit@bugs.debian.org
Subject: sbuild: synthetic cross-build-dependencies for compilers
Date: Thu, 6 Dec 2012 16:54:23 +0000
Package: sbuild
Version: 0.63.2-1
Severity: wishlist
User: crossbuild@debian.org
Usertags: cross

(This is a bit of an RFC.  I think I understand the general shape of the
problem, but I'd welcome comments on the design.)

One of the problems we have with cross-building packages is with
alternative compilers and other cross-tools.  Generally speaking,
cross-build chroots start with a reasonable set of cross-tools
preinstalled, such as gcc-HOST and pkg-config-HOST.  If somebody
build-depends on pkg-config, pkg-config-HOST is already installed so
it's OK.  However, if somebody build-depends on, say, g++-4.6, then
nothing knows how to install g++-4.6-HOST; or I can easily imagine that
we might want a gobject-introspection-HOST in the future.  It does not
seem correct to me to deal with these problems by adding more and more
packages to the cross-build-essential set.

When I was writing my patch for #695203, it occurred to me that this
offered an opportunity for sbuild to step in and synthesise
build-dependencies in some situations.  A possible design would be as
follows:

  When cross-building, if the package being built build-depends on A
  (taking any [] into account), A is not Multi-Arch: foreign, and A-HOST
  exists in the apt cache, then rewrite the build-dependency to
  "A:native, A-HOST" (including any versioning present).

Wookey suggested that we might also want something for people who don't
use sbuild; I think perhaps a similar algorithm in 'dpkg-checkbuilddeps
-aHOST' would be useful and reasonable.  (CCing debian-dpkg.)  An
alternative to the "exists in the apt cache" rule, which I can imagine
being troublesome, might be to have a hardcoded list of relevant
packages; this would change from time to time but hopefully not too
often.  Or we could have a package control field for "there's a cross
version of this".

Does this sound right to you?  I think I could probably figure out how
to do this on top of my previous patch, but I'd like to make sure that
we agree on the design first.

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



Information forwarded to debian-bugs-dist@lists.debian.org, Debian buildd-tools Developers <buildd-tools-devel@lists.alioth.debian.org>:
Bug#695287; Package sbuild. (Thu, 06 Dec 2012 18:42:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian buildd-tools Developers <buildd-tools-devel@lists.alioth.debian.org>. (Thu, 06 Dec 2012 18:42:09 GMT) Full text and rfc822 format available.

Message #10 received at 695287@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Colin Watson <cjwatson@ubuntu.com>, 695287@bugs.debian.org
Subject: Re: [buildd-tools-devel] Bug#695287: sbuild: synthetic cross-build-dependencies for compilers
Date: Thu, 6 Dec 2012 18:26:30 +0000
On Thu, Dec 06, 2012 at 04:54:23PM +0000, Colin Watson wrote:
> When I was writing my patch for #695203, it occurred to me that this
> offered an opportunity for sbuild to step in and synthesise
> build-dependencies in some situations.  A possible design would be as
> follows:
> 
>   When cross-building, if the package being built build-depends on A
>   (taking any [] into account), A is not Multi-Arch: foreign, and A-HOST
>   exists in the apt cache, then rewrite the build-dependency to
>   "A:native, A-HOST" (including any versioning present).
> 
> Wookey suggested that we might also want something for people who don't
> use sbuild; I think perhaps a similar algorithm in 'dpkg-checkbuilddeps
> -aHOST' would be useful and reasonable.  (CCing debian-dpkg.)  An
> alternative to the "exists in the apt cache" rule, which I can imagine
> being troublesome, might be to have a hardcoded list of relevant
> packages; this would change from time to time but hopefully not too
> often.  Or we could have a package control field for "there's a cross
> version of this".

I think this all sounds reasonable.  I'll be happy to look over any
cross-building stuff for sbuild; I'm afraid my multiarch knowledge
is still lacking some of the intricacies though.  It's certainly
not a problem to add additional dependencies to the dependency
package when cross-building.

We might also want to look a bit further at automatically setting up
the appropriate foreign arches in dpkg/apt so that this is all
automatically installable as well (unless this was already taken
care of--I can't recall offhand), if we end up with multiarch
deps which would otherwise not be available.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux    http://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-    GPG Public Key      F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800



Information forwarded to debian-bugs-dist@lists.debian.org, Debian buildd-tools Developers <buildd-tools-devel@lists.alioth.debian.org>:
Bug#695287; Package sbuild. (Fri, 07 Dec 2012 15:18:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guillem Jover <guillem@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian buildd-tools Developers <buildd-tools-devel@lists.alioth.debian.org>. (Fri, 07 Dec 2012 15:18:06 GMT) Full text and rfc822 format available.

Message #15 received at 695287@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: Colin Watson <cjwatson@ubuntu.com>, 695287@bugs.debian.org
Cc: debian-dpkg@lists.debian.org
Subject: Re: Bug#695287: sbuild: synthetic cross-build-dependencies for compilers
Date: Fri, 7 Dec 2012 16:14:54 +0100
Hi!

(Re-redirecting, as the debian-dpkg mailing list is configured to
automatically redirect bug mails to debian-dpkg-bugs.)

On Thu, 2012-12-06 at 16:54:23 +0000, Colin Watson wrote:
> Package: sbuild
> Version: 0.63.2-1
> Severity: wishlist
> User: crossbuild@debian.org
> Usertags: cross
> 
> (This is a bit of an RFC.  I think I understand the general shape of the
> problem, but I'd welcome comments on the design.)
> 
> One of the problems we have with cross-building packages is with
> alternative compilers and other cross-tools.  Generally speaking,
> cross-build chroots start with a reasonable set of cross-tools
> preinstalled, such as gcc-HOST and pkg-config-HOST.  If somebody
> build-depends on pkg-config, pkg-config-HOST is already installed so
> it's OK.  However, if somebody build-depends on, say, g++-4.6, then
> nothing knows how to install g++-4.6-HOST; or I can easily imagine that
> we might want a gobject-introspection-HOST in the future.  It does not
> seem correct to me to deal with these problems by adding more and more
> packages to the cross-build-essential set.
> 
> When I was writing my patch for #695203, it occurred to me that this
> offered an opportunity for sbuild to step in and synthesise
> build-dependencies in some situations.  A possible design would be as
> follows:
> 
>   When cross-building, if the package being built build-depends on A
>   (taking any [] into account), A is not Multi-Arch: foreign, and A-HOST
>   exists in the apt cache, then rewrite the build-dependency to
>   "A:native, A-HOST" (including any versioning present).
> 
> Wookey suggested that we might also want something for people who don't
> use sbuild; I think perhaps a similar algorithm in 'dpkg-checkbuilddeps
> -aHOST' would be useful and reasonable.  (CCing debian-dpkg.)  An
> alternative to the "exists in the apt cache" rule, which I can imagine
> being troublesome, might be to have a hardcoded list of relevant
> packages; this would change from time to time but hopefully not too
> often.  Or we could have a package control field for "there's a cross
> version of this".
> 
> Does this sound right to you?  I think I could probably figure out how
> to do this on top of my previous patch, but I'd like to make sure that
> we agree on the design first.

Some quick thoughts, I'm not too fond on hardcoding the package naming
pattern in such low level tools (but then we do this already for the
path names of those tools). This assumes all packages have been properly
marked already with M-A:<value>. For dpkg-checkbuilddeps, yes, apt is
not (currently) an option, as that'd be a layer violation, and it would
exlude other frontends (I've some ideas on better integration with
frontends that could render this a non-issue, but not right now).
There's lots of toolchains, for different languages and runtimes,
hardcoding a list of those is really not appealing either, so
something generic would be my preference. An small issue with handling
the implicit mapping is that we might require more Build-Dependencies
than strictly needed, as some might only be used either for host or
build targets.

Thanks,
Guillem



Information forwarded to debian-bugs-dist@lists.debian.org, Debian buildd-tools Developers <buildd-tools-devel@lists.alioth.debian.org>:
Bug#695287; Package sbuild. (Sun, 09 Dec 2012 12:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matthias Klose <doko@ubuntu.com>:
Extra info received and forwarded to list. Copy sent to Debian buildd-tools Developers <buildd-tools-devel@lists.alioth.debian.org>. (Sun, 09 Dec 2012 12:39:03 GMT) Full text and rfc822 format available.

Message #20 received at 695287@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@ubuntu.com>
To: 695287@bugs.debian.org, Colin Watson <cjwatson@ubuntu.com>, debian-dpkg@lists.debian.org
Subject: cross builds don't just require alternate b-d's, but additional ones too
Date: Sun, 09 Dec 2012 13:36:35 +0100
For toolchain packages like gcc-4.7, you can't deduce the build dependencies
automatically. Cross building the gcc-4.7 package (not building the cross
compiler) requires additional build dependencies, which for a native build are
used from the current build. These are:

  g++-<target-triplet>
  g++-multilib-<target-triplet> [<target-multilib-archs>]
  gobjc++-<target-triplet>
  gobjc++-multilib-<target-triplet> [<target-multilib-archs>]
  gfortran-<target-triplet>
  gfortran-multilib-<target-triplet> [<target-multilib-archs>]
  gccgo-<target-triplet>
  gccgo-multilib-<target-triplet> [<target-multilib-archs>]

If these should not be hard-coded in the build tools, then we do need some
syntax for the control file to specify these cross build dependencies, best in a
way which is independent of the target architecture.

  Matthias



Information forwarded to debian-bugs-dist@lists.debian.org, Debian buildd-tools Developers <buildd-tools-devel@lists.alioth.debian.org>:
Bug#695287; Package sbuild. (Sun, 09 Dec 2012 14:06:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Colin Watson <cjwatson@ubuntu.com>:
Extra info received and forwarded to list. Copy sent to Debian buildd-tools Developers <buildd-tools-devel@lists.alioth.debian.org>. (Sun, 09 Dec 2012 14:06:08 GMT) Full text and rfc822 format available.

Message #25 received at 695287@bugs.debian.org (full text, mbox):

From: Colin Watson <cjwatson@ubuntu.com>
To: Matthias Klose <doko@ubuntu.com>
Cc: 695287@bugs.debian.org, debian-dpkg@lists.debian.org
Subject: Re: cross builds don't just require alternate b-d's, but additional ones too
Date: Sun, 9 Dec 2012 14:05:39 +0000
On Sun, Dec 09, 2012 at 01:36:35PM +0100, Matthias Klose wrote:
> For toolchain packages like gcc-4.7, you can't deduce the build dependencies
> automatically. Cross building the gcc-4.7 package (not building the cross
> compiler) requires additional build dependencies, which for a native build are
> used from the current build. These are:
[...]
> If these should not be hard-coded in the build tools, then we do need some
> syntax for the control file to specify these cross build dependencies, best in a
> way which is independent of the target architecture.

I think that's covered by something along the lines of Guillem's
profiles proposal, which would allow such things to be annotated with
<cross>.  I'd still like to be able to deduce as much as possible
automatically, though, because given the relatively small number of
people who care about cross-building it takes a very long time to
annotate lots of packages manually; the more we can do automatically the
better.

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 00:12:27 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.