From 8704fa7662f40d70552daa917144987a46e14b51 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 22:49:11 -0300 Subject: kinds #49, the static builds: `zig build static -Dplatform=tui -Dtarget=x86_64-linux-musl` and `zig build static -Dplatform=gui` (dynamic, both addons in) build and open a PNG and a PDF over 9P with `/addons` saying builtin; `Addon load` in a pardes with its addons compiled in is refused in words (`not on this platform: its addons are compiled in`) rather than by a failed dlopen, and building.typ and shared-libs.md name the gui's static step Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/Addon.zig | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Addon.zig') diff --git a/src/Addon.zig b/src/Addon.zig index 209c761a..d39a27f3 100644 --- a/src/Addon.zig +++ b/src/Addon.zig @@ -112,6 +112,7 @@ fn read(data: []const u8, path: []const u8, words: *[64]LoadedWord, why: *Why) L /// (dlopen hands back the handle it has for a path it has), unless this /// process holds those very bytes already. fn hold(path: []const u8, hash: *[32]u8, why: *Why) ?*Lib { + if (comptime compiled_in.len > 0) return failNull(why, "not on this platform: its addons are compiled in", .{}); var z: [4096]u8 = undefined; const path_z = std.fmt.bufPrintSentinel(&z, "{s}", .{path}, 0) catch return failNull(why, "the path is too long", .{}); const f = std.c.fopen(path_z, "r") orelse return failNull(why, "cannot read it", .{}); -- cgit v1.3