Bug#1015833: sbuild: would be helpful to be able to override the autopkgtest options
Quoting Julian Gilbey (2022-09-19 16:55:11) > > That is correct. But letting sbuild run autopkgtest is also a bad design > > choice. Since the $autopkgtest_opts are a list of options, it would also be > > bad to let the command line options just replace what was already set. So > > then you need some sort of interface that lets you add or remove arbitrary > > stuff. This can become very complicated very fast. We can also not change > > this now because sbuild is also heavily used from scripts that now rely on > > the existing functionality. > > Another good point (about the bad design). I wasn't suggesting changing the > existing behaviour for exactly the reason you indicate, rather I was > suggesting a new option to mean "clear all existing $autopkgtest_opts and > start with an empty list". But that also feels a bit clunky. Yes, that could be done. But before I add another option to the already endless list: sbuild [-h|--help | -V|--version] [-v|--verbose | -q|--quiet] [-D|--de‐ bug] [-A|--arch-all] [--archive=archive] [-d|--dist=distribution] [-c|--chroot=chroot] [--chroot-mode=schroot|sudo|autopkgtest|unshare] [--arch=architecture] [--arch-any | --no-arch-any] [--build=architec‐ ture] [--host=architecture] [--profiles=profile[,...]] [-s|--source] [--force-orig-source] [--make-binNMU=changelog-entry] [--binNMU=NMU- version] [--append-to-version=string] [--binNMU-timestamp=timestamp] [--binNMU-changelog=changelog][--build-dir=directory][--add-de‐ pends=dependency] [--add-conflicts=dependency] [--add-depends-arch=de‐ pendency] [--add-conflicts-arch=dependency] [--add-depends-indep=depen‐ dency] [--add-conflicts-indep=dependency] [-m|--maintainer=maintainer] [-e|--uploader=uploader] [-k|--keyid=key-id] [--source-only-changes] [--no-source-only-changes] [-j|--jobs=n] [--debbuildopt=option] [--deb‐ buildopts=options] [--dpkg-source-opt=options] [--dpkg-source-opts=op‐ tions][--dpkg-file-suffix=suffix] [-p|--purge=purge-mode] [--purge-build=purge-mode] [--purge-deps=purge-mode][--purge-ses‐ sion=purge-mode] [-b|--batch] [-n|--nolog] [--clean-source] [--no-clean-source][--run-lintian][--no-run-lintian][--lin‐ tian-opt=options] [--lintian-opts=options] [--run-piuparts] [--no-run-piuparts] [--piuparts-opt=options] [--piuparts-opts=options] [--piuparts-root-arg=options] [--piuparts-root-args=options] [--run-au‐ topkgtest] [--no-run-autopkgtest] [--autopkgtest-opt=options] [--autop‐ kgtest-opts=options] [--autopkgtest-root-arg=options] [--autop‐ kgtest-root-args=options] [--pre-build-commands=string] [--ch‐ root-setup-commands=string][--chroot-update-failed-commands=string] [--build-deps-failed-commands=string][--starting-build-com‐ mands=string] [--finished-build-commands=string] [--build-failed-com‐ mands=string] [--chroot-cleanup-commands=string] [--post-build-com‐ mands=string] [--post-build-failed-commands=string] [--any‐ thing-failed-commands=string] [--log-external-command-output] [--log-external-command-error] [--setup-hook=hook-script] [--build-dep-resolver=resolver][--resolve-alternatives|--no-re‐ solve-alternatives][--extra-package=package.deb] [--extra-reposi‐ tory=spec] [--extra-repository-key=file.asc][--build-path=string] [--autopkgtest-virt-server=schroot|lxc|chroot|qemu|ssh] [--autop‐ kgtest-virt-server-opt=string] [--autopkgtest-virt-server-opts=options] [--purge-extra-packages] [--bd-uninstallable-explainer=dose3|apt|none] [PACKAGE[.dsc]] Before I do that, I would need a concrete use-case justifying it. If the %r percent escape works for you, then I guess that's it. Please close this bug if you think that there is nothing else to discuss. Thanks! cheers, josch signature.asc Description: signature
Bug#1015833: sbuild: would be helpful to be able to override the autopkgtest options
On Sun, Sep 18, 2022 at 08:27:53PM +0200, Johannes Schauer Marin Rodrigues wrote: > Hi, > > Quoting Julian Gilbey (2022-09-18 18:54:10) > > On Wed, Sep 14, 2022 at 08:13:08AM +0200, Johannes Schauer Marin Rodrigues > > wrote: > > > Hi, > > > > [...] > > > > The same applies for all of the autopkgtest related options, such as > > > > --autopkgtest-virt-server-opt. > > > > > > which options are different if you are building for a stable update? > > > > I have in my .sbuildrc: > > > > $autopkgtest_opts = ['--apt-upgrade', '--', 'lxc', '-s', > > 'autopkgtest-testing']; > > [...] > > did you try putting the following into your ~/.sbuildrc: > > $autopkgtest_opts = ['--apt-upgrade', '--', 'lxc', '-s', 'autopkgtest-%r']; That's a good point; I hadn't spotted that substitution variable. > > But in general, the idea that it is impossible to override settings from a > > configuration file seems an unfortunate design choice. > > That is correct. But letting sbuild run autopkgtest is also a bad design > choice. Since the $autopkgtest_opts are a list of options, it would also be > bad > to let the command line options just replace what was already set. So then you > need some sort of interface that lets you add or remove arbitrary stuff. This > can become very complicated very fast. We can also not change this now because > sbuild is also heavily used from scripts that now rely on the existing > functionality. Another good point (about the bad design). I wasn't suggesting changing the existing behaviour for exactly the reason you indicate, rather I was suggesting a new option to mean "clear all existing $autopkgtest_opts and start with an empty list". But that also feels a bit clunky. > [...] > If you want to do more complex stuff, consider using the SBUILD_CONFIG > environment variable. That would work too. Best wishes, Julian
Bug#1015833: sbuild: would be helpful to be able to override the autopkgtest options
Hi, Quoting Julian Gilbey (2022-09-18 18:54:10) > On Wed, Sep 14, 2022 at 08:13:08AM +0200, Johannes Schauer Marin Rodrigues > wrote: > > Hi, > > > > On Fri, 22 Jul 2022 08:25:25 +0100 Julian Gilbey wrote: > > > The sbuild(1) manpage says: > > > > > >--autopkgtest-opt=options > > > Pass the specified option directly to autopkgtest in > > > addition to > > > the options already passed by sbuild. [...] > > > > > > and similarly for --autopkgtest-opts. However, my ~/.sbuildrc > > > specifies default autopkgtest options, and I sometimes need to > > > override those. It would be very helpful if there was a command-line > > > option to pass the specified options *instead of* the options already > > > passed by sbuild, for example if I am building a package for a stable > > > update. > > > > > > The same applies for all of the autopkgtest related options, such as > > > --autopkgtest-virt-server-opt. > > > > which options are different if you are building for a stable update? > > I have in my .sbuildrc: > > $autopkgtest_opts = ['--apt-upgrade', '--', 'lxc', '-s', > 'autopkgtest-testing']; > > For a stable update, I instead need > > $autopkgtest_opts = ['--apt-upgrade', '--', 'lxc', '-s', > 'autopkgtest-stable']; did you try putting the following into your ~/.sbuildrc: $autopkgtest_opts = ['--apt-upgrade', '--', 'lxc', '-s', 'autopkgtest-%r']; > But in general, the idea that it is impossible to override settings from a > configuration file seems an unfortunate design choice. That is correct. But letting sbuild run autopkgtest is also a bad design choice. Since the $autopkgtest_opts are a list of options, it would also be bad to let the command line options just replace what was already set. So then you need some sort of interface that lets you add or remove arbitrary stuff. This can become very complicated very fast. We can also not change this now because sbuild is also heavily used from scripts that now rely on the existing functionality. If you just want to switch between stable and testing, consider using the %r escape in your ~/.sbuildrc. If you want to do more complex stuff, consider using the SBUILD_CONFIG environment variable. Thanks! cheers, josch signature.asc Description: signature
Bug#1015833: sbuild: would be helpful to be able to override the autopkgtest options
Hi Josch, On Wed, Sep 14, 2022 at 08:13:08AM +0200, Johannes Schauer Marin Rodrigues wrote: > Hi, > > On Fri, 22 Jul 2022 08:25:25 +0100 Julian Gilbey wrote: > > The sbuild(1) manpage says: > > > >--autopkgtest-opt=options > > Pass the specified option directly to autopkgtest in addition > > to > > the options already passed by sbuild. [...] > > > > and similarly for --autopkgtest-opts. However, my ~/.sbuildrc > > specifies default autopkgtest options, and I sometimes need to > > override those. It would be very helpful if there was a command-line > > option to pass the specified options *instead of* the options already > > passed by sbuild, for example if I am building a package for a stable > > update. > > > > The same applies for all of the autopkgtest related options, such as > > --autopkgtest-virt-server-opt. > > which options are different if you are building for a stable update? I have in my .sbuildrc: $autopkgtest_opts = ['--apt-upgrade', '--', 'lxc', '-s', 'autopkgtest-testing']; For a stable update, I instead need $autopkgtest_opts = ['--apt-upgrade', '--', 'lxc', '-s', 'autopkgtest-stable']; But in general, the idea that it is impossible to override settings from a configuration file seems an unfortunate design choice. Best wishes, Julian
Bug#1015833: sbuild: would be helpful to be able to override the autopkgtest options
Hi, On Fri, 22 Jul 2022 08:25:25 +0100 Julian Gilbey wrote: > The sbuild(1) manpage says: > >--autopkgtest-opt=options > Pass the specified option directly to autopkgtest in addition to > the options already passed by sbuild. [...] > > and similarly for --autopkgtest-opts. However, my ~/.sbuildrc > specifies default autopkgtest options, and I sometimes need to > override those. It would be very helpful if there was a command-line > option to pass the specified options *instead of* the options already > passed by sbuild, for example if I am building a package for a stable > update. > > The same applies for all of the autopkgtest related options, such as > --autopkgtest-virt-server-opt. which options are different if you are building for a stable update? Thanks! cheers, josch signature.asc Description: signature
Bug#1015833: sbuild: would be helpful to be able to override the autopkgtest options
Package: sbuild Version: 0.83.1 Severity: normal Hi! The sbuild(1) manpage says: --autopkgtest-opt=options Pass the specified option directly to autopkgtest in addition to the options already passed by sbuild. [...] and similarly for --autopkgtest-opts. However, my ~/.sbuildrc specifies default autopkgtest options, and I sometimes need to override those. It would be very helpful if there was a command-line option to pass the specified options *instead of* the options already passed by sbuild, for example if I am building a package for a stable update. The same applies for all of the autopkgtest related options, such as --autopkgtest-virt-server-opt. Best wishes, Julian