Repository navigation
Add Lua bytecode compilation and production package builds - #28
Merged
Merged
Conversation
Scripts shipped as source are compiled by the radio on first load, which costs RAM and startup time, and there was no way to produce a release artifact. Wrap EdgeTX's edgetx-luac WebAssembly module (upstream PR #7275) in a WAMR runtime and build four things on top of it: - dev luac: compile a single script - dev build --out: a package directory with .luac next to every .lua, installable via pkg install - dev build --compress: an SD-card zip laid out at install destinations with no manifest, for artifact storage - pkg install/update --pre-compile: bytecode installed alongside sources Compilation never touches the SD card. --pre-compile runs the same build into a local TempDir and copies the finished tree across in one pass, so a script that fails to compile aborts before the card, the store, or the file list is touched. Sources ship next to the bytecode because the radio still discovers widgets by their .lua (EdgeTX#5230), and generated .luac files take their source's timestamp so the radio prefers them instead of recompiling. The module is downloaded on first use and cached; its output is byte-identical to the .luac the simulator and radio generate themselves, verified against six ELRS widget scripts.
Owner
Author
|
closes #24 |
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.
Scripts shipped as source are compiled by the radio on first load, which costs RAM and startup time, and there was no way to produce a release artifact. Wrap EdgeTX's edgetx-luac WebAssembly module (upstream PR #7275) in a WAMR runtime and build four things on top of it:
Compilation never touches the SD card. --pre-compile runs the same build into a local TempDir and copies the finished tree across in one pass, so a script that fails to compile aborts before the card, the store, or the file list is touched. Sources ship next to the bytecode because the radio still discovers widgets by their .lua (EdgeTX#5230), and generated .luac files take their source's timestamp so the radio prefers them instead of recompiling.
The module is downloaded on first use and cached; its output is byte-identical to the .luac the simulator and radio generate themselves, verified against six ELRS widget scripts.