fn builderToPackage(s: *Serialize, b: *std.Build) !Configuration.Package.Index 726
727
728
729
730
731
732
733
734
735
736
737
738
739fn builderToPackage(s: *Serialize, b: *std.Build) !Configuration.Package.Index {
if (b.pkg_hash.len == 0) return .root;
const arena = s.arena;
const wc = s.wc;
const gop = try s.package_map.getOrPut(arena, b);
if (!gop.found_existing) {
gop.value_ptr.* = try wc.addExtra(Configuration.Package, .{
.hash = try wc.addString(b.pkg_hash),
.dep_prefix = try wc.addString(b.dep_prefix),
.root_path = try wc.addString(try b.root.toString(arena)),
});
}
return gop.value_ptr.*;
}