[debhelper-devel] Bug#880840: debhelper: build makefile rule does not replace dh build sequence

Niels Thykier niels at thykier.net
Sun Nov 5 08:23:00 UTC 2017


Control: tags -1 moreinfo

On Sat, 4 Nov 2017 23:36:04 +0000 James Cowgill <jcowgill at debian.org> wrote:
> Package: debhelper
> Version: 10.10.5
> Severity: normal
> 
> Hi,
> 
> If you create a rules file with a manual build target like this:
> #!/usr/bin/make -f
> %:
> 	dh $@
> 
> build:
> 	echo hi
> 
> Then, if you run the binary target directly, dh will run the build
> target, but then also run the normal build sequence.
> 
> [...]
> 
> I would expect the part from dh_update_autotools_config to dh_auto_test
> to be omitted in this case.
> 
> I noticed this when I tried to enable Rules-Requires-Root in libopenmpt.
> libopenmpt has a "build" target in debian/rules because upstream ships a
> top-level "build" directory and make will cause "debian/rules build" to
> be a no-op otherwise.
> 
> Thanks,
> James
> 

Hi James,

I believe you need to explicitly define the build-arch and build-indep
targets as well.  The reason being that:

  binary depends on binary-indep, binary-arch and >install<
  install depends on >install-arch<, >install-indep< and >build<
  install-arch depends on >build-arch<
  install-indep depends on >build-indep<
  ...

So dh ends up seeing that you provide a build target, but no build-arch
nor build-indep.  It then assumes it has to provide them for you, which
leads to the behaviour you see.

This becomes even more important when you do -B or -A builds, where the
"build" target is not even considered (because dh starts with
binary-arch or binary-indep respectively).

Thanks,
~Niels




More information about the debhelper-devel mailing list