pub fn check_package(
package_dir: &Path,
overlay: &Overlay,
) -> Result<PackageCheck, CompilationError>Expand description
Check the package rooted at package_dir and every package it depends on, as
zelkova::compile_package does, and hand back what was found without printing
or writing anything.
This is the checking half of every compile_package variant: they call it, then print
its status lines, emit and write a build that checked, and
render every error. It reads every manifest from disk and every .zel source of the build
from overlay where it holds the file and from disk otherwise (Overlay has the
rules, and the CLI half passes an empty one), and nothing else: it does not look for a
facade’s companion, which only a build that emits needs. It never writes to stderr, to stdout or to disk, and never builds a
Diagnostic — a caller that wants one asks each error for it.
Err is an error raised before there is a build to check — the root’s manifest, or
the resolution of its dependencies — and comes with no file database, since no source
was read. Every later error is in PackageCheck::errors, and an Ok whose errors
is not empty is a package that did not check.
The root’s tests/ is not checked; check_package_with_tests is that check.