[buildd-tools-devel] Bug#403246: Bug#403246: Bug#403246: sbuild dependancy resolution fails when b-dep on A | B ; A uninstallable

Andres Mejia mcitadel at gmail.com
Mon Sep 21 21:46:25 UTC 2009


I think I may have found the problem. Seems that
Sbuild::Build::filter_dependencies in most cases will only choose the first
package out of a list of alternatives, and ignore the rest as possible
packages that could be installed.

One thing that could be done is modify Sbuild::Build::run_apt to test if a
package is installable. Then Sbuild::Build::filter_dependencies could run the
run_apt() subroutine to check if a package is installable before declaring it
as such.

This of course has a performance penalty, since it means running apt-get
multiple times dependending on how many build dependencies a source package
may have. I think a much simpler and faster solution in the end would be to
take advantage of apt-get to resolve build dependencies.

It's been mentioned that a "dependency package" could be used to resolve build
dependencies. I have another proposal that involves using apt-get to read off
from a "Sources" file in a location that we could point to via a "deb-src"
line.

Here's what I propose. First we write our own "Sources" file somewhere, say a
temporary directory. Our "Sources" file would look something like this.

    Package: sbuild-dependencies-resolver
    Binary: sbuild-dependencies-resolver
    Version: 0.invalid.0
    Priority: extra
    Section: utils
    Maintainer: Debian buildd-tools Developers <buildd-tools-devel at lists.alioth.debian.org>
    Build-Depends: libgl1-mesa-dev
    Build-Depends-Indep: debhelper (>> 4.1)
    Build-Conflicts: nvidia-glx-dev
    Build-Conflicts-Indep: cdbs
    Architecture: all
    Standards-Version: 0.0.0
    Format: 1.0
    Directory: .
    Files:
     00000000000000000000000000000000 0 sbuild-dependencies-resolver_0.invalid.0.dsc
     00000000000000000000000000000000 0 sbuild-dependencies-resolver_0.invalid.0.tar.gz

The only fields that would vary here are the Build-* fields. Here we can include
any of the Build-* fields as necessary and copy them straight from the .dsc file
of a package. Some entries as you can see are bogus anyway, and the files don't
have to be in the location as mentioned in this "Sources" entry.

Next would be to add a "deb-src" line, perhaps in a new .list file in
/etc/apt/sources.list.d. It should look something like this.

    deb-src file://$temp_dir ./

Afterwards, all that would be needed to install the proper build-dependencies
is to run 'apt-get update' again and then run
'apt-get build-dep sbuild-dependencies-resolver'.

What still needs to be resolved would be how to reliably purge the newly
installed packages. Perhaps the packages that are newly installed should be
recorded out of the output from apt-get when installing the build
dependencies. This entry from the output could be used.

    The following NEW packages will be installed:
      package_1 package_2 ...
      ...

Then that list of packages could be later purged after the build is done using
'apt-get purge @list'.

One possible regression here would be support for architecture wildcards, if
we go with this proposal. See bug #547724.

-- 
Regards,
Andres





More information about the Buildd-tools-devel mailing list