From a03dd1e0f84d72eb8e6ac71c0f07accea1fbac7a Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sat, 25 May 2024 20:43:38 +0200 Subject: [PATCH] build: prevent breakage with relative paths `thisDir()` returns `@src().file` which isn't always an absolute path --- build.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index eea8dde..2480a98 100644 --- a/build.zig +++ b/build.zig @@ -205,7 +205,7 @@ fn benchTargets( // Open the directory const c_dir_path = (comptime thisDir()) ++ "/src/bench"; - var c_dir = try std.fs.openDirAbsolute(c_dir_path, .{ .iterate = true }); + var c_dir = try std.fs.cwd().openDir(c_dir_path, .{ .iterate = true }); defer c_dir.close(); // Go through and add each as a step @@ -262,7 +262,7 @@ fn exampleTargets( // Open the directory const c_dir_path = (comptime thisDir()) ++ "/examples"; - var c_dir = try std.fs.openDirAbsolute(c_dir_path, .{ .iterate = true }); + var c_dir = try std.fs.cwd().openDir(c_dir_path, .{ .iterate = true }); defer c_dir.close(); // Go through and add each as a step