improvement: Migrate to lua 1.0#9
Merged
Merged
Conversation
Follows https://lua.hexdocs.pm/migrating-to-1-0.html. - Bump the lua requirement from ~> 1.0.0-rc to ~> 1.0 (lock at 1.0.1) - Fix transaction error decoding: Lua.RuntimeException no longer carries VM state, so decode the raised value against the post-call %Lua{} stashed through the message channel, and strip the location prefix 1.0 prepends to string error values - Remove Luerl-era dead code: :erl_func/:erl_mfa/:funref/:usdref value tags, MFA-decoded builtin callables, :assert_error/:error_call error shapes, and the always-nil exception :state plumbing in eval
zachdaniel
approved these changes
Jul 18, 2026
zachdaniel
left a comment
Contributor
There was a problem hiding this comment.
Hell yeah.
🚀 Thank you for your contribution! 🚀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates to lua 1.0 (locked at 1.0.1), following the 1.0 migration guide. Most of the migration already landed in #5; this finishes it.
Changes
mix.exs: bump the requirement from~> 1.0.0-rcto~> 1.0.runtime.ex): in the RC,Lua.RuntimeExceptioncarried the VM state on its:statefield and the transaction handler decoded the raised Lua value against it. In 1.0 final that field is never populated, so everyerror(...)/utils.transaction.rollbackinside a transaction fell through to the genericlua_errorenvelope. The handler now decodes the exception's:valueagainst the post-call%Lua{}it already stashes through the message channel, and strips the"<eval>:1: "location prefix 1.0 prepends to string error values.:tref,:udref,:native_func,:lua_closure,:compiled_closure)::erl_func,:erl_mfa,:funref,:usdrefclauses in the result encoder andprintformatter{module, function, arity}encoder clause for Luerl-decoded builtins — an MFA-shaped tuple from an action's:termslot now gets the honest{"type": "tuple"}wrap instead of an opaque function marker:assert_error/:error_callerror shapes in the transaction handler, which now pattern-matches%Lua.RuntimeException{}explicitly:stateplumbing ineval.ex(the VM state lives on the wrapped:originalexception)Testing
mix format --check-formatted,mix credo --strict, andmix dialyzerall clean