From 2eb8860b2ca05c426f3962661441aaee13d3be44 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 29 Oct 2026 19:09:26 -0300 Subject: web: the browser shell builds again and loads a dump of a native build: a theme by its name, a field compiled out passed over, no disk asked; touch.dump replaces the hand-written ZON fixture Fixed for wasm32-freestanding: counts as usize, no threads, stb_image, tape or host stat there. touch.mjs follows the renderer's 13 tag-layer fields, helix's retuned colours and the tag column. Co-Authored-By: Claude Opus 5.5 --- build.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 962b6322..097fb1bf 100644 --- a/build.zig +++ b/build.zig @@ -108,7 +108,7 @@ pub fn build(b: *std.Build) void { const target = if (platform == .esp32p4) b.resolveTargetQuery(esp32p4_target) else requested_target; const requested_optimize = b.standardOptimizeOption(.{}); const static = b.option(bool, "static", "statically link") orelse false; - const dump_path = b.option([]const u8, "dump", "dump .zon embedded into the web shell (-Dplatform=web)"); + const dump_path = b.option([]const u8, "dump", "a Dump (a .dump file) embedded into the web shell (-Dplatform=web)"); // one substring, because that is what a dev loop needs: see the unit-test // step for why the whole-binary run is worth narrowing const test_filters: []const []const u8 = if (b.option([]const u8, "test-filter", "run only tests whose name contains this")) |f| @@ -196,7 +196,7 @@ pub fn build(b: *std.Build) void { // The browser shell is a freestanding wasm core plus ordinary web files. // JavaScript owns the loop and IO; HTML/CSS own rendering. - const web_step = b.step("web", "build the DOM browser shell into zig-out/web (-Dplatform=web -Dtarget=wasm32-freestanding -Ddump=)"); + const web_step = b.step("web", "build the DOM browser shell into zig-out/web (-Dplatform=web -Dtarget=wasm32-freestanding -Ddump=)"); const mupdf_check = b.step("mupdf-check", "compile, link, render, and search docs/design.pdf with MuPDF"); const pdf_bench_step = b.step("pdf-bench", "benchmark real MuPDF page rendering (-- [--json] [--reps N] [--warmup N] [--path FILE] [--page N] [--pages N])"); const pdf_sections_bench_step = b.step("pdf-sections-bench", "benchmark PDF outline/sections paths in ReleaseFast (-Doptimize=ReleaseFast -- [--json] [--reps N] [--warmup N])"); @@ -224,7 +224,7 @@ pub fn build(b: *std.Build) void { if (is_web and !is_web_target) return failBuild(b, web_step, "-Dplatform=web requires -Dtarget=wasm32-freestanding"); if (!is_web and (is_web_target or target.result.os.tag == .emscripten)) return failBuild(b, web_step, "wasm browser targets require -Dplatform=web"); - if (platform == .web and dump_path == null) return failBuild(b, web_step, "-Dplatform=web requires -Ddump= (the browser has no ptys; state replays from an embedded dump)"); + if (platform == .web and dump_path == null) return failBuild(b, web_step, "-Dplatform=web requires -Ddump= (the browser has no ptys; state replays from an embedded dump)"); if (enable_mupdf and is_web) return failBuild(b, web_step, "-Dmupdf=true is supported only by the native tty/Kitty and gui/SDL backends"); // The board's target is pinned (`target` above), so what is asked of // -Dtarget is checked, not what was resolved: another arch is refused, @@ -1140,7 +1140,7 @@ pub fn build(b: *std.Build) void { const obj = b.addObject(.{ .name = "pardes-esp32p4", .root_module = root_mod }); b.getInstallStep().dependOn(&b.addInstallFile(obj.getEmittedBin(), "pardes-esp32p4.o").step); - web_step.dependOn(&b.addFail("web needs -Dplatform=web -Dtarget=wasm32-freestanding -Ddump=").step); + web_step.dependOn(&b.addFail("web needs -Dplatform=web -Dtarget=wasm32-freestanding -Ddump=").step); } else if (platform == .macos) { const header = b.addTranslateC(.{ .root_source_file = b.path("src/macos/pardes.h"), @@ -1308,7 +1308,7 @@ pub fn build(b: *std.Build) void { run_unit.has_side_effects = true; unit_step.dependOn(&run_unit.step); if (testMatch(b, unit_profile, test_filters, unit_step)) |check| check.addArtifactArg(unit_tests); - web_step.dependOn(&b.addFail("web needs -Dplatform=web -Dtarget=wasm32-freestanding -Ddump=").step); + web_step.dependOn(&b.addFail("web needs -Dplatform=web -Dtarget=wasm32-freestanding -Ddump=").step); } else { var exe_name: []const u8 = if (platform == .gui) "pardes-gui" else "pardes"; if (target.result.os.tag != .linux or target.result.cpu.arch != .x86_64) @@ -1344,7 +1344,7 @@ pub fn build(b: *std.Build) void { const iso_step = b.step("run-isolated", "descend to a pardes with no host but the terminal"); iso_step.dependOn(&run_iso.step); } - web_step.dependOn(&b.addFail("web needs -Dplatform=web -Dtarget=wasm32-freestanding -Ddump=").step); + web_step.dependOn(&b.addFail("web needs -Dplatform=web -Dtarget=wasm32-freestanding -Ddump=").step); snap_build.addTty(b, .{ .exe = exe, -- cgit v1.3