From 7ff42eff914e2e501f570bb8c530719bb3a2521a Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 10 Dec 2024 20:44:00 -0800 Subject: std.Build.Cache.hit: work around macOS kernel bug The previous commit cast doubt upon the initial report about macOS kernel behavior, identifying another reason that ENOENT could be returned from file creation. However, it is demonstrable that ENOENT can be returned for both cases: 1. create file race 2. handle refers to deleted directory This commit re-introduces the workaround for the file creation race on macOS however it does not unconditionally retry - it first tries again with O_EXCL to disambiguate the error condition that has occurred. --- src/Compilation.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index 12e8a87831..5f4404ff99 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2069,7 +2069,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) !void { error.OutOfMemory => return error.OutOfMemory, error.InvalidFormat => return comp.setMiscFailure( .check_whole_cache, - "failed check cache: invalid manifest file format", + "failed to check cache: invalid manifest file format", .{}, ), }; -- cgit v1.2.3