Iain Lane wrote: > I'm trying to build a package with the rules file at [0]. The important > part of this is that I have defined a binary-indep target, mandatory > according to policy, which builds the architecture-independent > documentation. When building this using both sbuild and pbuilder, the > package FTBFS due to the binary-indep rule not being invoked. I have > attached a buildlog for you to look at. You can see "dh binary" being > called, but the binary-indep target is never invoked. > > I would expect that it should be possible to selectively override these > entire targets in a DH7 style short rules file. Is it reasonable and > possible for this to be done?
The right way to understand what "dh binary" does is that it runs every
debhelper command in the binary sequence, skipping commands that have
already been run.
If you want the binary target to call the binary-indep target, you need to
tell make that, just like you would without dh:
binary: binary-arch binary-indep
Could dh be made to look for the binary-indep, binary-arch, install, and
build targets and call them implicitly? I think that adding code to do that
would not be very hard, since dh already has code to detect if a target exits.
But is it a good idea?
Well, there's a chance of breaking a rules file that has eg, a stray
install target that is not currently called. After all, the install target
is only a convention (introduced by debhelper originally IIRC), not really
a well-defined or required rules file target. So I would probably only
make this kind of change in v8.
There's also the problem of running targets twice. Consider this rules file:
%:
dh $@
binary: binary-arch binary-indep
binary-arch:
expensive_thing
dh binary-arch
If dh binary implicitly ran the binary-arch target, it would get run twice,
because make is already running it as an explicit target of the binary target.
It would be difficult to avoid this; dh would have to parse all the
dependencies, and figure out that make explicitly will run the target.
--
see shy jo
signature.asc
Description: Digital signature

