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

From: Sergey Matveev <stargrave_AT_stargrave.org>
Date: Thu, 14 Jan 2021 17:46:34 +0300

*** Greg Reagle [2021-01-14 06:39]:
>If I happen to create a file with the same name as a phony target (e.g. "install"), then redo will refuse to run the rule.

It depends on how your rule (.do) is written. If it has no dependencies,
no redo-always or anything similar, then it has no obligations to run.
apenwarr/redo and goredo explicitly check if target's file is not
modified manually and warn about that situation. It can not do anything,
to prevent any accidental harm.

    $ mkdir foo ; cd foo
    $ echo 'echo called >&2' > install.do
    $ redo install
    install called
    $ redo install
    install called
    $ touch install
    $ redo install
    warn install externally modified: not redoing

apenwarr/redo should give similar warning, as I remember. You have to
manually fix the consistency of your targets/source files. install.do
does not "remember" that it created "install" with given timestamps, so
it warns you about that.

>Is that correct?

Yes.

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263  6422 AE1A 8109 E498 57EF
Received on Thu Jan 14 2021 - 15:46:34 CET

This archive was generated by hypermail 2.3.0 : Thu Jan 14 2021 - 15:48:10 CET