#1110474 dgit: Some sbuild tests fail under tests/run-all

#1110474#5
Date:
2025-08-06 10:29:40 UTC
From:
To:
Hello,

The quilt-gbp-build-modes-sbuild and sbuild-gitish tests fail for me
when run under tests/run-all.  Hacking that script such that jcpus=-j1
avoids the issue.

I am not sure that the problem is that my sbuild setup actually can't do
the parallelism.  This problam has only recently emerged, possibly with
the upgrade to trixie -- but I did make *some* changes to my sbuild
setup relatively recently.

Looking in the test output:

#1110474#10
Date:
2025-08-06 11:16:10 UTC
From:
To:
Sean Whitton writes ("Bug#1110474: dgit: Some sbuild tests fail under tests/run-all"):

You don't give an actual error message.  (run-all leaves them in files
called .log)  Is it stochastic somehow?
...

The tests all set HOME, so that they are uninfluenced by (for example)
unwanted things in the user's devscripts or git configuration,
etc. etc.

I have sbuild 0.89.3 and it WFM.  All my schroot configuration is in
/etc.

Ian.

#1110474#15
Date:
2025-08-06 11:49:05 UTC
From:
To:
Hello,

It seems to be stochastic indeed.  For example using this:

    tests/using-intree tests/run-all tests/tests/quilt-gbp-build-modes-sbuild tests/tests/sbuild-gitish

means only sbuild-gitish fails.
I can get them both to fail by doing just

    tests/using-intree tests/run-all

I don't want to post those whole .log files publically, so here are some
extracts:

quilt-gbp-build-modes-sbuild:
--8<---------------cut here---------------start------------->8---
CD ..
moving example_1.0-2.dsc, example_1.0-2_source.changes, etc. to /home/swhitton/src/dgit/dgit/tests/tmp/quilt-gbp-build-modes-sbuild/example/..
 renaming (Files) example_1.0.orig-docs.tar.gz
 renaming (Files) example_1.0.orig.tar.gz
 renaming (Files) example_1.0-2.debian.tar.xz
 renaming (dsc) example_1.0-2.dsc
 renaming (changes) example_1.0-2_source.changes
CD /home/swhitton/src/dgit/dgit/tests/tmp/quilt-gbp-build-modes-sbuild/example
CD ..
+ sbuild --no-source --no-source-only-changes -d unstable -c sid --arch-all example_1.0-2.dsc
The Debian buildds switched to the "unshare" backend and sbuild will default to it in the future.
To start using "unshare" add this to your `~/.config/sbuild/config.pl`:
	$chroot_mode = "unshare";
If you want to keep the old "schroot" mode even in the future, add the following to your `~/.config/sbuild/config.pl`:
	$chroot_mode = "schroot";
	$schroot = "schroot";
E: Failed to explain bd-uninstallable
dgit: failed command: sbuild --no-source --no-source-only-changes -d unstable -c sid --arch-all example_1.0-2.dsc

dgit: error: subprocess failed with error exit status 1
+ local 'ps=255 0'
+ set -o pipefail
+ bm-quirk-sbuild-after-act
+ local arch
++ dpkg-architecture -qDEB_BUILD_ARCH
+ arch=amd64
+ local sblog=../example_1.0-2_amd64.build
+ '[' -e ../example_1.0-2_amd64.build ']'
+ sed '
			s/^EXAMPLE RULES TARGET clean/HOOK SUPPRESSED &/;
		'
+ exec
+ echo '===== [sbuild_-c_sid_--arch-all,git,for-build-modes] dgit  --clean=git --quilt=gbp sbuild -c sid --arch-all ====='
+ case $ps in
+ actual_status=failure
+ echo 'OPERATION FAILED'
+ case "$require_fail-$tolerate_fail-$actual_status" in
+ fail 'RF=unexpect TF=unexpect AS=failure'
+ echo 'failed: RF=unexpect TF=unexpect AS=failure'
failed: RF=unexpect TF=unexpect AS=failure
+ exit 1
+ rc=1
+ set +x

%%%%%%%%%%%%%%%%%%%% EXITING 1 %%%%%%%%%%%%%%%%%%%%

		Most relevant logs are just before assignment rc=1
		Will now do cleanup etc.
--8<---------------cut here---------------end--------------->8---

sbuild-gitish.log:
--8<---------------cut here---------------start------------->8---
++ sbuild -v -d sid -A --no-clean-source '--dpkg-source-opts=-Zgzip -z1 --format=1.0 -sn'
The Debian buildds switched to the "unshare" backend and sbuild will default to it in the future.
To start using "unshare" add this to your `~/.config/sbuild/config.pl`:
	$chroot_mode = "unshare";
If you want to keep the old "schroot" mode even in the future, add the following to your `~/.config/sbuild/config.pl`:
	$chroot_mode = "schroot";
	$schroot = "schroot";
