Skip to content

Commit

Permalink
[ci]: fix build for Zig 0.13.0 after addition of the test step
Browse files Browse the repository at this point in the history
  • Loading branch information
Ultra-Code committed Oct 3, 2024
1 parent a912e8d commit 549e6f9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 549e6f9

Please sign in to comment.