Skip to content

tasks/sbuild.py passes '--no-clean' to `sbuild` but it does not have that option

In tasks/sbuild.py, method def _cmdline(self) -> list[str]: the following definition is found:

        cmd = [
             self.builder,
             "--no-clean",
             "--purge-deps=never",
         ]

A quick read of __init__ confirms that self.builder is initialized to sbuild, meaning this is the start of sbuild --no-clean --purge-deps=never ....

The "issue" is that sbuild does not have a --no-clean command-line option according to is manpage. It does have a --no-clean-source and with abbreviated command line options (default for Getopt::Long, which I suspect sbuild is using without confirming it), this is likely the option you are getting.

But even then, this option is documented to only be relevant for "unpacked source trees" and this method always ends the command line with cmd.append(str(self._dsc_file)), which would make the option redundant at best.

Note that dpkg-buildpackage does have a --no-clean, which could be what you wanted as well. However, sbuild requires that to be passed via --debbuildopts as I read the manpage.

If --no-clean was truly intended, I think a comment would be in order to explain what it does given sbuild's manpage does not document the option and why things work as intended.

Edited by Niels Thykier
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information