This page gathers information about two related issues:
- failing to build source after successful build
- failing to build binary packages after successful build
mass-bug-filings were done for both issues in August 2023.
Please help improve this page!
Discussion on debian-devel@l.d.o: https://lists.debian.org/debian-devel/2023/08/msg00031.html
Context: Debian Policy section 4.9
https://www.debian.org/doc/debian-policy/ch-source.html#main-building-script-debian-rules
clean (required) This must undo any effects that the build and binary targets may have had, except that it should leave alone any output files created in the parent directory by a run of a binary target.
How to reproduce
using dpkg-buildpackage
source build:
dpkg-buildpackage -b && dpkg-buildpackage -S
binary build:
dpkg-buildpackage -b && dpkg-buildpackage -b
using sbuild
source build:
sbuild -A -d unstable -v --no-run-lintian \ --finished-build-commands="cd %SBUILD_PKGBUILD_DIR && runuser -u $(id -un) -- dpkg-buildpackage --sanitize-env -us -uc -rfakeroot -S" \ package
binary build:
sbuild -A -d unstable -v --no-run-lintian \ --finished-build-commands="cd %SBUILD_PKGBUILD_DIR && runuser -u $(id -un) -- dpkg-buildpackage --sanitize-env -us -uc -rfakeroot -b" \ package
using pbuilder
pbuilder build --twice
Common issues (and ways to solve them)
- Files created during the build that need to be removed in the clean target:
Removing additional files or directories with dh_clean can be achieved by adding those to debian/clean. See https://manpages.debian.org/bookworm/debhelper/dh_clean.1
- auto-generated files included in the original source that are modified during the build:
they can be added to extend-diff-ignore in debian/source/options. See https://manpages.debian.org/stretch/dpkg-dev/dpkg-source.1 , and the following example:
# ignore changes on config.{sub,guess} extend-diff-ignore = "(^|/)(config.sub|config.guess)$"
using Salsa CI
Salsa CI include an opt-in test job to check how a package build twice in a row. Instructions to use it can be found at https://salsa.debian.org/salsa-ci-team/pipeline/#enable-building-packages-twice-in-a-row
Preventing future issues
sbuild users can easily integrate a clean-up validation step in their packaging workflow. Guidance on how to set this up is given on the sbuild wiki page.
All bugs
- failing to build source:
- failing to build binaries: