summaryrefslogtreecommitdiff
path: root/src/host/library.zig
Commit message (Collapse)AuthorAge
* Keep a loaded sketch library's name valid, for panic tracesGabriel Schneider42 hours
| | | | | | | | | | | | A panic's stack trace finds a library's debug info by the name dlopen was given, and the load link was deleted right after loading: every frame in a sketch printed as ??? (a sketch that links libc; one that does not is not seen by Zig's own dl_iterate_phdr at all). Link and fd now live as long as the library is loaded, and Library.close removes them; a host that dies leaves its dangling links in $XDG_RUNTIME_DIR. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* Load libraries from Zig 0.17.1's incremental linkerGabriel Schneider42 hours
| | | | | | | | | | | | | | | `-fincremental` selects Zig's new ELF linker, and 0.17.1's writes DT_VERSYM without DT_VERDEF or DT_VERNEED when nothing is versioned: glibc then reads a null version table at the first relocation against an export, and dlopen faults. When a library has that shape, the host loads a copy of it in an anonymous memory file with DT_VERSYM dropped (nothing in it is versioned, so nothing is lost); the build's own file is never written, and every other library loads as before. The copy is 10 ms for the counter's 28 MB library. Fixed in Zig after 0.17.1 (6d27011edb): the check then never fires. The reload test's second build goes through the new linker. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* Load sketch libraries through a symlink and identify builds by statGabriel Schneider42 hours
| | | | | | | | | | A load copied the whole library to $XDG_RUNTIME_DIR (a read/write loop across filesystems) and then hashed all of it for the build id: 40 ms for a 10 MB Debug library, 200 ms for drat-meout's 58 MB. dlopen only needs a fresh name, so the host links one to an fd open on the library, which also pins the file a build may rename over meanwhile. The build id recordings carry is a hash of the file's inode, size and modification time: Zig's own linker writes no build-id note in Debug.
* Refuse a sketch library built by another compiler, backend or modeGabriel Schneider42 hours
| | | | | | | | 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.
* sketchbook: Zig 0.17, a Store on disk, requests, a scope (waveform, ↵Gabriel Schneider7 days
| | | | spectrum, spectrogram), audio codecs and fonts, web host
* Put the game first: lib/sketchbook, sketches/vecanimGabriel Schneider2026-09-25
The root is the game. The platform library moves to lib/sketchbook (with serve_web.py, which serves any sketch's web build, as a tool of it), and vecanim to sketches/vecanim, still its own package on the same library.