╭ changed ╮ │README.md│ ╰─────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │47 │ │48 ## How to fire this puppy up and get 'er done │ │49 │ │50 -To build, install zig 0.16.0 and do `zig build` and you'll find the binary at `zig-out/bin/haxy`. On a production server you would run this binary with the `serve` subcommand. To run it in local mode, just run it with no subcommand in any git repo.│ │50 +To build, install zig 0.17.0 and do `zig build` and you'll find the binary at `zig-out/bin/haxy`. On a production server you would run this binary with the `serve` subcommand. To run it in local mode, just run it with no subcommand in any git repo.│ │51 │ │52 The easiest way to try Haxy out is like this: │ │53 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ╮ │build.zig│ ╰─────────╯ ╭────────────────────────────────────────────────────────────────────╮ │17 .root_module = b.createModule(.{ │ │18 .root_source_file = b.path("src/main_wasm.zig"),│ │19 .target = wasm_target, │ │20 - .optimize = .ReleaseSmall, │ │20 + .optimize = .small, │ │21 }), │ │22 }); │ │23 exe.root_module.addImport("xit", xit_dep.module("xit"));│ ╰────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │54 .root_source_file = b.path("src/main.zig"), │ │55 .target = target, │ │56 // default to ReleaseSafe unless an explicit -Doptimize is passed │ │57 - .optimize = if (b.user_input_options.contains("optimize")) optimize else .ReleaseSafe,│ │57 + .optimize = if (b.user_input_options.contains("optimize")) optimize else .safe, │ │58 }), │ │59 .use_llvm = true, │ │60 }); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────╮ │113 │ │114 const run_cmd = b.addRunArtifact(exe); │ │115 run_cmd.step.dependOn(&try_install.step); │ │116 - if (b.args) |args| { │ │117 - run_cmd.addArgs(args); │ │118 - } │ │116 + run_cmd.addPassthruArgs(); │ │117 │ │118 const run_step = b.step("try", "Try the app");│ │119 run_step.dependOn(&run_cmd.step); │ ╰───────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────╮ │126 .root_module = b.createModule(.{ │ │127 .root_source_file = b.path("src/main.zig"),│ │128 .target = target, │ │131 - .optimize = .Debug, │ │129 + .optimize = .debug, │ │130 }), │ │131 .use_llvm = true, │ │132 }); │ ╰────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │159 // the generated module stable when directory iteration order changes. │ │160 fn ansiArtModule(b: *std.Build) *std.Build.Module { │ │161 const io = b.graph.io; │ │164 - var dir = b.build_root.handle.openDir(io, "src/embed/ansi", .{ .iterate = true }) catch |err| {│ │162 + b.dependOnDirectoryContents(b.path("src/embed/ansi")); │ │163 + b.dependOnFileContents(b.path("src/embed/not-found.txt")); │ │164 + var dir = b.root.openDir(io, "src/embed/ansi", .{ .iterate = true }) catch |err| { │ │165 std.debug.panic("unable to open src/embed/ansi: {t}", .{err}); │ │166 }; │ │167 defer dir.close(io); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │170 var iter = dir.iterate(); │ │171 while (iter.next(io) catch |err| std.debug.panic("unable to read src/embed/ansi: {t}", .{err})) |entry| {│ │172 if (entry.kind != .file or !std.mem.endsWith(u8, entry.name, ".txt")) continue; │ │173 - names.append(b.allocator, b.dupe(entry.name)) catch @panic("OOM"); │ │173 + names.append(b.allocator, b.graph.dupeString(entry.name)) catch @panic("OOM"); │ │174 } │ │175 std.mem.sort([]const u8, names.items, {}, struct { │ │176 fn lessThan(_: void, lhs: []const u8, rhs: []const u8) bool { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │181 │ │182 const contents = b.allocator.alloc([]const u8, names.items.len) catch @panic("OOM"); │ │183 for (names.items, contents) |name, *content| { │ │184 + b.dependOnFileContents(b.path(b.fmt("src/embed/ansi/{s}", .{name}))); │ │185 content.* = dir.readFileAlloc(io, name, b.allocator, .limited(16 * 1024 * 1024)) catch |err| {│ │186 std.debug.panic("unable to read src/embed/ansi/{s}: {t}", .{ name, err }); │ │187 }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │188 } │ │189 │ │189 - const not_found = b.build_root.handle.readFileAlloc(io, "src/embed/not-found.txt", b.allocator, .limited(16 * 1024 * 1024)) catch unreachable;│ │190 + var embed_dir = b.root.openDir(io, "src/embed", .{}) catch unreachable; │ │191 + defer embed_dir.close(io); │ │192 + const not_found = embed_dir.readFileAlloc(io, "not-found.txt", b.allocator, .limited(16 * 1024 * 1024)) catch unreachable; │ │193 │ │194 const options = b.addOptions(); │ │195 options.addOption([]const []const u8, "art", contents); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────╮ │build.zig.zon│ ╰─────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 3 .version = "0.0.0", │ │ 4 .dependencies = .{ │ │ 5 .xit = .{ │ │ 6 - .url = "git+https://github.com/xit-vcs/xit#7184fdcfb10fc817a2e9cff01200abfa0d3642e6",│ │ 7 - .hash = "xit-0.0.0-Ub3nDMM-VAHpJIpy2AGPyfJrnAo-jq9vvJJGhDTmGa4E", │ │ 6 + .url = "git+https://github.com/xit-vcs/xit#6710eb2318cb3f1e094a4244865175c1ec07ffc1",│ │ 7 + .hash = "xit-0.0.0-Ub3nDIRMHQDU21NIxnZ5F3eV4V0ymBTro-iVPpR8IfZb", │ │ 8 }, │ │ 9 }, │ │10 .paths = .{ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