From 15e8cad1619429bf2547a6819b5b999510d5c1e5 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 4 Jun 2024 22:16:04 +0200 Subject: [PATCH] build: update to latest zig master --- .gitignore | 3 ++- build.zig | 6 +++--- build.zig.version | 2 +- src/build-dest.zig | 4 ++-- src/compile.zig | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index b910c50..cfa57d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.cache/ -/zig-*/ +/zig-out/ +/.zig-cache/ /themes/ diff --git a/build.zig b/build.zig index 58a1c0b..cd6d7be 100644 --- a/build.zig +++ b/build.zig @@ -3,12 +3,12 @@ const std = @import("std"); pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); - const cbor_mod = b.createModule(.{ .root_source_file = .{ .path = "src/cbor.zig" } }); - const theme_mod = b.createModule(.{ .root_source_file = .{ .path = "src/theme.zig" } }); + const cbor_mod = b.createModule(.{ .root_source_file = b.path("src/cbor.zig") }); + const theme_mod = b.createModule(.{ .root_source_file = b.path("src/theme.zig") }); const themes_compile = b.addExecutable(.{ .name = "themes_compile", .target = target, - .root_source_file = .{ .path = "src/compile.zig" }, + .root_source_file = b.path("src/compile.zig"), }); add_themes(b, themes_compile); themes_compile.root_module.addImport("cbor", cbor_mod); diff --git a/build.zig.version b/build.zig.version index f094249..3d2dcc1 100644 --- a/build.zig.version +++ b/build.zig.version @@ -1 +1 @@ -0.12.0-dev.2341+92211135f +0.13.0-dev.363+7fc3fb955 diff --git a/src/build-dest.zig b/src/build-dest.zig index 6a36efa..e991aca 100644 --- a/src/build-dest.zig +++ b/src/build-dest.zig @@ -2,11 +2,11 @@ const std = @import("std"); pub fn build(b: *std.Build) void { const theme_mod = b.addModule("theme", .{ - .root_source_file = .{ .path = "src/theme.zig" }, + .root_source_file = b.path("src/theme.zig"), }); _ = b.addModule("themes", .{ - .root_source_file = .{ .path = "src/themes.zig" }, + .root_source_file = b.path("src/themes.zig"), .imports = &.{ .{ .name = "theme", .module = theme_mod }, }, diff --git a/src/compile.zig b/src/compile.zig index a406e85..733017c 100644 --- a/src/compile.zig +++ b/src/compile.zig @@ -943,7 +943,7 @@ fn fatal(comptime format: []const u8, args: anytype) noreturn { fn hjson(data: []const u8) ![]const u8 { const cmd = [_][]const u8{ "hjson", "-j" }; // Replace with your shell command - var child = std.ChildProcess.init(&cmd, allocator); + var child = std.process.Child.init(&cmd, allocator); child.stdin_behavior = .Pipe; child.stdout_behavior = .Pipe; child.stderr_behavior = .Pipe; @@ -961,7 +961,7 @@ fn hjson(data: []const u8) ![]const u8 { } const term = try child.wait(); switch (term) { - std.ChildProcess.Term.Exited => |code| if (code == 0) return out.toOwnedSlice(), + std.process.Child.Term.Exited => |code| if (code == 0) return out.toOwnedSlice(), else => {}, } std.debug.panic("Exited with code {any}", .{term});