From 88c04dd6c392c6d8fc3a02408506e85d86f476d5 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 16 Nov 2026 22:57:31 -0300 Subject: Refuse a sketch library built by another compiler, backend or mode abi.hash now covers the zig version, codegen backend and optimize mode: Zig's own calling convention (Host.VTable, every Allocator) differs between them, so a Debug host loading a ReleaseFast or LLVM library faulted on its first draw. Libraries export sketch_build, and the host's refusal says what differs and what to run instead. --- src/sketch/root.zig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/sketch/root.zig') diff --git a/src/sketch/root.zig b/src/sketch/root.zig index cb20ab9..bc09add 100644 --- a/src/sketch/root.zig +++ b/src/sketch/root.zig @@ -317,6 +317,7 @@ pub fn exportSketch(comptime App: type) void { @export(&G.update, .{ .name = names.update }); @export(&G.draw, .{ .name = names.draw }); @export(&G.command, .{ .name = names.command }); + @export(&G.build, .{ .name = "sketch_build" }); } pub fn Glue(comptime App: type) type { @@ -325,6 +326,8 @@ pub fn Glue(comptime App: type) type { pub const Session = if (@hasDecl(App, "Session")) App.Session else struct {}; pub const Store = if (@hasDecl(App, "Store")) App.Store else struct {}; + const build: [abi.build.len:0]u8 = abi.build.*; + pub const description: abi.Info = .{ .abi = abi.hash, .name = if (@hasDecl(App, "name")) App.name else "sketch", -- cgit v1.3