[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#499074: [checks/patch-systems] depend on $(QUILT_STAMPFN), not patch



Raphael Geissert <atomo64+debian@gmail.com> writes:
> Russ Allbery wrote:

>> Having a rule in debian/rules that depends on patch when using the
>> quilt makefile fragment is almost always wrong, since patch is a phony
>> target that will force any rule that depends on it to be rebuilt.  This
>> often results in repeated compiles on the buildds, wasting resources.

> Hmmm, I wouldn't be so "dramatic" (not quite the right word, but
> couldn't think about any other, sorry) as it is not always the
> case. Example:

[...]

> So the key point here is: the warning should not be emitted if the phony
> targets do *nothing* but depend on other targets.

I think the only interesting case there would be for an arch: all package
where the *only* build task is to apply a patch.  I believe such packages
exist, but I expect they're fairly rare.  I don't know if they're still
common enough that it's worth explicitly excluding that case.

There are three cases:  The one above, a non-phony target that depends on
patch such as:

build-stamp: patch
	# Do stuff....
        touch build-stamp

in which case build-stamp is rebuilt each time even if the stamp file
already exists, and a phony target that depends on patch:

build: patch
        # Do stuff but never create a file named build....

in which case the dependency doesn't cause any problems that aren't
already there, but that build will be redone on each run of debian/rules.
In the latter case, depending on how debian/rules is structured, it won't
necessarily result in duplicate work for the buildds (I believe it will if
binary depends on build and not otherwise), but I would argue that it's
not best practice for how to write a debian/rules file.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>



Reply to: