What we actually want to solve:
We have a code generator that is expensive to run, but running it is the only way to find out what it will generate.
If one of the outputs would be deleted, we have to re-run the generator; this is how we came to dyndeps and the "untar" example, which addresses this issue.
In the "untar" example, you have two rules; the inexpensive "scantar" that predicts what will be generated, and the expensive "untar" rule actually doing it.
We have no other prediction than running the generator, so:
- scantar could do the same as untar, and will both be expensive. Now the generator is run twice on the first ninja run.
- having "scantar" rule write a dummy .dd file; the actual content is updated when executing the "untar" rule.
But this update makes the rule dirty for the second run, since new inplicit outputs have come up.
Any idea how to have the generator only run once?