authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-08-11 19:44:02-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-09-24 20:01:19-07:00
logea169e6ccfa0792629bebaa64e9d41fb5dd2a594
tree8f418cf33603e69552e745ee42c0475677b7a61c
parentb6930097ec5f0e79346d3a1725be56a2d1dcc568

std.Build.Cache: clarify parameter is sub path, not basename


1 files changed, 7 insertions(+), 7 deletions(-)

lib/std/Build/Cache.zig+7-7
...@@ -459,9 +459,9 @@ pub const Manifest = struct {...@@ -459,9 +459,9 @@ pub const Manifest = struct {
459 }459 }
460 }460 }
461461
462 pub fn addDepFile(self: *Manifest, dir: fs.Dir, dep_file_basename: []const u8) !void {462 pub fn addDepFile(self: *Manifest, dir: fs.Dir, dep_file_sub_path: []const u8) !void {
463 assert(self.manifest_file == null);463 assert(self.manifest_file == null);
464 return self.addDepFileMaybePost(dir, dep_file_basename);464 return self.addDepFileMaybePost(dir, dep_file_sub_path);
465 }465 }
466466
467 pub const HitError = error{467 pub const HitError = error{
...@@ -1049,14 +1049,14 @@ pub const Manifest = struct {...@@ -1049,14 +1049,14 @@ pub const Manifest = struct {
1049 self.hash.hasher.update(&new_file.bin_digest);1049 self.hash.hasher.update(&new_file.bin_digest);
1050 }1050 }
10511051
1052 pub fn addDepFilePost(self: *Manifest, dir: fs.Dir, dep_file_basename: []const u8) !void {1052 pub fn addDepFilePost(self: *Manifest, dir: fs.Dir, dep_file_sub_path: []const u8) !void {
1053 assert(self.manifest_file != null);1053 assert(self.manifest_file != null);
1054 return self.addDepFileMaybePost(dir, dep_file_basename);1054 return self.addDepFileMaybePost(dir, dep_file_sub_path);
1055 }1055 }
10561056
1057 fn addDepFileMaybePost(self: *Manifest, dir: fs.Dir, dep_file_basename: []const u8) !void {1057 fn addDepFileMaybePost(self: *Manifest, dir: fs.Dir, dep_file_sub_path: []const u8) !void {
1058 const gpa = self.cache.gpa;1058 const gpa = self.cache.gpa;
1059 const dep_file_contents = try dir.readFileAlloc(dep_file_basename, gpa, .limited(manifest_file_size_max));1059 const dep_file_contents = try dir.readFileAlloc(dep_file_sub_path, gpa, .limited(manifest_file_size_max));
1060 defer gpa.free(dep_file_contents);1060 defer gpa.free(dep_file_contents);
10611061
1062 var error_buf: std.ArrayListUnmanaged(u8) = .empty;1062 var error_buf: std.ArrayListUnmanaged(u8) = .empty;
...@@ -1083,7 +1083,7 @@ pub const Manifest = struct {...@@ -1083,7 +1083,7 @@ pub const Manifest = struct {
1083 },1083 },
1084 else => |err| {1084 else => |err| {
1085 try err.printError(gpa, &error_buf);1085 try err.printError(gpa, &error_buf);
1086 log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items });1086 log.err("failed parsing {s}: {s}", .{ dep_file_sub_path, error_buf.items });
1087 return error.InvalidDepFile;1087 return error.InvalidDepFile;
1088 },1088 },
1089 }1089 }