Re: [dev] can redo handle phony targets properly?

From: Sergey Matveev <stargrave_AT_stargrave.org>
Date: Sat, 9 Jan 2021 00:31:53 +0300

*** Greg Reagle [2021-01-08 09:55]:
>I am experiencing a problem with phony targets in redo [1]

Well, this is an issue not with the redo itself, but some of its
implementations. My redo implementation (goredo) actually will refuse to
work there too, because it has exactly the same safety check.

Problem here is not with the target/redo-always, but with the fact,
that redo's state has different information about the target's result.
As apenwarr/redo literally says: "you modified it".
goredo will say: "externally modified: not redoing".

When apenwarr/redo and goredo execute the target, they record resulting
file's metainformation in the state database. When the target is
rebuilt, they explicitly check that it is still was not modified someway
outside the redo. One possible way: user modified it, just to debug or
try something. If redo removes that "user modified" file... user will
certainly delete redo, that destroyed his work :-)

Actually that behaviour is very convenient -- you can make temporary
changes and debug everything more easily. And it is safe sane careful
precaution.

Files that are under "control" of redo's recipes/targets -- must be
under their control and must not be modified externally. Remove your
"clean", "dist" file and let redo's targets create and handle them.

apenwarr/redo, redo-c, apenwarr/do, goredo -- all of them will always
redo target if target's result/file does not exist. So clean.do, all.do,
dist.do and similar targets should not create output at all.

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263  6422 AE1A 8109 E498 57EF
Received on Fri Jan 08 2021 - 22:31:53 CET

This archive was generated by hypermail 2.3.0 : Fri Jan 08 2021 - 22:36:09 CET