Skip to content

mruby: the vendored engine moves to 4.0.0 - #3099

Merged
nesbox merged 2 commits into
mainfrom
mruby-4
Oct 18, 2026
Merged

nesbox merged 2 commits into
mainfrom
mruby-4

Conversation

@nesbox

@nesbox nesbox commented Oct 18, 2026

Copy link
Copy Markdown
Owner

The vendored mruby moves from 3.0.0-dev (7fe6f397, April 2021) to 4.0.0 (831da26b).

mruby 4 makes presym mandatory, writes the presym headers into the build tree, and enforces mrb_aspec argument counts for C methods.

  • disable_presym is gone from both build configs; CMake puts vendor/mruby/build/target/include on the ruby target's include path for the generated presym headers.
  • The backtrace API lives in mruby/internal.h since 3.2, so mruby.c includes it under MRUBY_RELEASE_NO >= 30200.
  • The script methods are registered with MRB_ARGS_ANY(): the binding validates its own defaults, and the API table's required counts describe the C API, not the script defaults (btn(), clip(), vbank()). The five zero-argument APIs (time, tstamp, exit, mouse, reset) keep MRB_ARGS_NONE() and still refuse arguments.

Verified locally:

  • ctest: 15/15;
  • the ruby conformance table matches the mruby 3.0 baseline line for line: 127/127 coverage and the same 8 known divergences;
  • a full Android build with NDK r23b links libtic80.so with all languages and mruby 4.0;
  • the ruby target builds for wasm (Emscripten);
  • the desktop static build rebuilds.

Not verified locally: Windows/MSVC and the consoles that use a system mruby (PREFER_SYSTEM_LIBRARIES); CI covers those.

Note for local testing: a tree that still carries a vendor/mruby/build from 3.0 may need it removed once — mruby's gensym step can trip on the old layout. Fresh checkouts and CI are unaffected.

🤖 Generated with Claude Code

nesbox and others added 2 commits October 18, 2026 13:05
mruby 4 makes presym mandatory (disable_presym is gone), writes the
presym headers into the build tree, and enforces mrb_aspec argument
counts for C methods.

CMake puts the generated include directory on the ruby target's path;
mruby.c reads the backtrace API from mruby/internal.h since 3.2, and
registers script methods with MRB_ARGS_ANY() so the binding keeps
validating its own defaults (btn(), clip(), vbank()). The five
zero-argument APIs keep MRB_ARGS_NONE() and still refuse arguments.

Verified: 15/15 ctest; the ruby conformance table matches the 3.0
baseline (127/127 coverage, the same 8 known divergences); full Android
(NDK r23b) and wasm builds.

Co-Authored-By: Claude Code <noreply@anthropic.com>
mruby 4 writes the presym headers during the build; the compile
database alone leaves mruby.c without them, and clang-tidy fails on the
missing header. Install Ruby for the mruby build and generate the
headers before the checker runs.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@nesbox
nesbox merged commit 5b1b77f into main Oct 18, 2026
17 checks passed
@nesbox
nesbox deleted the mruby-4 branch October 18, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant