[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

don't use sbuild --dist/-d and other sbuild stuff (was: Re: Questions before my first upload attempt)



Hi,

Quoting Danny Edel (2015-08-21 13:43:41)
> On 21/08/15 13:21, Danny Edel wrote:
> > Once sbuild is setup
> 
> Just to clarify. In this use case (using sbuild as close to buildd as
> possible), the steps labeled "for personal use" in
> https://wiki.debian.org/sbuild#Configuration
> are *not* what we want.
> 
> The Source package will be created by debuild -S on the host machine,
> and sbuild will *only* build the binary.

for the pure purpose of building a source package, having devscripts installed
for debuild is not needed. You can instead use dpkg-buildpackage directly.
Though, if you really just want to build the source package, then even better
than `dpkg-buildpackage -S` is to run `dpkg-source -b .`. The advantage is,
that you do not have to have any packages installed which are necessary to run
the clean target. You probably don't want to install any extra packages like
that on your host if you are using sbuild later anyways.

Furthermore, instead of creating the source package manually before invoking
sbuild on the dsc, you can also execute sbuild directly without any arguments
inside the unpacked source. It will detect this and build the source package
automatically for you.

> logout-relogin or use "newgrp sbuild" in your current shell.

Good suggestion, I added it to the wiki page.

> Now to create the chroots:
> 
> [...]
> 
> Thats it. Note that you can also use "wheezy" or "jessie" if you plan on
> testing backporting to those.
> 
> From now on, "sbuild --dist sid --arch amd64 path/to/my.dsc" works.

It must be mentioned that a common problem with sbuild is, that the .changes
file it generates will have a *different* distribution from the one you set in
debian/changelog if you use the --dist or -d option! If sbuild changed the
value of the distribution field in the .changes file, it will do so in *red*
but it is still easy to miss this.

The *right* thing to do is to choose the chroot with the -c or --chroot option.
The -d or --dist option will do the same job, but the side effect that it
changes the distribution field in the .changes file it creates can be a very
dangerous one.

So please don't further advertise the -d or --dist option anymore if you
actually want to use the -c or --chroot option instead!

The -d or --dist option is used for when you want sbuild to even acquire the
source package for you, in which case it otherwise does not know from which
distribution to `apt-get source` it from.

I raised the issue in this thread on buildd-tools-devel@l.a.d.o:

http://lists.alioth.debian.org/pipermail/buildd-tools-devel/2015-July/009671.html

Please comment over there if you have a good idea to solve this common mistake.

> I would recommend setting up a local (partial) debian mirror to speed up the
> package fetching step, but I've gotten weird "500 invalid header" errors when
> I use apt-cacher-ng, so I'm not recommending this for now.

I am using apt-cacher-ng as well but I don't think I've encountered HTTP 500
errors so far. Maybe you can investigate the issue and file a bug?

> The only sbuild configuration line I *strongly* suggest is
> 
> $environment_filter = [ ];
> 
> This will ensure that no CXXFLAGS= or similar from your working environment
> contaminate the clean chroot.

If you think the default should be changed, could you please file a bug against
sbuild about that?

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature


Reply to: