From 4818c2b896b6af1189c2b9e0ca4164e3ad56c8ad Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Thu, 30 Oct 2025 00:29:40 -0400 Subject: [PATCH] cli: make the entire +ssh-cache cache path (#9403) std.fs.makeDirAbsolute() only creates the last directory. We instead need Dir.makePath() to make the entire path, including intermediate directories. This fixes the problem where a missing $XDG_STATE_HOME directory (e.g. ~/.local/state/) would prevent our ssh cache file from being created. Fixes #9393 --- src/cli/ssh-cache/DiskCache.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/ssh-cache/DiskCache.zig b/src/cli/ssh-cache/DiskCache.zig index 8e23b30cf..fe043569f 100644 --- a/src/cli/ssh-cache/DiskCache.zig +++ b/src/cli/ssh-cache/DiskCache.zig @@ -70,7 +70,7 @@ pub fn add( // Create cache directory if needed if (std.fs.path.dirname(self.path)) |dir| { - std.fs.makeDirAbsolute(dir) catch |err| switch (err) { + std.fs.cwd().makePath(dir) catch |err| switch (err) { error.PathAlreadyExists => {}, else => return err, };