mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-02 00:25:34 +08:00
* feat: support multi-instance library mode via runtime symbol localization - Add the abi.localize_runtime profile field: the archive build combines the program object with exactly the runtime/vendor members it reaches and demotes every external definition except the profile-declared symbols to a local symbol (darwin: one ld -r pass with -exported_symbols_list; linux: ld -r then objcopy --keep-global-symbols) - N archives built under pairwise-distinct prefixes now link into one process with no symbol collisions and no shared mutable runtime state: each instance owns a private copy of the allocator, collector, result arena, and panic sink, so sinks register per instance and a trap poisons only the instance it fired in - Document the embedder contract beside the profile spec: one thread per instance (an instance is never entered from two threads), and values cross instances only through the embedder's own byte/record marshalling - Refuse cross-target localized builds with SC3002 (the step runs the host toolchain's ld/objcopy over host-format objects); absent or false keeps the classic single-archive artifact byte-for-byte - Add the two-instance acceptance probe (two archives, two embedder threads, independent collects, a trap delivered to its own sink exactly once while the other instance keeps answering) plus symbol-exactness, profile-shape, and target-posture suites, and schedule the artifact contracts on the gate host * fix: tighten runtime localization validation * fix: harden localized library publication