From a34229d10f96094492d6644015f38ffcc8c98f93 Mon Sep 17 00:00:00 2001 From: Q <264902+kofi-q@users.noreply.github.com> Date: Sat, 11 Jul 2026 14:08:18 -0500 Subject: [PATCH 1/4] [autodocs] Update @typeInfo usage --- src/autodoc/wasm/markdown/Document.zig | 6 +++--- src/autodoc/wasm/markdown/Parser.zig | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/autodoc/wasm/markdown/Document.zig b/src/autodoc/wasm/markdown/Document.zig index a5e5671..0d77cb3 100644 --- a/src/autodoc/wasm/markdown/Document.zig +++ b/src/autodoc/wasm/markdown/Document.zig @@ -188,11 +188,11 @@ pub fn ExtraData(comptime T: type) type { } pub fn extraData(doc: Document, comptime T: type, index: ExtraIndex) ExtraData(T) { - const fields = @typeInfo(T).@"struct".fields; + const info = @typeInfo(T).@"struct"; var i: usize = @intFromEnum(index); var result: T = undefined; - inline for (fields) |field| { - @field(result, field.name) = switch (field.type) { + inline for (info.field_names, info.field_types) |name, typ| { + @field(result, name) = switch (typ) { u32 => doc.extra[i], else => @compileError("bad field type"), }; diff --git a/src/autodoc/wasm/markdown/Parser.zig b/src/autodoc/wasm/markdown/Parser.zig index a0d85ad..3d823d7 100644 --- a/src/autodoc/wasm/markdown/Parser.zig +++ b/src/autodoc/wasm/markdown/Parser.zig @@ -1590,11 +1590,11 @@ fn parseInlines(p: *Parser, content: []const u8) !ExtraIndex { } pub fn extraData(p: Parser, comptime T: type, index: ExtraIndex) ExtraData(T) { - const fields = @typeInfo(T).@"struct".fields; + const info = @typeInfo(T).@"struct"; var i: usize = @intFromEnum(index); var result: T = undefined; - inline for (fields) |field| { - @field(result, field.name) = switch (field.type) { + inline for (info.field_names, info.field_types) |name, typ| { + @field(result, name) = switch (typ) { u32 => p.extra.items[i], else => @compileError("bad field type"), }; From ca0c66854ee236bb9a96d4acda86bc8b0e70e85b Mon Sep 17 00:00:00 2001 From: Q <264902+kofi-q@users.noreply.github.com> Date: Sat, 11 Jul 2026 14:08:31 -0500 Subject: [PATCH 2/4] [BitFlags] Update @typeInfo usage --- src/bit_flags.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bit_flags.zig b/src/bit_flags.zig index 38b47b0..b06adb7 100644 --- a/src/bit_flags.zig +++ b/src/bit_flags.zig @@ -2,7 +2,7 @@ const std = @import("std"); /// Utility mixins for bit flags represented by a packed struct of `bool`s. pub fn BitFlagsImpl(comptime T: type) type { - const type_info = switch (@typeInfo(T)) { + const info = switch (@typeInfo(T)) { .@"struct" => |struct_info| switch (struct_info.layout) { .@"packed" => struct_info, else => @compileError( @@ -18,7 +18,7 @@ pub fn BitFlagsImpl(comptime T: type) type { const Self = T; /// The backing integer for the specified packed struct type. - pub const BackingInt = type_info.backing_integer orelse @compileError( + pub const BackingInt = info.backing_integer orelse @compileError( "Backing integer required", ); @@ -53,11 +53,11 @@ pub fn BitFlagsImpl(comptime T: type) type { try writer.writeAll("{"); var count: BackingInt = 0; - inline for (type_info.fields) |field| { - if (field.type == bool and @field(self, field.name)) { + inline for (info.field_names, info.field_types) |name, typ| { + if (typ == bool and @field(self, name)) { if (count > 0) try writer.writeAll(" |"); try writer.writeAll(" "); - try writer.writeAll(field.name); + try writer.writeAll(name); count += 1; } } From 4e6227989cdf3e935c0c233715225ef67b45ccdf Mon Sep 17 00:00:00 2001 From: Q <264902+kofi-q@users.noreply.github.com> Date: Sat, 11 Jul 2026 14:11:47 -0500 Subject: [PATCH 3/4] [build] Build utils as exe artifacts, instead of steps Looks like custom build steps are no longer supported. Or, they are and I can't figure out how to get them working. Either way, this seems like a less brittle approach. --- build.zig | 26 ++++---- src/_build.zig | 32 ++++----- src/_build/steps.zig | 6 +- src/_build/steps/DirRemove.zig | 73 --------------------- src/_build/steps/FileRemove.zig | 52 --------------- src/_build/steps/PathCopy.zig | 94 --------------------------- src/_build/steps/dir_remove/main.zig | 15 +++++ src/_build/steps/dir_remove/step.zig | 31 +++++++++ src/_build/steps/file_remove/main.zig | 18 +++++ src/_build/steps/file_remove/step.zig | 31 +++++++++ src/_build/steps/paths_copy/main.zig | 79 ++++++++++++++++++++++ src/_build/steps/paths_copy/step.zig | 50 ++++++++++++++ 12 files changed, 256 insertions(+), 251 deletions(-) delete mode 100644 src/_build/steps/DirRemove.zig delete mode 100644 src/_build/steps/FileRemove.zig delete mode 100644 src/_build/steps/PathCopy.zig create mode 100644 src/_build/steps/dir_remove/main.zig create mode 100644 src/_build/steps/dir_remove/step.zig create mode 100644 src/_build/steps/file_remove/main.zig create mode 100644 src/_build/steps/file_remove/step.zig create mode 100644 src/_build/steps/paths_copy/main.zig create mode 100644 src/_build/steps/paths_copy/step.zig diff --git a/build.zig b/build.zig index f9e5163..68a542d 100644 --- a/build.zig +++ b/build.zig @@ -24,25 +24,23 @@ pub fn build(b: *std.Build) void { .optimize = mode, }); + _build.buildUtils(b); + const autodoc_main = _build.autodocMain(b); b.addNamedLazyPath("autodoc/main.wasm", autodoc_main.getEmittedBin()); b.addNamedLazyPath("autodoc/main.js", b.path("src/autodoc/main.js")); b.addNamedLazyPath("autodoc/main.css", b.path("src/autodoc/main.css")); - const docs_install = addDocs( - b, - b.addLibrary(.{ - .name = "base-z", - .root_module = mod_base, - }), - .{ - .dep_base = &dep_base_internal, - .html_logo = "base-z", - .install_dir = .prefix, - .install_subdir = "docs", - .repo_url = "https://github.com/kofi-q/base-z", - }, - ); + const docs_install = addDocs(b, b.addLibrary(.{ + .name = "base-z", + .root_module = mod_base, + }), .{ + .dep_base = &dep_base_internal, + .html_logo = "base-z", + .install_dir = .prefix, + .install_subdir = "docs", + .repo_url = "https://github.com/kofi-q/base-z", + }); step_docs.dependOn(&docs_install.step); const lib_test = b.addTest(.{ .root_module = mod_base }); diff --git a/src/_build.zig b/src/_build.zig index 342f821..03799f9 100644 --- a/src/_build.zig +++ b/src/_build.zig @@ -2,6 +2,8 @@ const std = @import("std"); pub const steps = @import("_build/steps.zig"); +const Step = std.Build.Step; + pub const DocsOpts = struct { dep_base: ?*std.Build.Dependency = null, html_head_extra: []const u8 = "", @@ -13,9 +15,9 @@ pub const DocsOpts = struct { pub fn addDocs( b: *std.Build, - lib: *std.Build.Step.Compile, + lib: *Step.Compile, opts: DocsOpts, -) *std.Build.Step.InstallDir { +) *Step.InstallDir { const dep_base = opts.dep_base orelse b.dependency("base", .{ .target = lib.root_module.resolved_target.?, .optimize = lib.root_module.optimize.?, @@ -63,7 +65,7 @@ pub fn addDocs( return patch_install; } -pub fn autodocMain(b: *std.Build) *std.Build.Step.Compile { +pub fn autodocMain(b: *std.Build) *Step.Compile { const mod = b.createModule(.{ .link_libc = false, .optimize = .ReleaseSmall, @@ -89,20 +91,20 @@ pub fn autodocMain(b: *std.Build) *std.Build.Step.Compile { return exe; } -pub fn addDirRemove(b: *std.Build, path: std.Build.LazyPath) *steps.DirRemove { - return steps.DirRemove.create(b, path); +pub fn addDirRemove(b: *std.Build, cfg: steps.dir_remove.Cfg) *Step { + return steps.dir_remove.create(b, cfg); } -pub fn addFileRemove( - b: *std.Build, - path: std.Build.LazyPath, -) *steps.FileRemove { - return steps.FileRemove.create(b, path); +pub fn addFileRemove(b: *std.Build, cfg: steps.file_remove.Cfg) *Step { + return steps.file_remove.create(b, cfg); } -pub fn addPathsCopy( - b: *std.Build, - write_files: *std.Build.Step.WriteFile, -) *steps.PathCopy { - return steps.PathCopy.create(b, write_files); +pub fn addPathsCopy(b: *std.Build, cfg: steps.PathsCopy.Cfg) steps.PathsCopy { + return steps.PathsCopy.create(b, cfg); +} + +pub fn buildUtils(b: *std.Build) void { + steps.dir_remove.build(b); + steps.file_remove.build(b); + steps.PathsCopy.build(b); } diff --git a/src/_build/steps.zig b/src/_build/steps.zig index 6eafd68..ead6c96 100644 --- a/src/_build/steps.zig +++ b/src/_build/steps.zig @@ -1,3 +1,3 @@ -pub const DirRemove = @import("steps/DirRemove.zig"); -pub const FileRemove = @import("steps/FileRemove.zig"); -pub const PathCopy = @import("steps/PathCopy.zig"); +pub const dir_remove = @import("steps/dir_remove/step.zig"); +pub const file_remove = @import("steps/file_remove/step.zig"); +pub const PathsCopy = @import("steps/paths_copy/step.zig").PathsCopy; diff --git a/src/_build/steps/DirRemove.zig b/src/_build/steps/DirRemove.zig deleted file mode 100644 index a95a49a..0000000 --- a/src/_build/steps/DirRemove.zig +++ /dev/null @@ -1,73 +0,0 @@ -//! The MIT License (Expat) -//! -//! Copyright (c) Zig contributors -//! -//! Permission is hereby granted, free of charge, to any person obtaining a copy -//! of this software and associated documentation files (the "Software"), to deal -//! in the Software without restriction, including without limitation the rights -//! to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -//! copies of the Software, and to permit persons to whom the Software is -//! furnished to do so, subject to the following conditions: -//! -//! The above copyright notice and this permission notice shall be included in -//! all copies or substantial portions of the Software. -//! -//! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -//! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -//! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -//! AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -//! LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -//! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -//! THE SOFTWARE. -//! -//! Modified for compatibility with Zig 0.16.0 Io API changes. - -const std = @import("std"); -const fs = std.fs; -const Step = std.Build.Step; -const LazyPath = std.Build.LazyPath; - -pub const base_id: Step.Id = .remove_dir; - -const DirRemove = @This(); -step: Step, -doomed_path: LazyPath, - -pub fn create(b: *std.Build, doomed_path: LazyPath) *DirRemove { - const remove_dir = b.allocator.create(DirRemove) catch @panic("OOM"); - remove_dir.* = .{ - .step = Step.init(.{ - .id = base_id, - .name = b.fmt("RemoveDir {s}", .{doomed_path.getDisplayName()}), - .owner = b, - .makeFn = make, - }), - .doomed_path = doomed_path.dupe(b), - }; - return remove_dir; -} - -fn make(step: *Step, options: Step.MakeOptions) !void { - _ = options; - - const b = step.owner; - const remove_dir: *DirRemove = @fieldParentPtr("step", step); - - step.clearWatchInputs(); - try step.addWatchInput(remove_dir.doomed_path); - - const io = b.graph.io; - const full_doomed_path = remove_dir.doomed_path.getPath2(b, step); - - b.build_root.handle.deleteTree(io, full_doomed_path) catch |err| { - if (b.build_root.path) |base| { - return step.fail("unable to recursively delete path '{s}/{s}': {s}", .{ - base, full_doomed_path, @errorName(err), - }); - } else { - return step.fail("unable to recursively delete path '{s}': {s}", .{ - full_doomed_path, @errorName(err), - }); - } - }; -} diff --git a/src/_build/steps/FileRemove.zig b/src/_build/steps/FileRemove.zig deleted file mode 100644 index cf5ec80..0000000 --- a/src/_build/steps/FileRemove.zig +++ /dev/null @@ -1,52 +0,0 @@ -//! Build step for deleting a single file. -//! -//! Adapted from `std.Build.Step.RemoveDir`: -//! The MIT License (Expat) - Copyright (c) Zig contributors - -const std = @import("std"); - -const FileRemove = @This(); - -path: std.Build.LazyPath, -step: std.Build.Step, - -pub fn create(b: *std.Build, path: std.Build.LazyPath) *FileRemove { - const remove_file = b.allocator.create(FileRemove) catch @panic("OOM"); - remove_file.* = .{ - .step = .init(.{ - .id = std.Build.Step.Id.custom, - .name = b.fmt("FileRemove {s}", .{path.getDisplayName()}), - .owner = b, - .makeFn = make, - }), - .path = path.dupe(b), - }; - return remove_file; -} - -fn make(step: *std.Build.Step, options: std.Build.Step.MakeOptions) !void { - _ = options; - - const b = step.owner; - const remove_file: *FileRemove = @fieldParentPtr("step", step); - - step.clearWatchInputs(); - try step.addWatchInput(remove_file.path); - - const full_path = b.fmt("{f}", .{remove_file.path.getPath3(b, step)}); - - const io = b.graph.io; - b.build_root.handle.deleteFile(io, full_path) catch |err| switch (err) { - error.FileNotFound => return, - else => { - if (b.build_root.path) |base| return step.fail( - "unable to delete file '{s}/{s}': {t}", - .{ base, full_path, err }, - ); - - return step.fail("unable to delete file '{s}': {t}", .{ - full_path, err, - }); - }, - }; -} diff --git a/src/_build/steps/PathCopy.zig b/src/_build/steps/PathCopy.zig deleted file mode 100644 index 8acb73e..0000000 --- a/src/_build/steps/PathCopy.zig +++ /dev/null @@ -1,94 +0,0 @@ -//! Lazily adds file/directory copies to an existing `std.Build.Step.WriteFile` -//! step, based on file/directory paths or that may or may not be generated -//! during the build. - -const std = @import("std"); -const ArrayList = std.ArrayList; - -const PathCopy = @This(); - -generated_directory: std.Build.GeneratedFile, -paths: ArrayList(Path) = .empty, -step: std.Build.Step, -write_files: *std.Build.Step.WriteFile, - -pub const Path = struct { - source: std.Build.LazyPath, - sub_path: []const u8, -}; - -pub fn create( - owner: *std.Build, - write_files: *std.Build.Step.WriteFile, -) *PathCopy { - const path_copy = owner.allocator.create(PathCopy) catch @panic("OOM"); - path_copy.* = .{ - .generated_directory = .{ .step = &path_copy.step }, - .step = std.Build.Step.init(.{ - .id = .custom, - .makeFn = make, - .name = "PathCopy", - .owner = owner, - }), - .write_files = write_files, - }; - write_files.step.dependOn(&path_copy.step); - - return path_copy; -} - -pub fn addPath( - self: *PathCopy, - source: std.Build.LazyPath, - sub_path: []const u8, -) void { - const b = self.step.owner; - self.paths.append(b.allocator, .{ - .source = source, - .sub_path = b.dupe(sub_path), - }) catch @panic("OOM"); - - source.addStepDependencies(&self.step); - - self.maybeUpdateName(); -} - -fn maybeUpdateName(self: *PathCopy) void { - if (self.paths.items.len != 1) return; - - self.step.name = self.step.owner.fmt( - "PathCopy {s}", - .{self.paths.items[0].sub_path}, - ); -} - -fn make(step: *std.Build.Step, options: std.Build.Step.MakeOptions) !void { - _ = options; - const b = step.owner; - const self: *PathCopy = @fieldParentPtr("step", step); - step.clearWatchInputs(); - - const io = b.graph.io; - var cwd = try std.Io.Dir.cwd().openDir(io, ".", .{ .iterate = true }); - defer cwd.close(io); - - for (self.paths.items) |path| { - try step.addWatchInput(path.source); - - const stat = try cwd.statFile( - io, - try path.source.getPath3(b, step).toString(b.allocator), - .{}, - ); - - _ = switch (stat.kind) { - .directory => self.write_files.addCopyDirectory( - path.source, - path.sub_path, - .{}, - ), - .file => self.write_files.addCopyFile(path.source, path.sub_path), - else => {}, - }; - } -} diff --git a/src/_build/steps/dir_remove/main.zig b/src/_build/steps/dir_remove/main.zig new file mode 100644 index 0000000..861a821 --- /dev/null +++ b/src/_build/steps/dir_remove/main.zig @@ -0,0 +1,15 @@ +const std = @import("std"); + +pub fn main(init: std.process.Init) !void { + const io = init.io; + + var args = init.minimal.args.iterate(); + _ = args.skip(); + const path = args.next() orelse return error.MissingDirPath; + + const cwd: std.Io.Dir = .cwd(); + cwd.deleteTree(io, path) catch |err| { + std.log.err("recursively deleting dir {s}: {t}", .{ path, err }); + return err; + }; +} diff --git a/src/_build/steps/dir_remove/step.zig b/src/_build/steps/dir_remove/step.zig new file mode 100644 index 0000000..d8a3eb1 --- /dev/null +++ b/src/_build/steps/dir_remove/step.zig @@ -0,0 +1,31 @@ +const std = @import("std"); + +const LazyPath = std.Build.LazyPath; +const Step = std.Build.Step; + +pub const exe_name = "dir_remove"; + +pub const Cfg = struct { + dep_base: ?*std.Build.Dependency = null, + path: LazyPath, +}; + +pub fn create(b: *std.Build, cfg: Cfg) *Step { + const dep = cfg.dep_base orelse b.dependency("base", .{}); + const run = b.addRunArtifact(dep.artifact(exe_name)); + run.addDirectoryArg2(cfg.path, .{}); + + return &run.step; +} + +pub fn build(b: *std.Build) void { + b.installArtifact(b.addExecutable(.{ + .name = exe_name, + .root_module = b.createModule(.{ + .root_source_file = b.path( + "src/_build/steps/dir_remove/main.zig", + ), + .target = b.resolveTargetQuery(.{}), + }), + })); +} diff --git a/src/_build/steps/file_remove/main.zig b/src/_build/steps/file_remove/main.zig new file mode 100644 index 0000000..3898903 --- /dev/null +++ b/src/_build/steps/file_remove/main.zig @@ -0,0 +1,18 @@ +const std = @import("std"); + +pub fn main(init: std.process.Init) !void { + const io = init.io; + + var args = init.minimal.args.iterate(); + _ = args.skip(); + const path = args.next() orelse return error.MissingDirPath; + + const cwd: std.Io.Dir = .cwd(); + cwd.deleteFile(io, path) catch |err| switch (err) { + error.FileNotFound => {}, + else => { + std.log.err("deleting file {s}: {t}", .{ path, err }); + return err; + }, + }; +} diff --git a/src/_build/steps/file_remove/step.zig b/src/_build/steps/file_remove/step.zig new file mode 100644 index 0000000..a4294c4 --- /dev/null +++ b/src/_build/steps/file_remove/step.zig @@ -0,0 +1,31 @@ +const std = @import("std"); + +const LazyPath = std.Build.LazyPath; +const Step = std.Build.Step; + +pub const exe_name = "file_remove"; + +pub const Cfg = struct { + dep_base: ?*std.Build.Dependency = null, + path: LazyPath, +}; + +pub fn create(b: *std.Build, cfg: Cfg) *Step { + const dep = cfg.dep_base orelse b.dependency("base", .{}); + const run = b.addRunArtifact(dep.artifact(exe_name)); + run.addDirectoryArg(cfg.path); + + return &run.step; +} + +pub fn build(b: *std.Build) void { + b.installArtifact(b.addExecutable(.{ + .name = exe_name, + .root_module = b.createModule(.{ + .root_source_file = b.path( + "src/_build/steps/file_remove/main.zig", + ), + .target = b.resolveTargetQuery(.{}), + }), + })); +} diff --git a/src/_build/steps/paths_copy/main.zig b/src/_build/steps/paths_copy/main.zig new file mode 100644 index 0000000..33856fb --- /dev/null +++ b/src/_build/steps/paths_copy/main.zig @@ -0,0 +1,79 @@ +const std = @import("std"); + +const Allo = std.mem.Allocator; + +pub fn main(init: std.process.Init) !void { + const allo = init.gpa; + const io = init.io; + + var args = init.minimal.args.iterate(); + _ = args.skip(); + + const in = args.next() orelse return error.MissingInputPath; + const out_root = args.next() orelse return error.MissingOutputDir; + const out_path = args.next() orelse return error.MissingOutputPath; + + const cwd: std.Io.Dir = .cwd(); + const out_dir = try cwd.openDir(io, out_root, .{}); + + const stat = try cwd.statFile(io, in, .{}); + + if (stat.kind == .file) cwd.copyFile(in, out_dir, out_path, io, .{ + .make_path = true, + }) catch |err| { + std.log.err("copying file {s} to output dir: {t}", .{ in, err }); + return err; + }; + + switch (stat.kind) { + .directory => { + const in_dir = try cwd.openDir(io, in, .{ .iterate = true }); + defer in_dir.close(io); + + try copyTree(allo, in_dir, out_path, out_dir); + }, + + .file => cwd.copyFile(in, out_dir, out_path, io, .{ + .make_path = true, + }) catch |err| { + std.log.err("copying file {s} to output dir: {t}", .{ in, err }); + return err; + }, + } +} + +fn copyTree( + allo: Allo, + io: std.Io, + src_path: []const u8, + src: std.Io.Dir, + dst_path: []const u8, + dst: std.Io.Dir, +) !void { + var it = try src.walk(allo); + defer it.deinit(); + + while (it.next(io) catch |err| switch (err) { + error.Canceled, + error.OutOfMemory, + => |e| return e, + + else => |e| return std.log.err( + "recursively copying dir {s}: {t}", + .{ src_path, e }, + ), + }) |entry| switch (entry.kind) { + .file => { + src.copyFile(entry.path, dst, entry.path, io, .{ + .make_path = true, + }) catch |err| { + std.log.err( + "copying file {s} from {s} to {s} in output dir: {t}", + .{ entry.path, src_path, dst_path, err }, + ); + return err; + }; + }, + else => continue, + }; +} diff --git a/src/_build/steps/paths_copy/step.zig b/src/_build/steps/paths_copy/step.zig new file mode 100644 index 0000000..26cfa7a --- /dev/null +++ b/src/_build/steps/paths_copy/step.zig @@ -0,0 +1,50 @@ +const std = @import("std"); + +const LazyPath = std.Build.LazyPath; +const Step = std.Build.Step; + +pub const exe_name = "paths_copy"; + +pub const PathsCopy = struct { + b: *std.Build, + exe: *std.Build.Step.Compile, + wf: *std.Build.Step.WriteFile, + + pub const Cfg = struct { + dep_base: ?*std.Build.Dependency = null, + wf: *std.Build.Step.WriteFile, + }; + + pub fn create(b: *std.Build, cfg: Cfg) PathsCopy { + const dep = cfg.dep_base orelse b.dependency("base", .{}); + + return .{ + .b = b, + .exe = dep.artifact(exe_name), + .wf = cfg.wf, + }; + } + + pub fn add(pc: PathsCopy, path: LazyPath, sub_path: []const u8) *Step { + const run = pc.b.addRunArtifact(pc.exe); + run.addFileArg2(path, .{}); + run.addDirectoryArg2(pc.wf.getDirectory(), .{}); + run.addArg(sub_path); + + run.step.dependOn(&pc.wf.step); + + return &run.step; + } + + pub fn build(b: *std.Build) void { + b.installArtifact(b.addExecutable(.{ + .name = exe_name, + .root_module = b.createModule(.{ + .root_source_file = b.path( + "src/_build/steps/path_copy/main.zig", + ), + .target = b.resolveTargetQuery(.{}), + }), + })); + } +}; From 426a1ccb0e1b4b2fe7dfb7590ac991a25983e85c Mon Sep 17 00:00:00 2001 From: Q <264902+kofi-q@users.noreply.github.com> Date: Sat, 11 Jul 2026 14:12:25 -0500 Subject: [PATCH 4/4] Update Zig min versions --- .github/workflows/ci.yml | 4 ++-- .zigversion | 2 +- build.zig.zon | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 856e26e..1ce9231 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: mlugg/setup-zig@v2 with: - version: 0.17.0-dev.633+9c5655093 + version: 0.17.0-dev.1282+c0f9b51d8 - name: Checkout uses: actions/checkout@v4 @@ -39,7 +39,7 @@ jobs: steps: - uses: mlugg/setup-zig@v2 with: - version: 0.17.0-dev.633+9c5655093 + version: 0.17.0-dev.1282+c0f9b51d8 - name: Checkout uses: actions/checkout@v4 diff --git a/.zigversion b/.zigversion index 53153fd..cc924c8 100644 --- a/.zigversion +++ b/.zigversion @@ -1 +1 @@ -0.17.0-dev.633+9c5655093 +0.17.0-dev.1282+c0f9b51d8 diff --git a/build.zig.zon b/build.zig.zon index 82b4098..7f4e598 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -2,7 +2,7 @@ .name = .base, .fingerprint = 0xc0b4fe61a6f811ae, .version = "0.1.0", - .minimum_zig_version = "0.17.0-dev.633+9c5655093", + .minimum_zig_version = "0.17.0-dev.1282+c0f9b51d8", .dependencies = .{}, .paths = .{ "build.zig",