Expand description
Lua build-file evaluation for buildl, on the airsl embedded runtime.
This crate is the only part of buildl that depends on a Lua runtime, so the effect of an
airsl upgrade stays within one crate. It implements buildl-core’s DeclarationSource
port as LuaSource.
§Responsibilities
- Evaluating one build file per call on a fresh airsl engine, and returning what it staged exactly as written, or the one failure that stopped it.
- Installing the
buildlmodule table, reachable from Lua both asairsstack.buildland as the globalbuildl:target,test,discover,rule,alias,option,subdir,sources,discovered, which returns the result a discovery target last produced,decode_all, which returns the JSON values of a stream as a list, anduse, which loads a plugin under an environment of its own. - Keeping the declaration phase sandboxed: airsl’s minimal language surface, no grant of any
kind, only the
json,path,regex,hashandglobmodules, and nomath.random,math.randomseed,printorairsstack.path.absolute, and withtostringandstring.formatrefusing address-derived text (a table, function, thread or userdata without__tostring, and%p).buildl.sourcesis the only filesystem read, and it walks only the declaring directory, never entering a directoryLuaSource::newwas told to skip, such as the workspace’s output and state directories. - Bounding a build file’s memory, instructions and source walk: the ceilings of
DeclarationLimits, and a byte budget, equal to the memory ceiling, on what one file may stage. Thebuildl.sourceswalk is capped atwalk_entriesdirectory entries per build file, counted across all its calls. Wall time is outside every ceiling.
§Non-responsibilities
- Deciding which build files to evaluate, validating names, resolving labels or joining paths. The caller does all of that with what a file staged.
- Resolving, planning, scheduling, caching, or executing anything a build file declares.
§Where things live
| Module | Holds |
|---|---|
source | LuaSource: read, evaluate, report |
limits | DeclarationLimits |
engine | the airsl engine configuration |
curated | airsl’s path module without absolute |
snapshot | one-level copies of the library and module tables a plugin must not share |
module | the buildl host module, which raises refusals |
plugin | buildl.use: a plugin’s manifest, environment, require and instances |
decode_all | buildl.decode_all: a stream of JSON values as a list |
primitives | each primitive’s argument shape |
env_marks | a target’s env table: each name beside its written mark |
values | the Lua value readers every primitive shares |
refusal | why a primitive call was refused |
results | the discovery results buildl.discovered reads |
sources | the host-side walk behind buildl.sources |
stable_text | tostring and string.format without address-derived text |
staging | the staging buffer: order, byte budget, first refusal |
classify | airsl failures named as EvaluationFailure kinds |
This file holds only module declarations and re-exports, so it carries no logic to unit-test.
Structs§
- Declaration
Limits - The memory, instruction and source-walk ceilings for evaluating one build file.
- LuaSource
- Evaluates build files on the airsl embedded runtime, one fresh engine per file.