# std.Build.Cache.hit: work around macOS kernel bug · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/7ff42eff914e2e501f570bb8c530719bb3a2521a)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 7ff42eff914e2e501f570bb8c530719bb3a2521a

Requested commit: 7ff42eff914e2e501f570bb8c530719bb3a2521a

Commit: 7ff42eff914e2e501f570bb8c530719bb3a2521a

Tree: ec5da1b9e68065a5dd1125751bb04f7292b23989

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
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.

```

## Parents

- [d37ee79535188263bd6a907eb26a48364c4c12f2](https://git.cafe/gitcafe/zig/commit/d37ee79535188263bd6a907eb26a48364c4c12f2?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/7ff42eff914e2e501f570bb8c530719bb3a2521a?format=markdown)
