Followup from #35428
Migrated from https://github.com/ziglang/zig/issues/20605
Related to https://github.com/ziglang/zig/issues/20602
We already have the concept of poison for when it is impossible to cache the
configuration. This issue is for properly tracking when configuration becomes
outdated.
Sometimes the build script should be re-executed. For instance, if the build
script runs git in order to produce a sha1 commit hash that makes it into
configuration options, then that command needs to be re-run sometimes. In this
use case, a file dependency should be added on .git/HEAD in order to track
this. This file dependency is not attached to any build step but rather attached
to running the configure phase (aka build.zig script).
The cases to look out for:
--watchneeds to re-run configuration under these conditionszig buildCLI needs to account for this in the configuration cache check
Don't forget to implement Cache.addPathPost and
Configuration.Path.toCachePath which are currently @panic("TODO") stubs.
Closure criteria is new std.Build API added for this, standalone test case added,
and use it in zig's own build.zig API for exactly the git use case mentioned above.
Will fix #35460