[buildd-tools-devel] Bug#782553: sbuild: 'sbuild --source --no-arch-all' fails in a very confusing way

Johannes Schauer josch at debian.org
Thu Dec 24 10:11:58 UTC 2015


Hi,

On Mon, 13 Apr 2015 23:06:35 -0700 Dima Kogan <dima at secretsauce.net> wrote:
> The --[no-]arch-all and --source options all touch the dpkg-buildpackage -b
> and -B options, and it is possible for the user to mistakenly request an
> incompatible combination that results in very confusing failures. In my case
> I had $sbuild_source=1 in the config file, and I was running 'sbuild
> --no-arch-all'. This was ignoring the --no-arch-all partially:
> 'dpkg-buildpackage -B' was being invoked, in direct contradiction with the
> --no-arch-all request.

wait, maybe you mixed something up?

dpkg-buildpackage -B will be doing a binary-only build, limited to architecture
dependent packages, so no arch:all packages just as you had requested, no?

> However later on, sbuild would say
> 
>     E: Package builds hello-all_2.10_all.deb when binary-indep target is not called.  This is a bug in the packaging.
> 
> and then it tries to do stuff with this package (that wasn't supposed to
> be built), and says stuff like
> 
>    dpkg-deb: error: failed to read archive `/«CHROOT»/«BUILDDIR»/hello-all_2.10_all.deb': No such file or directory
> 
>    dpkg-deb: error: failed to read archive `/«CHROOT»/«BUILDDIR»/hello-all_2.10_all.deb': No such file or directory
> 
>    mv: cannot stat '/«CHROOT»/«BUILDDIR»/hello-all_2.10_all.deb': No such file or directory
>    E: Could not move hello-all_2.10_all.deb to .
>    du: cannot access '/tmp/hello-all_2.10_all.deb': No such file or directory
> 
> and exits with 'Status: attempted'.

This should certainly not happen.

> This was really confusing to the user (me) because on the commandline I was
> explicitly requesting --no-arch-all. The --source was being given in the
> config file, and even then, it's not immediately obvious it's related. Can I
> request we detect such cases and barf early with a clear error message?

You totally can! Do you have a patch? :)

Maybe a good fix would already be to properly document how --source, --arch-all
and --arch-all-only play together. Here is an overview of which combination of
these options leads to which flag being passed to dpkg-buildpackage:

  --source  |  --arch-all  | --arch-all-only  | dpkg-buildpackage flag
------------+--------------+------------------+------------------------
    set     |     set      |      set         |        -g
    set     |     set      |                  |
    set     |              |      set         |        -S
    set     |              |                  |        -G
            |     set      |      set         |        -A
            |     set      |                  |        -b
            |              |      set         |
            |              |                  |        -B

> It's also possible to issue more clearly illegal requests, such as
> 'sbuild --arch-all --no-arch-all'. This succeeds doing something, but one of
> the requests was ignored. Things like this should be illegal too.

Either illegal or it could be documented that when options conflict, then later
options override earlier options.

Another bug relevant to the command line option madness would be bug #799056

Thanks!

cheers, josch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20151224/3e00c4b4/attachment.sig>


More information about the Buildd-tools-devel mailing list