From de59f0a38d02d2f72523319dfa85d63170c336a5 Mon Sep 17 00:00:00 2001 From: Techatrix <19954306+Techatrix@users.noreply.github.com> Date: Fri, 5 Jan 2024 17:28:03 +0100 Subject: [PATCH] handle `std.Build.LazyPath.generated_dirname` in build runner See https://github.com/ziglang/zig/pull/18371 --- src/build_runner/master.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/build_runner/master.zig b/src/build_runner/master.zig index ae9edff1b..77fafea8c 100644 --- a/src/build_runner/master.zig +++ b/src/build_runner/master.zig @@ -390,6 +390,14 @@ const copied_from_zig = struct { return null; } }, + .generated_dirname => |gen| { + var dirname = getPath(.{ .generated = gen.generated }, builder) orelse return null; + var i: usize = 0; + while (i <= gen.up) : (i += 1) { + dirname = std.fs.path.dirname(dirname) orelse return null; + } + return dirname; + }, .dependency => |dep| return dep.dependency.builder.pathJoin(&[_][]const u8{ dep.dependency.builder.build_root.path.?, dep.sub_path,