From 9df1d1e5ed8d8f98f4794087e5dee5d2a1b0605e Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 14 Aug 2026 18:47:34 -0700 Subject: [PATCH] std.Build.Cache: add some more doomed assertions --- lib/std/Build/Cache.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/std/Build/Cache.zig b/lib/std/Build/Cache.zig index 908f531ec328839bdb3d1c3ea9a9e0ec05c45144..64331f583515b109e2e5cd5fe00b31c43c974e09 100644 --- a/lib/std/Build/Cache.zig +++ b/lib/std/Build/Cache.zig @@ -951,6 +951,7 @@ pub const Manifest = struct { /// will need to be recompiled if the imported file is changed. pub fn addFilePostFetch(self: *Manifest, file_path: []const u8, max_file_size: usize) ![]const u8 { assert(self.manifest_file != null); + assert(!std.fs.path.isAbsolute(file_path)); const gpa = self.cache.gpa; const prefixed_path = try self.cache.findPrefix(file_path); @@ -1008,6 +1009,7 @@ pub const Manifest = struct { /// whether or not `prefixed_path.sub_path` should be kept. pub fn addPrefixedPathPost(man: *Manifest, prefixed_path: PrefixedPath) !bool { assert(man.manifest_file != null); + assert(!std.fs.path.isAbsolute(prefixed_path.sub_path)); const gpa = man.cache.gpa; const gop = try man.files.getOrPutAdapted(gpa, prefixed_path, FilesAdapter{}); @@ -1039,6 +1041,7 @@ pub const Manifest = struct { stat: File.Stat, ) !void { assert(self.manifest_file != null); + assert(!std.fs.path.isAbsolute(file_path)); const gpa = self.cache.gpa; const prefixed_path = try self.cache.findPrefix(file_path); -- 2.54.0