]> Cypherpunks.ru repositories - goredo.git/blob - faq.texi
Texinfo-ed documentation and tarballs preparation
[goredo.git] / faq.texi
1 @node FAQ
2 @unnumbered FAQ
3
4 @anchor{Stamping}
5 @section Hashing and stamping
6
7 All targets are checksummed if their @file{ctime} differs from the
8 previous one. @command{apenwarr/redo} gives many reasons why every time
9 checksumming is bad, but in my opinion in practice all of them do not
10 apply.
11
12 @itemize
13 @item Aggregate targets and willing to be out-of-date ones just must not
14   produce empty output files. @command{apenwarr/*}, @command{redo-c} and
15   @command{goredo} implementations consider non existing file as an
16   out-of-date target
17 @item If you really wish to produce an empty target file, just touch @file{$3}
18 @end itemize
19
20 DJB's proposal with both @file{stdout} and @file{$3} gives that ability
21 to control your desired behaviour. Those who does not capture
22 @file{stdout} -- failed. Those who creates an empty file if no
23 @file{stdout} was written -- failed.
24
25 redo is a tool to help people. Literally all targets can be safely
26 @code{redo-stamp < $3}-ed, reducing false positive out-of-dates. Of
27 course, with the correct @file{stdout}/@file{$3} working and placing
28 necessary results in @file{$3}, instead of just silently feeding them in
29 redo-stamp.
30
31 redo implementations are already automatically record -ifchange on
32 @file{.do} files and -ifcreate on non-existing @file{.do} files. So why
33 they can not record redo-stamp the same way implicitly? No, Zen of
34 Python does not applicable there, because -ifchange/-ifcreate contradict
35 it already.
36
37 Modern cryptographic hash algorithms and CPUs are so fast, that even all
38 read and writes to or from hard drive arrays can be easily checksummed
39 and transparently compressed, as ZFS with LZ4 and Skein/BLAKE[23]
40 algorithms demonstrate us.
41
42 @command{goredo} includes @command{redo-stamp}, that really records the
43 stamp in the @file{.dep} file, but it does not play any role later. It
44 is stayed just for compatibility.
45
46 @section Can removed .do lead to permanent errors of its non existence?
47
48 Yes, because dependency on it was recorded previously. Is it safe to
49 assume that @file{.do}-less target now is an ordinary source-file? I
50 have no confidence in such behaviour. So it is user's decision how to
51 deal with it, probably it was just his inaccuracy mistake. If you really
52 want to get rid of that dependency knowledge for @file{foo/bar} target,
53 then just remove @file{foo/.redo/bar.dep}.
54
55 @section Does redo-always always rebuilds target?
56
57 @command{goredo}, together with @command{apenwarr/redo}, rebuilds target
58 once per @strong{run}.
59 Always rebuilds during every redo invocation, but only once during it
60 building.
61 @url{http://news.dieweltistgarnichtso.net/bin/redo-sh.html#why-built-twice, redo-sh}
62 has other opinion, that is why its @file{redo-sh.tests/always_rebuild_1}
63 will fail. Rebuilding of always-ed targets even during the same build
64 process ruins any redo's usability in practice.
65
66 For example if my @file{.h} file contains source code's version number,
67 that is @command{git describe}'s output and all my other files depends
68 on that header, then any @command{redo-ifchange} of @file{.o} will lead
69 to @command{git describe} execution, that is rather heavy. Of course,
70 because of either hashing or possible @command{redo-stamp}-ing its
71 dependants won't be rebuilt further, but build time will be already
72 ruined. If you need to rebuild TeX documents (case mentioned in
73 redo-sh's FAQ) until all references and numbers are ready, then you must
74 naturally expectedly explicitly use while cycle in your @file{.do}, as
75 @command{apenwarr/redo} already suggests.