pub fn dependOnFileContents(b: *Build, lazy_path: LazyPath) void 2600
2601
2602
2603
2604
2605
2606
2607pub fn dependOnFileContents(b: *Build, lazy_path: LazyPath) void {
validateConfigureDependency(lazy_path);
const graph = b.graph;
graph.configure_dependencies.append(graph.arena, .{
.lazy_path = lazy_path.dupe(graph),
.mode = .contents,
}) catch @panic("OOM");
}
Indicates that the build.zig logic depends on a particular file's contents.
If the file is created, deleted, or has its contents changed, the configure phase will be repeated. If the inode or mtime change, but the file contents remain the same, it will not cause the configure logic to be repeated.
This is an alternative to
Graph.poisonCachethat avoids making every invocation ofzig buildinto a cache miss.Only a subset of
LazyPathare supported:If the file would be inside one of the search prefixes, then the dependency cannot be tracked;
Graph.poisonCachemust be used instead.