fetch-luau recipe and the committed Luau foreign binding package (#75) #78

Closed
opened 2026-09-06 01:23:48 +00:00 by crowmaki · 0 comments
Owner

Parent

#75

What to build

The Luau runtime arrives the way slangc and Dear ImGui do. A just fetch-luau recipe downloads the pinned Luau source archive, verifies its hash against the justfile the way fetch-cimgui does, and builds the Ast, Compiler and VM libraries with LUAU_EXTERN_C using the C++ toolchain the imgui build already requires. Output lands under the tools directory keyed by version.

A committed Odin package under the luau Plugin (sibling to how cimgui sits under imgui) holds hand-written foreign import bindings for the subset of the Luau C API the Plugin will use: state creation and close, compile, load, pcall, stack access, tables, userdata with metatables, light userdata, and thread data (or an equivalent) for recovering the Plugin State from a C callback. The version constant and the pinned hash live beside the bindings, the way IMGUI_VERSION does. A fresh clone type-checks without a C++ toolchain.

A new tests/luau suite is listed beside imgui in the justfile and starts with a smoke test that creates a state, compiles and runs a chunk that sets a global, and reads the global back.

Acceptance criteria

  • just fetch-luau downloads, hash-verifies, builds and installs the pinned Luau into the tools directory; a second run reports "already present" and force=1 rebuilds
  • The build defines LUAU_EXTERN_C and the resulting library exports C-ABI symbols the bindings link against
  • The binding package pins version and hash in Odin constants, and the justfile carries the hash table keyed by that version
  • just check type-checks the binding package on a clone that has not run fetch-luau
  • tests/luau is in the justfile suite list and its smoke test compiles a chunk, runs it via pcall, and observes a global it set
  • The justfile header comment and AGENTS.md build section list fetch-luau

Blocked by

  • None (can start immediately)
## Parent #75 ## What to build The Luau runtime arrives the way `slangc` and Dear ImGui do. A `just fetch-luau` recipe downloads the pinned Luau source archive, verifies its hash against the justfile the way `fetch-cimgui` does, and builds the Ast, Compiler and VM libraries with `LUAU_EXTERN_C` using the C++ toolchain the imgui build already requires. Output lands under the tools directory keyed by version. A committed Odin package under the `luau` Plugin (sibling to how cimgui sits under imgui) holds hand-written `foreign import` bindings for the subset of the Luau C API the Plugin will use: state creation and close, compile, load, `pcall`, stack access, tables, userdata with metatables, light userdata, and thread data (or an equivalent) for recovering the Plugin State from a C callback. The version constant and the pinned hash live beside the bindings, the way `IMGUI_VERSION` does. A fresh clone type-checks without a C++ toolchain. A new `tests/luau` suite is listed beside `imgui` in the justfile and starts with a smoke test that creates a state, compiles and runs a chunk that sets a global, and reads the global back. ## Acceptance criteria - [ ] `just fetch-luau` downloads, hash-verifies, builds and installs the pinned Luau into the tools directory; a second run reports "already present" and `force=1` rebuilds - [ ] The build defines `LUAU_EXTERN_C` and the resulting library exports C-ABI symbols the bindings link against - [ ] The binding package pins version and hash in Odin constants, and the justfile carries the hash table keyed by that version - [ ] `just check` type-checks the binding package on a clone that has not run `fetch-luau` - [ ] `tests/luau` is in the justfile suite list and its smoke test compiles a chunk, runs it via `pcall`, and observes a global it set - [ ] The justfile header comment and AGENTS.md build section list `fetch-luau` ## Blocked by - None (can start immediately)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
crowmaki/cinnabar#78
No description provided.