Skip to content

Commit 51a7ffe

Browse files
committed
std.Build.Cache: handle ENOENT on createFile race
Companion commit to 628fec4
1 parent 47cc1c5 commit 51a7ffe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/std/Build/Cache.zig

+5-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,11 @@ pub const Manifest = struct {
422422
self.have_exclusive_lock = true;
423423
return false; // cache miss; exclusive lock already held
424424
} else |err| switch (err) {
425-
error.WouldBlock => continue,
425+
// There are no dir components, so you would think
426+
// that this was unreachable, however we have
427+
// observed on macOS two processes racing to do
428+
// openat() with O_CREAT manifest in ENOENT.
429+
error.WouldBlock, error.FileNotFound => continue,
426430
else => |e| return e,
427431
}
428432
},

0 commit comments

Comments
 (0)