fix(slm): invoke llamafile via sh to bypass Wine binfmt_misc

APE polyglot binaries start with MZ magic bytes which Wine's
binfmt_misc rule intercepts on Linux. llamafile is also a valid
POSIX shell script; running it via 'sh' bypasses the kernel's
binfmt_misc lookup entirely.
This commit is contained in:
2026-05-07 17:08:52 +02:00
parent f19f666e0d
commit 035b63ea83
+3 -1
View File
@@ -147,7 +147,9 @@ func (m *Manager) Start(ctx context.Context) (string, error) {
return "", fmt.Errorf("slm: find free port: %w", err)
}
cmd := exec.CommandContext(ctx, mf.FilePath,
// Invoke via sh to bypass Wine binfmt_misc interception of APE polyglot binaries.
// llamafile is a valid POSIX shell script; sh executes the embedded launcher header.
cmd := exec.CommandContext(ctx, "sh", mf.FilePath,
"--server",
"--host", "127.0.0.1",
"--port", strconv.Itoa(port),