]> Cypherpunks.ru repositories - goredo.git/blob - doc/faq.texi
Full documentation
[goredo.git] / doc / faq.texi
1 @node FAQ
2 @unnumbered FAQ
3
4 @anchor{Stamping}
5 @section Hashing and stamping
6
7 All targets are checksummed if target's @file{ctime} differs from the
8 previous one, or @env{REDO_INODE_NO_TRUST} environment variable is set.
9 @command{apenwarr/redo} gives
10 @url{https://redo.readthedocs.io/en/latest/FAQImpl/#why-not-always-use-checksum-based-dependencies-instead-of-timestamps, many reasons}
11 why every time checksumming is bad, but in my opinion in practice all of
12 them do not apply.
13
14 @itemize
15 @item Aggregate targets and willing to be out-of-date ones just must not
16   produce empty output files. @command{apenwarr/*}, @command{redo-c} and
17   @command{goredo} implementations consider non existing file as an
18   out-of-date target
19 @item If you really wish to produce an empty target file, just touch @file{$3}
20 @end itemize
21
22 DJB's proposal with both @file{stdout} and @file{$3} gives that ability
23 to control your desired behaviour. Those who do not capture
24 @file{stdout} -- failed. Those who create an empty file if no
25 @file{stdout} was written -- failed.
26
27 redo is a tool to help people. Literally all targets can be safely
28 @code{redo-stamp < $3}-ed, reducing false positive out-of-dates. Of
29 course, with the correct @file{stdout}/@file{$3} working and placing
30 necessary results in @file{$3}, instead of just silently feeding them in
31 @command{redo-stamp}.
32
33 redo implementations are already automatically record -ifchange on
34 @file{.do} files and -ifcreate on non-existing @file{.do} files. So why
35 they can not record @command{redo-stamp} the same way implicitly? No,
36 Zen of Python does not applicable there, because -ifchange/-ifcreate
37 contradict it already.
38
39 Modern cryptographic hash algorithms and CPUs are so fast, that even all
40 read and writes to or from hard drive arrays can be easily checksummed
41 and transparently compressed, as ZFS with LZ4/Zstandard and
42 Skein/BLAKE[23] algorithms demonstrate us.
43
44 @command{goredo} includes @command{redo-stamp}, that really records the
45 stamp in the @file{.rec} file, but it does not play any role later. It
46 is stayed just for compatibility.
47
48 @section Can removed .do lead to permanent errors of its non existence?
49
50 Yes, because dependency on it was recorded previously. Is it safe to
51 assume that @file{.do}-less target now is an ordinary source-file? I
52 have no confidence in such behaviour. So it is user's decision how to
53 deal with it, probably it was just his inaccuracy mistake. If you really
54 want to get rid of that dependency knowledge for @file{foo/bar} target,
55 then just remove @file{foo/.redo/bar.rec}.
56
57 @section Does redo-always always rebuilds target?
58
59 By definition, it should be build always, as
60 @url{http://news.dieweltistgarnichtso.net/bin/redo-sh.html#why-built-twice,
61 redo-sh} and @command{redo-c} implementations do. But that ruins the
62 whole redo usability, potentially rebuilding everything again and again.
63 @command{apenwarr/redo} and @command{goredo} tries to build
64 always-targets only once per @strong{run}, as a some kind of optimization.
65
66 For example if you need to rebuild TeX documents (case mentioned in
67 redo-sh's FAQ) until all references and numbers are ready, then you must
68 naturally expectedly explicitly use while cycle in your @file{.do}, as
69 @command{apenwarr/redo} already suggests.
70
71 @section What to do with OOD targets, that has not changed their output?
72
73 How to prevent building of targets, who depend on the OOD target, that
74 produced the same output? If the target is already decided to be OOD,
75 then the whole tree becomes OOD too. It is clear, simple, reliable and
76 honest way of do-ing things.
77
78 Building of the lower level OOD target first is unfair and dishonest
79 thing to do, because probably top level target, being the OOD, won't be
80 dependant on lower level target anymore at all. Actually @command{goredo}
81 does this as a shameful hack and only for always-targets, still existing
82 in the wild. The whole @command{redo-always} idea is wrong.
83
84 If you wish to run something and decide if it must OOD the toplevel
85 targets, then just run @command{redo} to forcefully rebuild it and then
86 run the ordinary top level targets.