mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 13:30:45 +00:00
When checking a cache hit, make sure to handle a (re)moved source file
When a file cannot be found in the cache, it is not a hit. Closes #6729
This commit is contained in:
parent
3af9025a1d
commit
4b48fccadd
@ -315,8 +315,9 @@ pub const Manifest = struct {
|
||||
cache_hash_file.path = try self.cache.gpa.dupe(u8, file_path);
|
||||
}
|
||||
|
||||
const this_file = fs.cwd().openFile(cache_hash_file.path.?, .{ .read = true }) catch {
|
||||
return error.CacheUnavailable;
|
||||
const this_file = fs.cwd().openFile(cache_hash_file.path.?, .{ .read = true }) catch |err| switch (err) {
|
||||
error.FileNotFound => return false,
|
||||
else => return error.CacheUnavailable,
|
||||
};
|
||||
defer this_file.close();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user