#1095135 sbuild: binary .changes file is missing the .orig.tar for new packages

Package:
sbuild
Source:
sbuild
Submitter:
Michael R. Crusoe
Date:
2025-04-10 12:09:02 UTC
Severity:
normal
Tags:
#1095135#5
Date:
2025-02-04 08:23:28 UTC
From:
To:
Dear Maintainers,

Thank you for sbuild and the --unshare backend, it has really improved my packaging workflow!

The last remaining usage of pbuilder in my workflow was producing a binary .changes file that included a reference to the .orig.tar archive. Typical scenario for me is a first-time upload of a brand new package from a checkout of the Salsa package repository.

In #debian-devel today I learned that I can get sbuild to do this, but it requires passing `--source` on the command line, or setting `$build_source = 1;` in my sbuild.conf

This seems counterintuitive, am I missing something? Or perhaps there should be a new option or default behavior to include the .orig.tar for "-1" versions of packages and especially for packages with only one entry in d/changelog.

I've attached my .sbuildrc to this report, in case my configuration is causing a confusion.

Thanks!

#1095135#8
Date:
2025-04-10 12:06:06 UTC
From:
To:
Hi,

yes, adding --source or setting $build_source=1 is indeed not recommended.
Doing so instructs sbuild to build a new dsc and orig.targ.gz and debian.tar.gz
even though those files were the *input* to sbuild. I think there are only very
few uses of --source. One of them would be if you instruct sbuild to download
the source package from the archive for you and then do a sourceful rebuild
with a bumped version in d/changelog. In that case, the dsc that sbuild uses
only exists in the dsc and a new debian.tar.gz is built because sbuild changed
d/changelog and then you *want* sbuild to build a new source package for you.
But if you are working on a locally extracted source package, running sbuild
with --source is like running "convert foo.jpg bar.png" and then finding out
that imagemagick changed foo.jpg even though that was the *input* of the
convert command.

When preparing a new package or adding a new binary package to an existing
package, so you have to upload both the source *and* the binaries, I'd
recommend you use --source-only-changes which you are already doing because you
have $source_only_changes=1; in your ~/.config/sbuild/config.pl.

So the only thing you are "missing" is what to do with these .changes files.
One thing you can do is to run mergechanges:

    $ mergechanges yourpackage_0_arm64.changes yourpackage_0_source.changes > yourpackage_0_both.changes

Or you could use dgit and run:

    $ dgit sbuild
    $ dgit push-built

And then dgit will do the .changes handling for you.

Thanks!

cheers, josch