Runtime should ship with the compiler/CLI, not live in a project's ludic_modules #75
Labels
No labels
area:ci
area:docs
area:input
area:net
area:rendering
area:repo
area:stdlib
area:tooling
area:types
cleanup
dx
priority:high
priority:low
priority:medium
proposal
status:in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: workshopsoft/ludic#75
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A game project currently must expose the engine runtime (runtime/native/*) under its module root, because the compiler resolves the auto-spliced
runtime/native/core.ludicthrough the$LUDIC_MODULESfallback (defaultludic_modules/). That forces every project to symlink or copy the native + web build runtime intoludic_modules.The runtime is part of the toolchain, not the project. The compiler/CLI should locate and splice its own runtime from its install (e.g.
LUDIC_HOME/runtimeor embedded), independent of the project's package module root.ludic_modules/should hold only third-party packages.Found while setting up an external game repo that consumes the ludic.* controller packages.
Shipped in
ab4546e(full suite 113/0, goldens byte-identical, C-free bootstrap fixpoint intact).The compiler auto-splices
runtime/native/*for any ECS game, but it resolved that import relative to the build CWD and then fell back to the package module root ($LUDIC_MODULES, defaultludic_modules/) — which is exactly why an external game had to copy or symlink the engine runtime intoludic_modules/.Fix:
do_importnow treats aruntime/...path specially — when it isn't found relative to the build, it's resolved from the install root$LUDIC_HOME(default: the compiler binary's directory, the same placemain.ludicalready findscocoa.ll/audio.ll/http.ll), before the package module root. So the runtime comes from the toolchain install, andludic_modules/holds only third-party packages.Backward-compatible: in-repo builds still resolve the runtime locally (CWD = repo root), so the
$LUDIC_HOMEfallback never fires there and the emitted IR / fixpoint are untouched. Verified with a hermetic test that builds an ECS game from an external CWD that deliberately has noruntime/and noludic_modules/under it — it compiles and runs, resolving the engine runtime purely fromLUDIC_HOME. Documented in docs/PACKAGES.md.