#1121037 sbuild du invocation in "Package contents" step fails when using --build-dir

#1121037#5
Date:
2025-11-19 22:56:29 UTC
From:
To:
Dear sbuild developers,

the "Package contents" step fails when a package is build using
`--build-dir` (and chroot_mode = unshare).

This is the error:

du: cannot access '../_packages/foo_1.202511192316.dsc': No such file or
directory
E: read_command failed to execute du
E: Cannot determine space needed for ../_packages/foo_1.202511192316.dsc
(du failed):

The invocation of sbuild was:

     rm -Rf _packages/
     mkdir _packages/
     cd foo
     sbuild --build-dir=../_packages

The dsc file created by sbuild is in `../`, not `../_packages/`.

Regards,

#1121037#10
Date:
2025-12-29 10:59:05 UTC
From:
To:
Hello,

I can confirm the issue even when using which is also on trixie with 0.89.3+deb13u1, even when using --build-dir=..

Is there any workaround?

Regards
Fab

#1121037#15
Date:
2025-12-30 10:28:08 UTC
From:
To:
As suggested by jochensp on IRC, workaround is to use full path (realpath) instead of relative path.
#1121037#20
Date:
2026-06-25 18:43:09 UTC
From:
To:
Also met this problem today. The du -k -s $file is executed with DIR=/.
This either should be fixed, or should be documented.

https://salsa.debian.org/debian/sbuild/-/blob/debian/0.91.9/lib/Sbuild/Build.pm#L3559

Best Regards,
Tianyu Chen