In certain situations, I want to know very quickly if a certain target file is up-to-date, i.e. whether or not building it with shake would run any of the rules transitively contributing to the target.
What's the best way to achieve this with shake?
My question is somewhat related to Shake: Signal whether anything had to be rebuilt at all. However, I do not want to run the actual build because I do not want to touch any of my build products.
In Shake what files are "dirty" is a bit difficult to determine. If your file of interest depends on any oracles (even transitively), then the file is considered "dirty", since oracles are always dirty. However, if Shake reruns the dependent rules/oracles and they don't change, then at that point it is considered clean again. As a result, most rules are considered dirty before anything has been run, and only after running some rules does it become clean.
I have raised a ticket to do something better. One option would be given a target rule, to say which leaves depend on it and are dirty - that would list the oracles (which you reasonably expect not to change) and if it lists any source files, you would expect it to rebuild.
(I'd welcome suggestions if anyone has any good ideas.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With