From 93719057c75c06082de780ef51d46644702badc6 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Wed, 3 Jul 2024 08:59:10 +0200 Subject: [PATCH] fix build for zig 0.13.0 --- .gitignore | 1 + build.zig | 2 +- src/builtins.zig | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9bc4cb0..01f46b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ zig-cache/ zig-out/ docs/ +.zig-cache/ diff --git a/build.zig b/build.zig index 147a422..a265025 100644 --- a/build.zig +++ b/build.zig @@ -54,7 +54,7 @@ pub fn build(b: *Build) !void { if (comptime @hasDecl(@TypeOf(cross_tar.*), "setCwd")) { // Zig 0.12.0 - cross_tar.setCwd(.{ .path = "./zig-out/bin/" }); + cross_tar.setCwd(b.path("./zig-out/bin/")); } else { // Zig 0.11 cross_tar.cwd = "./zig-out/bin/"; diff --git a/src/builtins.zig b/src/builtins.zig index a665b0b..0f841c7 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -333,7 +333,7 @@ pub fn writef(dt: *DtMachine) !void { const theCwdPath = try std.process.getCwdAlloc(dt.alloc); var theCwd = try std.fs.openDirAbsolute(theCwdPath, .{}); - try theCwd.writeFile(filename, contents); + try theCwd.writeFile(.{ .data = contents, .sub_path = filename }); theCwd.close(); }