zig/lib/std/Build
Andrew Kelley d37ee79535 std.Build.Cache.hit: more discipline in error handling
Previous commits

2b0929929d
4ea2f441df

had this text:

> There are no dir components, so you would think that this was
> unreachable, however we have observed on macOS two processes racing to
> do openat() with O_CREAT manifest in ENOENT.

This appears to have been a misunderstanding based on the issue
report #12138 and corresponding PR #12139 in which the steps to
reproduce removed the cache directory in a loop which also executed
detached Zig compiler processes.

There is no evidence for the macOS kernel bug however the ENOENT is
easily explained by the removal of the cache directory.

This commit reverts those commits, ultimately reporting the ENOENT as an
error rather than repeating the create file operation. However this
commit also adds an explicit error set to `std.Build.Cache.hit` as well
as changing the `failed_file_index` to a proper diagnostic field that
fully communicates what failed, leading to more informative error
messages on failure to check the cache.

The equivalent failure when occuring for AstGen performs a fatal process
kill, reasoning being that the compiler has an invariant of the cache
directory not being yanked out from underneath it while executing. This
could be made a more granular error in the future but I suspect such
thing is not valuable to pursue.

Related to #18340 but does not solve it.
2024-12-10 18:11:12 -08:00
..
Cache std.Build.Cache.Path: fix single-quote escaping format 2024-10-10 14:21:52 -07:00
Fuzz Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
Step std.Build: Detect pkg-config names with "lib" prefix 2024-11-29 15:11:14 -05:00
Cache.zig std.Build.Cache.hit: more discipline in error handling 2024-12-10 18:11:12 -08:00
Fuzz.zig Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
Module.zig std.Target: Move isLib{C,Cxx}LibName() to std.zig.target. 2024-10-16 22:25:13 +02:00
Step.zig std.Build.Cache.hit: more discipline in error handling 2024-12-10 18:11:12 -08:00
Watch.zig std.Build.Watch: implement removing watches for kqueue 2024-10-24 23:31:56 -07:00