Build system implementation detail.
pub fn create(
graph: *Graph,
root: Cache.Path,
available_deps: AvailableDeps,
) error
pub fn create(
graph: *Graph,
root: Cache.Path,
available_deps: AvailableDeps,
) error{OutOfMemory}!*Build {
const arena = graph.arena;
const b = try arena.create(Build);
b.* = .{
.graph = graph,
.root = root,
.invalid_user_input = false,
.allocator = arena,
.user_input_options = UserInputOptionsMap.init(arena),
.top_level_steps = .{},
.default_step = undefined,
.install_tls = .{
.step = .init(.{
.tag = .top_level,
.name = "install",
.owner = b,
}),
.description = "Copy build artifacts to prefix path",
},
.uninstall_tls = .{
.step = .init(.{
.tag = .top_level,
.name = "uninstall",
.owner = b,
}),
.description = "Remove build artifacts from prefix path",
},
.modules = .empty,
.named_writefiles = .empty,
.named_lazy_paths = .empty,
.pkg_hash = "",
.available_deps = available_deps,
};
try b.top_level_steps.put(arena, b.install_tls.step.name, &b.install_tls);
try b.top_level_steps.put(arena, b.uninstall_tls.step.name, &b.uninstall_tls);
b.default_step = &b.install_tls.step;
return b;
}