Repository navigation
Conversation
The compiler reads constants from the kernel scripts, and a tree an
older Lunatik installed, or one --scripts names, that lacks a table or
an entry it reads stopped a compile at a line of the compiler: an index
error at emit/init.lua:280 for a linux/bpf.lua without max, and a
string.pack error at insn.lua:315 for one without func.map_lookup_elem,
or at btf.lua:136 for one without map_type.PERCPU_ARRAY.
luaebpf.proto.script now hands back the script's table with each table
it holds raising at a read of a name it does not carry:
<script> carries no '<name>': the kernel scripts under <dir> predate the compiler
so the reads a compile takes through it, max, func and map_type of
linux.bpf, default of linux.ratelimit and int of linux.limits, refuse
by name, and so does a read a later compiler adds. The kernel's loader
answers a module that lacks what it was built against the same way, per
symbol and naming it (simplify_symbols, kernel/module/main.c; and
check_version, kernel/module/version.c), and libbpf probes each feature
it uses rather than compare a version; a version stamp compared here
would need Lunatik's install to write one, and a number this tree keeps
by hand.
A script the directory lacks stays not found, with the paths searched,
and the modules of lib/bpf keep reading the kernel scripts through the
body's require.
Part of #9.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note This comment was written by an LLM, not a human. What the workflow that wrote this pull request held it to, at efe3690. Build, on Linux 6.8.0-138-generic aarch64: Grand Totals: pass:1344 fail:0 skip:35
Requirements (7 met) Each requirement, how the diff meets it and the case that shows it
Matrix, the reviewer's Each cell with its case, and what no case coversThe matrix, each cell run by hand in this review with the folded compiler staged ahead of the installed one (which is the base, fcd4422, file for file) and Read by what the script lacks, outcome
Successes and what stays:
Out of contract, seen: a script that returns no table stops at a line of proto.lua, as it stopped at emit/init.lua:280 on the base; the twins under lib/bpf on trees Lunatik never wrote. What this host cannot show: nothing here depends on the running kernel, the change runs in the CLI's Lua. A stale /lib/modules/lua itself was not staged, since the installed tree is shared; that path is |
A compile against kernel scripts an older Lunatik installed stops at a line of the compiler, as
emit/init.lua:280: attempt to index a nil value (field 'max'), which names neither the script nor the directory at fault.Such a compile now stops at the first table or entry it reads that the scripts lack, and names the script and the directory:
$ lunatik bpf --scripts=staging/lib/modules/lua filter.bpf.lua lunatik: staging/lib/modules/lua/linux/bpf.lua carries no 'max': the kernel scripts under staging/lib/modules/lua predate the compilerThe way out is the kernel scripts of a Lunatik as new as the compiler, installed or staged under
--scripts. A directory that lacks a script altogether keeps today's error, the module not found with the paths searched.Its tests live in Lunatik's
tests/luaebpf/scripts.sh, so they come in a Lunatik pull request opened after this one merges, which moves Lunatik'sluaebpfsubmodule here and is the one that closes the issue this answers.#9, which it does not close