fuzz: don't err if .zig-cache/tmp doesn't exist

If we have just created cache_dir_path, then there's no `tmp` dir
there, and

    cache_dir.createFile(io, "tmp/libfuzzer.log", .{ .truncate = false })

fails.

Tested via

    $ zig version
    0.16.0
    $ zig build --zig-lib-dir ~/p/zig/lib/ --fuzz
This commit is contained in:
Alex Kladov
2026-04-18 16:44:55 +01:00
committed by Ryan Liptak
parent d840583458
commit 76174e1bce
+2
View File
@@ -171,6 +171,8 @@ const Executable = struct {
const cache_dir = Io.Dir.cwd().createDirPathOpen(io, cache_dir_path, .{}) catch |e|
panic("failed to open directory '{s}': {t}", .{ cache_dir_path, e });
cache_dir.createDirPath(io, "tmp") catch |e|
panic("failed to create directory 'tmp': {t}", .{e});
log_f = cache_dir.createFile(io, "tmp/libfuzzer.log", .{ .truncate = false }) catch |e|
panic("failed to create file 'tmp/libfuzzer.log': {t}", .{e});
self.cache_f = cache_dir.createDirPathOpen(io, "f", .{}) catch |e|