home of the madduck/ blog/
Build dependencies and the clean target

I find it rather annoying that some packages require their build-dependencies to be satisfied to run fakeroot debian/rules clean. Those packages include:

I think they all should fail gracefully when asked to clean themselves, even if the build dependencies aren't satisfied. Rationale: if the build dependencies aren't there, there's probably nothing to clean.

Otherwise it's a royal pain to quickly build packages on production systems with pbuilder or the like -- those clean first (rightly so), then try to package.

Of course, an alternative would be to tell pbuilder to ignore failures from the clean process. But I'd much rather fix causes than symptoms. Also, this would mean that the clean target may actually not finish, because commands after the failed one get ignored.

So please, prefix your dh_* or similar lines with a - (minus sign) in the clean target of debian/rules today. That minus will make ignore the errors.

Thanks.

/me now awaits the flame flood.

Update: the discussion is going on (#debian-devel/irc.debian.org). It has been claimed that pbuilder must be fixed. I'd like to point out that dpkg-buildpackage does not check for build dependencies when asked to build a source package (which is when you need the clean target) with the -S switch.

Update \^2: I could be coerced into accepting dpkg-buildpackage fixed to check for build dependencies before it cleans the source tree in the process of creating a source package. Note that it does this unless you pass -S, because then you're actually asking it to build the binary package, not just the source.

The real question I guess is whether build dependencies need to be satisfied to "build" a source package.

Update \^3: Junichi, the pbuilder author, has since followed up.