|
Cross-Compilation Build for Linux, macOS, and Windows from any platform. Powered by Zig. |
Standalone Executables Single-file executables with no runtime dependencies. Linux uses musl libc. |
|
C Library Support Built-in support for luafilesystem, lpeg, lua-cjson, lsqlite3, luasocket. |
Asset Embedding Embed data files and directories directly into the binary. |
# Build for current platform
luast myapp
# Build for multiple targets
luast -t linux-x86_64 -t darwin-arm64 -t windows-x86_64 myapp
# Standalone mode (no rockspec)
luast -m app.lua myappluast [options] [modules...] [output-name]
Options:
-h, --help Show help message
-q, --quiet Only show errors and warnings
-v, --verbose Show detailed output
-m, --main Main entry point (standalone mode)
-c, --clib C library dependency (can be repeated)
-e, --embed Embed data file/directory (can be repeated)
-r, --rockspec Path to rockspec file (default: auto-detect)
-t, --target Target platform (default: native)
| Target | Output |
|---|---|
linux-x86_64, linux-arm64 |
Static ELF (musl) |
darwin-x86_64, darwin-arm64 |
Mach-O |
windows-x86_64, windows-arm64 |
PE32+ |
| Variable | Description | Default |
|---|---|---|
BUILD_DIR |
Build directory | .build |
LUAST_CACHE |
Cache directory | ~/.cache/luast |
LUA_VERSION |
Lua version | 5.4.8 |
Build without a rockspec:
luast -m app.lua myapp
luast -m app.lua lib/ src/ myapp
luast -m app.lua -c lfs -c lpeg myappInclude LuaRocks modules by path:
luarocks install --local inspect
luast -m app.lua ~/.luarocks/share/lua/5.4/inspect.lua myappluast -m app.lua -e templates/ -e config.json myappAccess at runtime:
local embed = require("luast.embed")
local html = embed.read("templates/page.html")Built-in support:
| Library | Notes |
|---|---|
| luafilesystem | |
| lpeg | |
| lua-cjson | |
| lsqlite3complete | Includes SQLite3 |
| luasocket | Includes socket.lua, ltn12.lua, mime.lua |
Add via .luastrc:
return {
mylib = {
url = "https://github.com/user/mylib.git",
sources = { "src/mylib.c" },
},
}- uses: owloops/luast@main
with:
output: myapp
targets: linux-x86_64 linux-arm64 darwin-arm64 windows-x86_64| Input | Description | Default |
|---|---|---|
output |
Binary name | Package name |
rockspec |
Rockspec path | Auto-detect |
targets |
Space-separated targets | Native |
- Linux or macOS
- Lua 5.1+
- git, curl or wget
Zig is downloaded automatically.
- Linux binaries use musl (not glibc)
- No automatic LuaRocks dependency resolution
- No LuaJIT support
- No OpenSSL/TLS support
luacheck luast # Lint
stylua luast # Format