Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

loadManifest

This function populates f.manifest or leaves it null.

Fetch.loadManifest
fn loadManifest(f: *Fetch, pkg_root: Path) RunError!void

File

lib/compiler/Maker/Fetch.zig:875

Code

fn loadManifest(f: *Fetch, pkg_root: Path) RunError!void {
    const io = f.job_queue.io;
    const eb = &f.error_bundle;
    const arena = f.arena.allocator();
    const manifest_path = try pkg_root.join(arena, Manifest.basename);

    Manifest.load(
        io,
        arena,
        manifest_path,
        &f.manifest_ast,
        eb,
        &f.manifest,
        f.allow_missing_paths_field,
    ) catch |err| switch (err) {
        error.FileNotFound => return,
        error.Canceled => |e| return e,
        error.ErrorsBundled => return error.FetchFailed,
        else => |e| {
            try eb.addRootErrorMessage(.{
                .msg = try eb.printString("unable to load package manifest '{f}': {t}", .{ manifest_path, e }),
            });
            return error.FetchFailed;
        },
    };
    f.have_manifest = true;
}