Declares that the current configuration does in fact require a potentially lazy dependency.
If the dependency is already fetched, it is returned. However if the
dependency is not yet fetched, then when the build script is finished
running, the toolchain will not proceed to the make phase. Instead, the
parent process will additionally fetch all the lazy dependencies that were
actually required by running the build script, recompile the build script,
and then run it again. In other words, if this function returns
error.LazyDependencyNeeded it means that the only purpose of completing
the configure phase is to find out all the other lazy dependencies that are
also required. In this case, one must propagate the error all the way up
and return it from the main build function.
For non-lazy dependencies, this always succeeds.
pub fn dependencyLazy(b: *Build, name: []const u8, args: anytype) error
pub fn dependencyLazy(b: *Build, name: []const u8, args: anytype) error{LazyDependencyNeeded}!*Dependency {
const pkg_hash = findPkgHashOrFatal(b, name);
const entry = package_map.get(pkg_hash) orelse unreachable;
if (!entry.available) {
markNeededLazyDep(b, pkg_hash);
return error.LazyDependencyNeeded;
}
return dependencyResolved(b, name, entry, userInputOptionsFromArgs(b.graph.arena, args));
}