Package: sbuild
Version: 0.63.2-1
Severity: wishlist
Tags: patch

Hi maintainers,

When I'm backporting packages locally with the help of sbuild, it's often the case that I need to backport a build-dependency too. Let's say that package foo version 2.0 depends on libbar1 (>= 2.0~). If I backport libbar1, I need to make it available to the build of foo.

One way to do this is to configure my local schroot to have e.g. ~/apt configured as a repository. This might work okay on a personal machine, provided I remember to be conscientious about cleaning out ~/apt between builds and pass --apt-update, but I'm running into a situation at work where I'm using the same build machine for two different products (one of which should not be built with a backported libbar1), and cleaning out a local apt repository would be painful and also enforce unnecessary serialization on builds.

One way to do this would be to have multiple schroots for building the two products, only one of which has the local apt repo. This seems like a waste of space.

Attached is a patch that provides the "--add-package" option to sbuild, which makes a .deb from the host system available to apt in the build chroot for use when resolving build dependencies. Concretely, this means I can do something like

sbuild -d stable libbar1_2.0-1.dsc
sbuild -d stable --add-package=libbar1_2.0-1_amd64.deb foo_2.0-1.dsc

with non-hacked-up schroots, and have things work the way I expect.

The implementation of this patch simply copies the .deb into the directory for the local archive (for build-dependency resolution). This makes it a very small patch, and works out fine because it specifically is needed for build-dependency resolution. I'm not positive this is the right approach, though, and would be willing to write a longer patch.

Another feature along related lines would be "--add-repository", e.g.

sbuild -d stable --add-repository="file:/home/geofft/apt ./" foo_2.0-1.dsc
or
sbuild -d stable --add-repository="http://local-archive/apt stable myrepo" 
foo_2.0-1.dsc

I have a naive implementation of this, which doesn't actually work because `apt-get update` is not run after the local archive is created (which the manpage mentions). One approach would be to instead implement this somewhere before --apt-update executes, and have this imply --apt-update. Another would be to add functionality to apt to update only a single repo, which the manpage mentions would be useful (and I think I'd like that functionality for its own sake, anyway). Do you have thoughts on which approach would be better?

Both patches are available on my github "add-package" branch, although this is more intended for feedback than merge:
https://github.com/geofft/sbuild/commits/add-package

Thanks,
--
Geoffrey Thomas
[email protected]


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to