Hi Roberto,

Quoting Roberto C. Sanchez (2025-05-10 03:39:25)
> I reproduced this on a fresh bookworm install.

thank you for your very detailed bug report. It contains everything I wanted to
know and I appreciate that you performed the steps from a fresh install. I can
verify your findings from within a vanilla debvm of Bookworm as well.

I'll leave some remarks in your reproducer instructions but they do not change
the issue you report.

> Steps to reproduce:
> 
> 1. configure backports repo
> 2. install git-buildpackage: apt-get install git-buildpackage
> 3. install sbuild: apt-get install -t bookworm-backports sbuild
> 4. create an appropriate sbuild environment:
>    mkdir -p ~/.cache/sbuild
>    mmdebstrap --verbose --mode=unshare --architecture="$(dpkg 
> --print-architecture)" --variant=apt 
> --hook-dir=/usr/share/mmdebstrap/hooks/maybe-merged-usr bookworm 
> ~/.cache/sbuild/bookworm-$(dpkg --print-architecture).tar.zst 
> /etc/apt/sources.list

Note, that with sbuild from backports, you do no longer need to manually create
the build chroot. If you did not create one, then sbuild will create one for
you automatically, so the last step above is superfluous.

Some even smaller remarks:

 - you don't need to pass "dpkg --print-architecture" because that's the
   default for --architecture anyways
 - why do you create a --variant=apt chroot as a buildd chroot? It will work
   but you might want to create a --variant=buildd chroot so that you do not
   install all the build-essential packages over and over again
 - you can drop maybe-merged-usr with trixie
 - there is probably no gain in compressing your tarball -- it just wastes
   CPU every time you create it and every time you unpack it

>    /bin/echo -e '$chroot_mode="unshare";\n$clean_source=0;\n1;' > ~/.sbuildrc
> 4. clone an arbitrary package from Salsa: git clone 
> https://salsa.debian.org/debian/krb5
> 5. Execute the build:
>    cd krb5
>    git branch upstream origin/upstream
>    git branch pristine-tar origin/pristine-tar
>    git checkout -b bookworm origin/bookworm

You can avoid tracking each of the branches by using:

 debcheckout --git-track='*' krb5

Another great replacement for a raw 'git clone' is:

 gbp clone https://salsa.debian.org/debian/krb5

Which can also have --add-upstream-vcs but none of this is relevant here,
because:

>    gbp buildpackage --git-builder='sbuild -d bookworm --no-run-lintian 
> --source-only-changes' --git-debian-branch=bookworm

You can reproduce the bug even without gbp and without downloading the source
first. Here is a smaller reproducer:

sbuild -d bookworm --no-run-lintian --source-only-changes --extra-repository 
"deb-src http://deb.debian.org/debian bookworm main" hello

> 6. Observe the presence of the buildinfo in the resulting source.changes:
>    grep buildinfo ../*_source.changes

This is something that dpkg-genchanges does. Sbuild runs this:

    dpkg-genchanges --build=source

And that will include a reference to the buildinfo if before running this
command, the package was already built. If you run "debian/rules clean" before
running above command, then the resulting .changes file will *not* contain a
reference to the buildinfo.

If you think that this is a bug, you should re-assign this to dpkg.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to