Package: sbuild
Version: 0.91.10
Severity: wishlist
X-Debbugs-Cc: [email protected]

Dear Maintainer,

I want to build Debian package and run their autopkgtests:

$ sbuild --run-autopkgtest

Sometimes the autopkgtest fail when using the unshare backend and I want
to easily run the same build but use a different autopkgtest
virt-server. Switching easily between the unshare, schroot, and qemu
backend per sbuild call would ease debugging and work around issues in
the test suites.

Setting --autopkgest-opts does not work, because those
options are added to the options configured in my config:

```
$ sbuild --run-autopkgtest --autopkgtest-opts="sbuild %r"
[...]
autopkgtest [17:53:33]: [...]; command line: /usr/bin/autopkgtest 
[...]/tzdata_2026b-1_amd64.changes -- unshare --release unstable --arch amd64 
-b /dev/kvm /dev/kvm sbuild unstable
usage: autopkgtest-virt-unshare [-h] [-a ARCH] [-b OUTSIDE INSIDE] [-d]
                                [--bootstrapcmd BOOTSTRAPCMD] [-p PREFIX]
                                [-m MIRROR] [-r RELEASE] [-t TARBALL]
                                [-u UNPACK_DIR]
autopkgtest-virt-unshare: error: unrecognized arguments: sbuild unstable
```

Proposal
--------

Allow specifying and overriding the different parts of the autopkgtest
parameters. For the command line:

* --autopkgtest-opts for the options before --
* --autopkgtest-virt-server to specify the virt server
* --autopkgtest-virt-server-opt(s) for the virt server options

Then autopkgtest would be called via:

/usr/bin/autopkgtest $autopkgtest-opts -- $autopkgtest-virt-server 
$autopkgtest-virt-server-opt(s)

The sbuild config should have:

* autopkgtest_opts
* autopkgtest_virt_server
* per-virt-server options:
  - autopkgtest_unshare_virt_server_options
  - autopkgtest_schroot_virt_server_options
  - etc.

Then I could set this in my sbuild config:

```
autopkgtest_virt_server = 'unshare';
autopkgtest_unshare_virt_server_options = ['--release', '%r', '--arch', '%a', 
'-b', '/dev/kvm', '/dev/kvm'];
```

and select a different virt server without my unshare virt-server
options leaking in:

```
sbuild --run-autopkgtest --autopkgtest-virt-server=sbuild
```

What do you think? Do you have a different/better solution?

-- Configuration Files:
/etc/sbuild/sbuild.conf changed:
$build_arch_all = 1;
$build_source = 1;
$clean_source = 0;
$lintian_opts = ['--display-info', '--pedantic', '--display-experimental'];
$autopkgtest_opts = ['--', 'unshare', '--release', '%r', '--arch', '%a', '-b', 
'/dev/kvm', '/dev/kvm'];
$autopkgtest_root_args = [''];
$apt_update = 0;
$apt_distupgrade = 0;
$unshare_mmdebstrap_keep_tarball = 1;
push @{$unshare_mmdebstrap_extra_args}, "*", ['--aptopt=Acquire::http { Proxy 
"http://127.0.0.1:3142";; }', '--skip=cleanup/apt/lists'];
push @{$unshare_mmdebstrap_extra_args}, 
qr/^(trusty|xenial|bionic|focal|jammy|noble|questing|resolute|stonking)/, 
['http://de.archive.ubuntu.com/ubuntu'];
push @{$unshare_mmdebstrap_extra_args}, 
qr/^(trusty|xenial|bionic|focal|jammy|noble|questing|resolute|stonking)/, 
['--components=main,universe'];
$unshare_mmdebstrap_max_age = 86400;
1;

--
Benjamin Drung
Debian & Ubuntu Developer

Reply via email to