dpkg-source: warning: native package version may not have a revision
dpkg-source: warning: source directory 'example' is not <sourcepackage>-<upstreamversion> 'example-1.1'
dpkg-source: info: using source format '1.0'
dpkg-source: info: building example in example_1.1-1.tar.gz
dpkg-source: info: building example in example_1.1-1.dsc
sbuild (Debian sbuild) 0.89.3 (07 June 2025) on zephyr.silentflame.com

+==============================================================================+
| example 1.1-1 (amd64)                        Wed, 06 Aug 2025 11:41:40 +0000 |
+==============================================================================+

Package: example
Version: 1.1-1
Source Version: 1.1-1
Distribution: sid
Machine Architecture: amd64
Host Architecture: amd64
Build Architecture: amd64
Build Type: binary

I: Setting up the chroot...
I: Creating chroot session...
I: Setting up log color...
I: Setting up apt archive...

+------------------------------------------------------------------------------+
| Update chroot                                Wed, 06 Aug 2025 11:41:41 +0000 |
+------------------------------------------------------------------------------+

Get:1 http://uk.mirrors.clouvider.net/debian unstable InRelease [216 kB]
Get:2 http://uk.mirrors.clouvider.net/debian unstable/main Sources.diff/Index [63.6 kB]
Get:3 http://incoming.debian.org/debian-buildd buildd-unstable InRelease [53.8 kB]
Get:4 http://uk.mirrors.clouvider.net/debian unstable/non-free Sources.diff/Index [63.3 kB]
Get:5 http://uk.mirrors.clouvider.net/debian unstable/contrib Sources.diff/Index [63.3 kB]
Get:6 http://uk.mirrors.clouvider.net/debian unstable/non-free-firmware Sources.diff/Index [63.3 kB]
Get:7 http://uk.mirrors.clouvider.net/debian unstable/main amd64 Packages.diff/Index [63.6 kB]
Get:8 http://uk.mirrors.clouvider.net/debian unstable/contrib amd64 Packages.diff/Index [63.3 kB]
Get:9 http://uk.mirrors.clouvider.net/debian unstable/non-free-firmware amd64 Packages.diff/Index [63.3 kB]
Get:10 http://uk.mirrors.clouvider.net/debian unstable/non-free amd64 Packages.diff/Index [63.3 kB]
Get:11 http://incoming.debian.org/debian-buildd buildd-unstable/main amd64 Packages [55.0 kB]
Get:12 http://uk.mirrors.clouvider.net/debian unstable/main Sources T-2025-08-06-0804.20-F-2025-08-03-1404.31.pdiff [32.8 kB]
Get:13 http://uk.mirrors.clouvider.net/debian unstable/non-free Sources T-2025-08-04-1404.44-F-2025-08-04-0804.27.pdiff [615 B]
Get:14 http://uk.mirrors.clouvider.net/debian unstable/contrib Sources T-2025-08-04-1404.44-F-2025-08-04-1404.44.pdiff [308 B]
Get:15 http://uk.mirrors.clouvider.net/debian unstable/non-free-firmware Sources T-2025-08-04-0204.46-F-2025-08-04-0204.46.pdiff [319 B]
Get:16 http://uk.mirrors.clouvider.net/debian unstable/main amd64 Packages T-2025-08-06-0804.20-F-2025-08-03-1404.31.pdiff [36.8 kB]
Get:17 http://uk.mirrors.clouvider.net/debian unstable/contrib amd64 Packages T-2025-08-04-1404.44-F-2025-08-04-1404.44.pdiff [219 B]
Get:18 http://uk.mirrors.clouvider.net/debian unstable/non-free-firmware amd64 Packages T-2025-08-04-0204.46-F-2025-08-04-0204.46.pdiff [220 B]
Get:19 http://incoming.debian.org/debian-buildd buildd-unstable/contrib amd64 Packages [860 B]
Get:16 http://uk.mirrors.clouvider.net/debian unstable/main amd64 Packages T-2025-08-06-0804.20-F-2025-08-03-1404.31.pdiff [36.8 kB]
Get:15 http://uk.mirrors.clouvider.net/debian unstable/non-free-firmware Sources T-2025-08-04-0204.46-F-2025-08-04-0204.46.pdiff [319 B]
Get:14 http://uk.mirrors.clouvider.net/debian unstable/contrib Sources T-2025-08-04-1404.44-F-2025-08-04-1404.44.pdiff [308 B]
Get:13 http://uk.mirrors.clouvider.net/debian unstable/non-free Sources T-2025-08-04-1404.44-F-2025-08-04-0804.27.pdiff [615 B]
Get:18 http://uk.mirrors.clouvider.net/debian unstable/non-free-firmware amd64 Packages T-2025-08-04-0204.46-F-2025-08-04-0204.46.pdiff [220 B]
Get:17 http://uk.mirrors.clouvider.net/debian unstable/contrib amd64 Packages T-2025-08-04-1404.44-F-2025-08-04-1404.44.pdiff [219 B]
Get:12 http://uk.mirrors.clouvider.net/debian unstable/main Sources T-2025-08-06-0804.20-F-2025-08-03-1404.31.pdiff [32.8 kB]
Get:20 http://uk.mirrors.clouvider.net/debian unstable/non-free amd64 Packages T-2025-08-04-1404.44-F-2025-08-04-1404.44.pdiff [195 B]
Get:20 http://uk.mirrors.clouvider.net/debian unstable/non-free amd64 Packages T-2025-08-04-1404.44-F-2025-08-04-1404.44.pdiff [195 B]
Fetched 904 kB in 1s (738 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be upgraded:
  libc-bin libc-dev-bin libc6 libc6-dev
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 5531 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://incoming.debian.org/debian-buildd buildd-unstable/main amd64 libc6-dev amd64 2.41-12 [1991 kB]
Get:2 http://incoming.debian.org/debian-buildd buildd-unstable/main amd64 libc-dev-bin amd64 2.41-12 [58.2 kB]
Get:3 http://incoming.debian.org/debian-buildd buildd-unstable/main amd64 libc6 amd64 2.41-12 [2846 kB]
Get:4 http://incoming.debian.org/debian-buildd buildd-unstable/main amd64 libc-bin amd64 2.41-12 [637 kB]
Preconfiguring packages ...
Fetched 5531 kB in 0s (341 MB/s)
(Reading database ... .(Reading database ... 5%.(Reading database ... 10%.(Reading database ... 15%.(Reading database ... 20%.(Reading database ... 25%.(Reading database ... 30%.(Reading database ... 35%.(Reading database ... 40%.(Reading database ... 45%.(Reading database ... 50%.(Reading database ... 55%.(Reading database ... 60%.(Reading database ... 65%.(Reading database ... 70%.(Reading database ... 75%.(Reading database ... 80%.(Reading database ... 85%.(Reading database ... 90%.(Reading database ... 95%.(Reading database ... 100%.(Reading database ... 11888 files and directories currently installed.)
Preparing to unpack .../libc6-dev_2.41-12_amd64.deb ...
Unpacking libc6-dev:amd64 (2.41-12) over (2.41-11) ...
Preparing to unpack .../libc-dev-bin_2.41-12_amd64.deb ...
Unpacking libc-dev-bin (2.41-12) over (2.41-11) ...
Preparing to unpack .../libc6_2.41-12_amd64.deb ...
Unpacking libc6:amd64 (2.41-12) over (2.41-11) ...
Setting up libc6:amd64 (2.41-12) ...
(Reading database ... .(Reading database ... 5%.(Reading database ... 10%.(Reading database ... 15%.(Reading database ... 20%.(Reading database ... 25%.(Reading database ... 30%.(Reading database ... 35%.(Reading database ... 40%.(Reading database ... 45%.(Reading database ... 50%.(Reading database ... 55%.(Reading database ... 60%.(Reading database ... 65%.(Reading database ... 70%.(Reading database ... 75%.(Reading database ... 80%.(Reading database ... 85%.(Reading database ... 90%.(Reading database ... 95%.(Reading database ... 100%.(Reading database ... 11888 files and directories currently installed.)
Preparing to unpack .../libc-bin_2.41-12_amd64.deb ...
Unpacking libc-bin (2.41-12) over (2.41-11) ...
Setting up libc-bin (2.41-12) ...
Setting up libc-dev-bin (2.41-12) ...
Setting up libc6-dev:amd64 (2.41-12) ...

+------------------------------------------------------------------------------+
| Fetch source files                           Wed, 06 Aug 2025 11:41:44 +0000 |
+------------------------------------------------------------------------------+

Local sources
-------------

/home/swhitton/src/dgit/dgit/tests/tmp/sbuild-gitish/example_1.1-1.dsc exists in /home/swhitton/src/dgit/dgit/tests/tmp/sbuild-gitish; copying to chroot
/usr/bin/sh: 1: cannot create /build/reproducible-path/example_1.1-1.dsc: Directory nonexistent
chown: cannot access '/build/reproducible-path/example_1.1-1.dsc': No such file or directory
E: Can't chown /build/reproducible-path/example_1.1-1.dsc to swhitton:sbuild:
E: Failed to set sbuild group ownership on /build/reproducible-path/example_1.1-1.dsc
E: Could not copy /home/swhitton/src/dgit/dgit/tests/tmp/sbuild-gitish/example_1.1-1.dsc to /build/reproducible-path/example_1.1-1.dsc

+------------------------------------------------------------------------------+
| Cleanup                                      Wed, 06 Aug 2025 11:41:44 +0000 |
+------------------------------------------------------------------------------+

Purging /build/reproducible-path
rm: cannot remove '/build/reproducible-path': No such file or directory
E: Can't unlink /build/reproducible-path:
E: unable to remove build directory
Not cleaning session: cloned chroot in use
E: Failed to fetch source files

+------------------------------------------------------------------------------+
| Summary                                      Wed, 06 Aug 2025 11:41:44 +0000 |
+------------------------------------------------------------------------------+

Build Architecture: amd64
Build Type: binary
Build-Space: n/a
Build-Time: 0
Distribution: sid
Fail-Stage: fetch-src
Host Architecture: amd64
Install-Time: 0
Job: /home/swhitton/src/dgit/dgit/tests/tmp/sbuild-gitish/example_1.1-1.dsc
Machine Architecture: amd64
Package: example
Package-Time: 0
Source-Version: 1.1-1
Space: n/a
Status: given-back
Version: 1.1-1
--------------------------------------------------------------------------------
Finished at 2025-08-06T11:41:40Z
Build needed 00:00:00, no disk space
E: Failed to fetch source files
+ rc=3
+ set +x

%%%%%%%%%%%%%%%%%%%% EXITING 3 %%%%%%%%%%%%%%%%%%%%

		Most relevant logs are just before assignment rc=3
		Will now do cleanup etc.
--8<---------------cut here---------------end--------------->8---

Looking at my sbuild config, there isn't anything that should be
relevant.  I think that for me too everything that the test suite should
depend on is in /etc.  And I've been successfully using the dgit test
suite for some years.

#1110474#20
Date:
2025-08-06 11:54:14 UTC
From:
To:
Sean Whitton writes ("Re: Bug#1110474: dgit: Some sbuild tests fail under tests/run-all"):

Surely this is can be nothing but a bug in sbuild.  Nothing in our
test suite or our test package or anything, has anything to do with
this.

I guess maybe I'm not seeing this because my chroots are all LVM.
Perhaps that disables the new backend.

Ian.

#1110474#25
Date:
2025-08-06 12:08:12 UTC
From:
To:
Hello,

I guess it is plausible that such a thing would come up when builds are
done in parallel, yeah.

The new backend isn't the default yet, so I don't believe I'm using it
either.

#1110474#30
Date:
2025-08-06 18:10:56 UTC
From:
To:
control: reassign -1 schroot 1.6.13-7
control: affects -1 sbuild
control: retitle -1 schroot: inadvertedly shared /build/reproducible-path
control: severity -1 important

Dear maintainer,

/etc/schroot/sbuild/fstab contains this:

    # Mount a large scratch space for the build, so we don't use up
    # space on an LVM snapshot of the chroot itself.
    /var/lib/sbuild/build  /build   none    rw,bind         0       0

This worked fine when builds happened in directories with names like
/build/example-09NKJF/, as they used to.  However, with recent sbuild,
all builds use /build/reproducible-path/.  But then if you try to do
more than one build at once, they both try to use, effectively,
/var/lib/sbuild/build/reproducible-path/, and stomp all over each other.

I would suggest that these lines be removed from the default
/etc/schroot/sbuild/fstab.  Another possibility would be to mount a
tmpfs there, but maybe that should be left to the local administrator.

Thanks.

#1110474#47
Date:
2025-08-08 18:20:35 UTC
From:
To:
Sean Whitton wrote...
(...)

At a quick glance, both suggestion don't feel right. Especially when the
build creates a lot of data there.

Just removing that line means the chroot may just run full, depending on
the backend and other configurations. Using tmpfs may likewise trigger
OOM situations.

The only sensible solution I can think of here was schroot will do the
job sbuild no longer wants to do: Create a temporary directory in that
scratch space, mount it to /build inside, and clean up afterwards. This
however can no longer be achieved using an fstab line.

This requires some more checking. Your thoughts?

    Christoph

#1110474#52
Date:
2025-08-09 09:03:50 UTC
From:
To:
Hello,

As you mention, it is difficult to think about it because there are so
many possible configurations for schroots.

The solution you propose means maintaining most of the assumptions made
by the approach implemented by the fstab line.  Therefore it seems least
likely to introduce problems for users.  So, I agree.
Thank you for thinking it through.

#1110474#57
Date:
2025-09-29 08:29:45 UTC
From:
To:
Hi Sean,

* Sean Whitton <spwhitton@spwhitton.name> [2025-08-09 10:03]:

Set:

$build_path = '';

to get the old behavior.

https://sources.debian.org/src/sbuild/0.90.2/debian/NEWS#L21

Cheers Jochen

#1110474#62
Date:
2025-09-29 14:30:52 UTC
From:
To:
Hello,

Thanks for the workaround, but I do think the new behaviour is better,
and hope we can come up with a better overall solution.