Commit 26cb72086a

Jacob Young <jacobly0@users.noreply.github.com>
2024-02-04 03:46:11
Cache: fix logic for retrying cache hits
Fixes potentially #16149
1 parent a65bc8d
Changed files (1)
lib
std
Build
lib/std/Build/Cache.zig
@@ -482,11 +482,11 @@ pub const Manifest = struct {
 
         self.want_refresh_timestamp = true;
 
-        while (true) {
+        const input_file_count = self.files.items.len;
+        while (true) : (self.unhit(bin_digest, input_file_count)) {
             const file_contents = try self.manifest_file.?.reader().readAllAlloc(gpa, manifest_file_size_max);
             defer gpa.free(file_contents);
 
-            const input_file_count = self.files.items.len;
             var any_file_changed = false;
             var line_iter = mem.tokenizeScalar(u8, file_contents, '\n');
             var idx: usize = 0;