How to check whether shaking will be performed to restore the target (without trying to build it)?

In some situations, I want to know very quickly if a specific target file is updated, i.e. regardless of whether its creation will shake or run any of the rules that transitively contribute to the goal.

What is the best way to achieve this with shaking?

My question is somewhat related to Shake: the signal is whether anything needs 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.

+5
source share
1 answer

In Shake, files that are dirty are hard to identify. 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 repeats the dependent rules / oracles, and they do not change, then at that moment it is considered clean again. As a result, most rules are considered dirty before everything is started, and only after the start of some rules will it become clean.

I got a ticket to make something better. One of the options will receive the given rule to say which leaves depend on it and are dirty - this will be a list of oracles (which you reasonably expect not to change), and if it contains a list of source files, you can expect it to be rebuilt.

(I would welcome suggestions if anyone has any good ideas.)

+2
source

All Articles