std.Build: start using the cache system with RunStep
* Use std.Build.Cache.Directory instead of a string for storing the cache roots and build roots. * Set up a std.Build.Cache in build_runner.zig and use it in std.Build.RunStep for avoiding redundant work.
This commit is contained in:
@@ -85,8 +85,8 @@ fn make(step: *Step) !void {
|
||||
.{std.fmt.fmtSliceHexLower(&digest)},
|
||||
) catch unreachable;
|
||||
|
||||
const output_dir = try fs.path.join(self.builder.allocator, &[_][]const u8{
|
||||
self.builder.cache_root, "o", &hash_basename,
|
||||
const output_dir = try self.builder.cache_root.join(self.builder.allocator, &.{
|
||||
"o", &hash_basename,
|
||||
});
|
||||
var dir = fs.cwd().makeOpenPath(output_dir, .{}) catch |err| {
|
||||
std.debug.print("unable to make path {s}: {s}\n", .{ output_dir, @errorName(err) });
|
||||
|
||||
Reference in New Issue
Block a user