Re: redoing unnecessary targets when a do file is modified but the output remains unchanged

From: Sergey Matveev <stargrave_at_domain.hidden>
Date: Sat, 27 Feb 2021 12:09:49 +0300
Message-ID: <YDoMaCiTGDtB5lsu_at_domain.hidden>
Greetings!

I returned to that problem again and actually I do not see how it can be
solved fairly. For example Make has non-dynamic static dependency
information in its Makefiles and if A depends on B, then Make will:
    execute B, then execute A
But redo keeps dependencies information for OOD determination *only*. So
redo just:
    determines that A is OOD, because B is OOD, and then
    executes A.do,
        that *possibly* contains somewhever redo-ifchange B
    then it executes B.do, when redo-ifchange is called in A.do
"A" maybe OOD because of "B", but it does not mean that "B" it still the
dependency, that will be built anyway. Moreover, each .do explicitly
tells when to redo(-ifchange) targets -- and that can be at the very end
of some computations and preparations. redo-ifchange can be xargs-ed at
the very end of .do script/program. So, when we are build "B" and see
that it did not changed, we are *already* executing A.do, so we can not
"revert" that step backward, because without A.do execution we do not
know if B.do needs to be executed too.

Actually currently goredo already does unfair behaviour, explicitly
executing redo-always-ed targets first. Exactly just to prevent complete
rebuilding of everything because of honest redo-always-ed target. But I
just assume that in practice redo-always targets mostly used for some
kind of lightweight environment variable and configuration files checks.

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263  6422 AE1A 8109 E498 57EF

Received on 2021-02-27 09:09:49 UTC

This archive was generated by hypermail 2.4.0 : 2021-02-27 09:30:09 UTC