Skip to content

luaebpf: build and install with its own Makefile - #37

Open
lneto wants to merge 3 commits into
masterfrom
luaebpf-makefile
Open

lneto wants to merge 3 commits into
masterfrom
luaebpf-makefile

Conversation

@lneto

@lneto lneto commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

luaebpf cannot be built or installed from its own checkout: only Lunatik's Makefile builds its loader and its bytecode tables, and only Lunatik's install puts the compiler where the host's Lua finds it.

With this change luaebpf has a Makefile of its own. It builds against a Lunatik checkout, the one LUNATIK names or .. by default, which is Lunatik's root when luaebpf sits at its mount, and installs the compiler and the loader where Lunatik's install puts them today:

git clone --depth 1 --recurse-submodules https://github.com/luainkernel/lunatik.git
git clone https://github.com/luainkernel/luaebpf.git
cd luaebpf && make LUNATIK=../lunatik && sudo make install

sudo make uninstall and make clean undo them, and a CI job builds every pull request against Lunatik's master. The build needs libbpf and a Lunatik checkout with its lua submodule, and the compiler still runs only on a host Lunatik is installed on, which gives it lunatic, lunatik.class, lunatik.config and the kernel scripts a program file's body requires. Lunatik's Makefile keeps its own luaebpf rules until luainkernel/lunatik#2719 replaces them with a call to this one.

Closes #28

lneto and others added 3 commits November 25, 2026 23:43
make builds the loader and the bytecode tables against the Lunatik
checkout LUNATIK names, .. by default, where Lunatik mounts this tree
at luaebpf/, and make install puts the compiler under the host's
LUA_PATH as luaebpf/ and the loader under LUA_CPATH as
luaebpf/loader.so, where lunatik run --dev, stop and unload find it.

The rules are Lunatik's, Makefile lines 18, 40-48, 103, 109-118,
124-125, 180-188 and 209-210 at luainkernel/lunatik@2d4fad8, with the
paths rebased on LUNATIK and the kernel table built with the flags
that Makefile builds lunatic with. The variables keep Lunatik's names,
LUA_PATH, LUA_CPATH and INSTALL among them, so the overrides Lunatik's
build passes reach the $(MAKE) -C luaebpf LUNATIK=$(CURDIR) that
replaces those rules there (luainkernel/lunatik#2719). The bytecode
directory is written out rather than named BYTECODE, which would take
the BYTECODE=1 a Lunatik install is run with: that make hands its
command line on to this one. Built against a clone of Lunatik's
master, the tables and the loader are byte for byte the ones Lunatik's
rules build, and an install lays out the files Lunatik's does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build, install, test names the targets of luaebpf's Makefile and what
each reads of the Lunatik checkout, and says what the compiler keeps
reading of a Lunatik install once it builds alone: lunatic,
lunatik.class and lunatik.config, the kernel scripts and the linux.*
tables, which the update on #28 keeps in Lunatik.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The job clones Lunatik with its lua submodule, as a contributor's
checkout beside luaebpf's holds it, and runs make over it: a change
that breaks the build against the Lunatik it is built with fails its
pull request rather than the build of the Lunatik that moves the
mount to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lneto lneto added complexity: medium Several call sites, a new test, or a core path to audit workflow-reviewed reviewed end to end by a review workflow labels Nov 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

complexity: medium Several call sites, a new test, or a core path to audit workflow-reviewed reviewed end to end by a review workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

luaebpf: build, install and run from its own checkout

1 participant