Background
- We have a list of directories and each contains a software package with sources in
src
. - Packages are independent from one another.
- Assume that packages must be built using virtual targets - for whatever reason the build process can't produce a stable output in
$3
. - Build produces a
dist
directory with multiple outputs next to oursrc
dir inside each package. - In this example there's only one such package called
bar
. It's enough to demonstrate the problem. - Rule
default.list.do
produces a list of sources thenredo-stamp
it. - Rule
default.build.do
depends on the list rule and on each file mentioned in the resulting*.list
file. - The same
default.build.do
rule runs the build, then itredo-ifchange
one arbitrary build output file inside thedist
directory, so that we redo ifdist
directory gets deleted somehow. Very similar to LaTex example from the redo cookbook: https://github.com/apenwarr/redo/blob/main/docs/cookbook/latex/default.runtex.do#L51
Problem: default.build.do
target becomes "dirty" twice when newly introduced inputs change, but it happens only once (which is expected) when the old inputs change.
Steps To Reproduce
- Clone repo.
redo all
- make surebar.list
was created andbar/dist/fake-output
as well.redo all
- no rebuild.touch bar/src/2.txt
.redo all
- rebuild.redo all
again - should NOT rebuild, but rebuilds.redo all
again several times - now it's not being rebuilt.touch bar/src/1.txt
thenredo
several times - rebuilds only once. Fine!touch bar/src/2.txt
thenredo
several times - rebuilds twice. Why?