addDirectoryWatchInput
Any changes inside the directory will trigger invalidation.
See also addDirectoryWatchInputFromPath which takes a Build.Cache.Path instead.
Paths derived from this directory should also be manually added via
addDirectoryWatchInputFromPath if and only if this function returns
true.
Function parameters
Parameters
- step:*Step
- lazy_directory:Build.LazyPath
Type definitions in this namespace
Types
Functions in this namespace
Functions
- make
- If the Step's `make` function reports `error.MakeFailed`, it indicates they
- dump
- For debugging purposes, prints identifying information about this Step.
- evalZigProcess
- Assumes that argv contains `--listen=-` and that the process being spawned
- installFile
- Wrapper around `std.fs.Dir.updateFile` that handles verbose and error output.
- installDir
- Wrapper around `std.fs.Dir.makePathStatus` that handles verbose and error output.
- cacheHit
- Prefer `cacheHitAndWatch` unless you already added watch inputs
- cacheHitAndWatch
- Clears previous watch inputs, if any, and then populates watch inputs from
- writeManifest
- Prefer `writeManifestAndWatch` unless you already added watch inputs
- writeManifestAndWatch
- Clears previous watch inputs, if any, and then populates watch inputs from
- singleUnchangingWatchInput
- For steps that have a single input that never changes when re-running `make`.
- addWatchInput
- Places a *file* dependency on the path.
- addDirectoryWatchInput
- Any changes inside the directory will trigger invalidation.
- addDirectoryWatchInputFromPath
- Any changes inside the directory will trigger invalidation.
- reset
- Implementation detail of file watching and forced rebuilds.
- recursiveReset
- Implementation detail of file watching.
Source
Implementation
pub fn addDirectoryWatchInput(step: *Step, lazy_directory: Build.LazyPath) Allocator.Error!bool {
switch (lazy_directory) {
.src_path => |src_path| try addDirectoryWatchInputFromBuilder(step, src_path.owner, src_path.sub_path),
.dependency => |d| try addDirectoryWatchInputFromBuilder(step, d.dependency.builder, d.sub_path),
.cwd_relative => |path_string| {
try addDirectoryWatchInputFromPath(step, .{
.root_dir = .{
.path = null,
.handle = std.fs.cwd(),
},
.sub_path = path_string,
});
},
// Nothing to watch because this dependency edge is modeled instead via `dependants`.
.generated => return false,
}
return true;
}