LocalAI icon indicating copy to clipboard operation
LocalAI copied to clipboard

Tables add-on does not start on musl hosts (cgo build links glibc)

Open mudler-agent opened this issue 1 week ago • 0 comments

The Tables add-on executable does not start on Linux hosts that use musl instead of glibc (Alpine, Void musl, Hadron and similar). The other add-ons do.

What happens

Starting the packaged tables executable on a musl host fails at once:

./tables: No such file or directory

The file exists. The kernel cannot find the program loader. readelf shows why:

Requesting program interpreter: /lib64/ld-linux-x86-64.so.2
NEEDED  libc.so.6

Why

scripts/addons/package.sh builds every add-on with CGO_ENABLED=0, except Tables (cgo=1). Tables uses github.com/mattn/go-sqlite3, which needs cgo. On Linux the result is a dynamic glibc executable. Musl hosts have no /lib64/ld-linux-x86-64.so.2 and no libc.so.6.

What I checked

I built all 24 add-on executables from master the way package.sh does and started each one on a musl host (release binary of local-ai v5.0.0, x86_64). The 23 pure-Go add-ons are static and start. Only tables fails. The local-ai server and the CPU llama.cpp backend (which ships its own glibc loader) work on the same host.

Possible fixes

  1. Replace mattn/go-sqlite3 with a pure-Go driver (modernc.org/sqlite is already in go.mod) so Tables builds with CGO_ENABLED=0. Check that the SQLite features Tables uses (backup/export, hooks, extensions) exist in that driver.
  2. Keep cgo and link statically against musl (for example with musl-gcc or zig cc -target x86_64-linux-musl) for the Linux package.
  3. Bundle a glibc loader and libraries with the add-on, as the backends do.

Option 1 is the simplest to ship if the driver covers what Tables needs.

Acceptance

The packaged tables executable starts on a musl host, and the existing Tables tests pass.

mudler-agent avatar Nov 20 '26 09:11 mudler-agent