apenwarr-redo/t
Avery Pennarun f702417ef3 The second half of redo-stamp: out-of-order building.
If a depends on b depends on c, and c is dirty but b uses redo-stamp
checksums, then 'redo-ifchange a' is indeterminate: we won't know if we need
to run a.do unless we first build b, but the script that *normally* runs
'redo-ifchange b' is a.do, and we don't want to run that yet, because we
don't know for sure if b is dirty, and we shouldn't build a unless one of
its dependencies is dirty.  Eek!

Luckily, there's a safe solution.  If we *know* a is dirty - eg. because
a.do or one of its children has definitely changed - then we can just run
a.do immediately and there's no problem, even if b is indeterminate, because
we were going to run a.do anyhow.

If a's dependencies are *not* definitely dirty, and all we have is
indeterminate ones like b, then that means a's build process *hasn't
changed*, which means its tree of dependencies still includes b, which means
we can deduce that if we *did* run a.do, it would end up running b.do.

Since we know that anyhow, we can safely just run b.do, which will either
b.set_checked() or b.set_changed().  Once that's done, we can re-parse a's
dependencies and this time conclusively tell if it needs to be redone or
not.  Even if it does, b is already up-to-date, so the 'redo-ifchange b'
line in a.do will be fast.

...now take all the above and do it recursively to handle nested
dependencies, etc, and you're done.
2010-12-11 05:54:39 -08:00
..
curse Refactor all.do and test.do in various directories. 2010-11-21 05:47:48 -08:00
deps flush-cache: run it as a separate program, not using 'source' 2010-12-10 00:50:52 -08:00
example $3 and stdout no longer refer to the same file. 2010-12-11 00:29:04 -08:00
space dir Add a new test for filenames with spaces. 2010-11-21 06:20:16 -08:00
stamp The second half of redo-stamp: out-of-order building. 2010-12-11 05:54:39 -08:00
.gitignore $3 and stdout no longer refer to the same file. 2010-12-11 00:29:04 -08:00
all.do Remove special case for "dirname" -> "dirname/all" 2010-11-24 02:48:27 -08:00
bellow.do Add minimal/do, a stripped-down redo implementation in 977 bytes of sh. 2010-11-16 00:27:52 -08:00
c.c.c.b.b.a Support for default.*.do rules. 2010-11-16 03:04:11 -08:00
c.do Support for default.*.do rules. 2010-11-16 03:04:11 -08:00
CC.do $3 and stdout no longer refer to the same file. 2010-12-11 00:29:04 -08:00
chdir1.do Correctly handle dependencies for "cd somewhere; redo-ifchange somefile" 2010-11-24 03:06:33 -08:00
chdir2.do Correctly handle dependencies for "cd somewhere; redo-ifchange somefile" 2010-11-24 03:06:33 -08:00
chdir3.do This tests the chdir-related bug from the previous commit. 2010-11-25 06:37:24 -08:00
chdirtest.do flush-cache: run it as a separate program, not using 'source' 2010-12-10 00:50:52 -08:00
clean.do Half-support for using file checksums instead of stamps. 2010-12-11 05:54:37 -08:00
default.args.do minimal/do: handle nonzero exit codes and set $1/$2 correctly. 2010-11-17 19:07:27 -08:00
default.b.do Support for default.*.do rules. 2010-11-16 03:04:11 -08:00
default.c.c.do Support for default.*.do rules. 2010-11-16 03:04:11 -08:00
default.c.do Support for default.*.do rules. 2010-11-16 03:04:11 -08:00
default.do Support for default.*.do rules. 2010-11-16 03:04:11 -08:00
deltest.do If the .do script deletes $3, don't die. 2010-11-17 17:55:16 -08:00
deltest2.do If the .do script deletes $3, don't die. 2010-11-17 17:55:16 -08:00
flush-cache.sh Correctly handle a checksummed file that depends on a non-checksummed file. 2010-12-11 05:54:39 -08:00
hello.c Add README.md and LICENSE. 2010-11-17 00:53:58 -08:00
hello.do Add minimal/do, a stripped-down redo implementation in 977 bytes of sh. 2010-11-16 00:27:52 -08:00
hello.o.do t/*.do: add some time delays. 2010-11-13 02:17:22 -08:00
LD.do $3 and stdout no longer refer to the same file. 2010-12-11 00:29:04 -08:00
makedir.do Remove special case for "dirname" -> "dirname/all" 2010-11-24 02:48:27 -08:00
makedir2.do flush-cache: run it as a separate program, not using 'source' 2010-12-10 00:50:52 -08:00
mode1.do Targets created from stdout should be rw-, not rwx. 2010-11-24 02:26:15 -08:00
modetest.do Targets created from stdout should be rw-, not rwx. 2010-11-24 02:26:15 -08:00
passfail.do Add a new passfailtest. 2010-11-21 06:12:27 -08:00
passfailtest.do t/passfailtest.do: just return exit codes, don't print messages. 2010-12-06 03:12:02 -08:00
silencetest.do $3 and stdout no longer refer to the same file. 2010-12-11 00:29:04 -08:00
sleep t/*.do: add some time delays. 2010-11-13 02:17:22 -08:00
test.do Half-support for using file checksums instead of stamps. 2010-12-11 05:54:37 -08:00
test2.args.do minimal/do: handle nonzero exit codes and set $1/$2 correctly. 2010-11-17 19:07:27 -08:00
touchtest.do $3 and stdout no longer refer to the same file. 2010-12-11 00:29:04 -08:00
yellow.do Add minimal/do, a stripped-down redo implementation in 977 bytes of sh. 2010-11-16 00:27:52 -08:00
yellow.o.do t/*.do: add some time delays. 2010-11-13 02:17:22 -08:00