authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-08-14 18:47:34-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-08-19 12:39:36-07:00
log9df1d1e5ed8d8f98f4794087e5dee5d2a1b0605e
tree8751462ad2b3659708bb0a260645b2be2d1cf000
parent65b8b8b27bb4671443403e3d88534c0238b3c940

std.Build.Cache: add some more doomed assertions


1 files changed, 3 insertions(+), 0 deletions(-)

lib/std/Build/Cache.zig+3
...@@ -951,6 +951,7 @@ pub const Manifest = struct {...@@ -951,6 +951,7 @@ pub const Manifest = struct {
951 /// will need to be recompiled if the imported file is changed.951 /// will need to be recompiled if the imported file is changed.
952 pub fn addFilePostFetch(self: *Manifest, file_path: []const u8, max_file_size: usize) ![]const u8 {952 pub fn addFilePostFetch(self: *Manifest, file_path: []const u8, max_file_size: usize) ![]const u8 {
953 assert(self.manifest_file != null);953 assert(self.manifest_file != null);
954 assert(!std.fs.path.isAbsolute(file_path));
954955
955 const gpa = self.cache.gpa;956 const gpa = self.cache.gpa;
956 const prefixed_path = try self.cache.findPrefix(file_path);957 const prefixed_path = try self.cache.findPrefix(file_path);
...@@ -1008,6 +1009,7 @@ pub const Manifest = struct {...@@ -1008,6 +1009,7 @@ pub const Manifest = struct {
1008 /// whether or not `prefixed_path.sub_path` should be kept.1009 /// whether or not `prefixed_path.sub_path` should be kept.
1009 pub fn addPrefixedPathPost(man: *Manifest, prefixed_path: PrefixedPath) !bool {1010 pub fn addPrefixedPathPost(man: *Manifest, prefixed_path: PrefixedPath) !bool {
1010 assert(man.manifest_file != null);1011 assert(man.manifest_file != null);
1012 assert(!std.fs.path.isAbsolute(prefixed_path.sub_path));
1011 const gpa = man.cache.gpa;1013 const gpa = man.cache.gpa;
10121014
1013 const gop = try man.files.getOrPutAdapted(gpa, prefixed_path, FilesAdapter{});1015 const gop = try man.files.getOrPutAdapted(gpa, prefixed_path, FilesAdapter{});
...@@ -1039,6 +1041,7 @@ pub const Manifest = struct {...@@ -1039,6 +1041,7 @@ pub const Manifest = struct {
1039 stat: File.Stat,1041 stat: File.Stat,
1040 ) !void {1042 ) !void {
1041 assert(self.manifest_file != null);1043 assert(self.manifest_file != null);
1044 assert(!std.fs.path.isAbsolute(file_path));
1042 const gpa = self.cache.gpa;1045 const gpa = self.cache.gpa;
10431046
1044 const prefixed_path = try self.cache.findPrefix(file_path);1047 const prefixed_path = try self.cache.findPrefix(file_path);