From 549e6f9e9349c38eed4b88aeb91b8260ccea1e4a Mon Sep 17 00:00:00 2001 From: Ultra-Code Date: Thu, 3 Oct 2024 13:55:13 +0000 Subject: [PATCH] [ci]: fix build for Zig 0.13.0 after addition of the test step --- build.zig | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index 5cb7ebf..47731c8 100644 --- a/build.zig +++ b/build.zig @@ -165,8 +165,19 @@ pub fn build(b: *std.Build) void { }) !void { _ = options; const test_run = Step.cast(step, Step.Run).?; - const bin_path = test_run.cwd.?.getPath3(step.owner, step); - bin_path.makePath("testdb/") catch unreachable; + const subpath = "testdb/"; + if (@hasDecl(Build.LazyPath, "getPath3")) { + const bin_path = test_run.cwd.?.getPath3(step.owner, step); + bin_path.makePath(subpath) catch unreachable; + } else { + const bin_path = test_run.cwd.?.getPath2(step.owner, step); + const owner = test_run.step.owner; + const full_path = owner.fmt("{s}/{s}", .{ bin_path, subpath }); + owner.cache_root.handle.makeDir(full_path) catch |err| switch (err) { + error.PathAlreadyExists => {}, + else => unreachable, + }; + } } fn create_testdb(owner: *Build, test_dirname: Build.LazyPath) *Step {