Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(linux): the bundled engine stops claiming a path Debian already owns (#120)

David5e4c377cc491
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f25c9956..7700e575 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -115,8 +115,8 @@ jobs:
mkdir -p src-tauri/bin
triple="$(rustc -vV | awk '/^host:/{print $2}')"
case "$triple" in
- *-windows-*) touch "src-tauri/bin/llama-server-$triple.exe" ;;
- *) touch "src-tauri/bin/llama-server-$triple" ;;
+ *-windows-*) touch "src-tauri/bin/lu-llama-server-$triple.exe" ;;
+ *) touch "src-tauri/bin/lu-llama-server-$triple" ;;
esac
ls -la src-tauri/bin/
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 65e6a07c..e9d6ba42 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -154,8 +154,8 @@ jobs:
shell: bash
run: |
case "${{ matrix.sidecar_triple }}" in
- *-windows-*) test -f "src-tauri/bin/llama-server-${{ matrix.sidecar_triple }}.exe" ;;
- *) test -x "src-tauri/bin/llama-server-${{ matrix.sidecar_triple }}" ;;
+ *-windows-*) test -f "src-tauri/bin/lu-llama-server-${{ matrix.sidecar_triple }}.exe" ;;
+ *) test -x "src-tauri/bin/lu-llama-server-${{ matrix.sidecar_triple }}" ;;
esac
ls -la src-tauri/bin/
diff --git a/.github/workflows/sidecar-windows.yml b/.github/workflows/sidecar-windows.yml
index e5dd93ab..66f8977d 100644
--- a/.github/workflows/sidecar-windows.yml
+++ b/.github/workflows/sidecar-windows.yml
@@ -61,7 +61,7 @@ jobs:
- name: Boot smoke — real model load + /health
shell: pwsh
run: |
- $bin = "src-tauri\bin\llama-server-x86_64-pc-windows-msvc.exe"
+ $bin = "src-tauri\bin\lu-llama-server-x86_64-pc-windows-msvc.exe"
if (-not (Test-Path $bin)) { throw "sidecar binary missing" }
& $bin --version
if ($LASTEXITCODE -ne 0) { throw "llama-server --version exited $LASTEXITCODE" }
@@ -90,6 +90,6 @@ jobs:
- name: Upload sidecar artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
- name: llama-server-x86_64-pc-windows-msvc
- path: src-tauri/bin/llama-server-x86_64-pc-windows-msvc.exe
+ name: lu-llama-server-x86_64-pc-windows-msvc
+ path: src-tauri/bin/lu-llama-server-x86_64-pc-windows-msvc.exe
retention-days: 14
diff --git a/WINDOWS-E2E-HANDOFF.md b/WINDOWS-E2E-HANDOFF.md
index f9e45279..4d33250e 100644
--- a/WINDOWS-E2E-HANDOFF.md
+++ b/WINDOWS-E2E-HANDOFF.md
@@ -46,7 +46,8 @@ npm install
# sidecar exe is missing; copy_binaries only checks that the file EXISTS).
# Pinned llama.cpp tag is b9949 (see scripts/build-llama.sh). Needs Vulkan SDK.
bash scripts/build-llama.sh x86_64-pc-windows-msvc
-# -> produces src-tauri/bin/llama-server-x86_64-pc-windows-msvc.exe
+# -> produces src-tauri/bin/lu-llama-server-x86_64-pc-windows-msvc.exe
+# (the lu- prefix is deliberate, see GitHub #120: Debian owns /usr/bin/llama-server)
# 2) Build the app (NSIS installer).
npm run tauri:build
@@ -57,7 +58,7 @@ npm run tauri:build
dropping a stub so `copy_binaries` passes, then fix the real sidecar after:
```bash
# emergency stub ONLY to get the app to build; built-in engine won't run until real build lands
-printf '' > src-tauri/bin/llama-server-x86_64-pc-windows-msvc.exe
+printf '' > src-tauri/bin/lu-llama-server-x86_64-pc-windows-msvc.exe
```
(There is also a dedicated CI lane `.github/workflows/sidecar-windows.yml` that does the full
Vulkan build + boot smoke — usable once the branch is pushed.)
@@ -116,7 +117,7 @@ expected behavior; **[Win‑new]** = Windows‑specific path that was never exer
### B. Built‑in engine — local text chat [Win‑new: Vulkan sidecar]
1. Chat tab, Local mode, model = **Built‑in Engine** (`127.0.0.1:8127/v1`, managed).
-2. Send "Two plus two?". **Expected:** streamed answer "4"; the `llama-server-*.exe` sidecar
+2. Send "Two plus two?". **Expected:** streamed answer "4"; the `lu-llama-server.exe` sidecar
is running (Task Manager). This is the Windows Vulkan sidecar — first real HW test.
### C. Local text chat — Ollama & LM Studio (if installed)
diff --git a/scripts/build-llama.sh b/scripts/build-llama.sh
index df158a67..92dec9be 100755
--- a/scripts/build-llama.sh
+++ b/scripts/build-llama.sh
@@ -76,10 +76,15 @@ cmake_flags_for() {
esac
}
+# The bundled file carries the app prefix (GitHub #120): Tauri's deb bundler
+# copies external binaries into /usr/bin, and Debian's own llama.cpp-tools
+# package already owns /usr/bin/llama-server, so a plain name made dpkg refuse
+# the whole install. Only the OUTPUT name changes; the binary llama.cpp itself
+# builds is still called llama-server and is found under that name above.
out_name_for() {
case "$1" in
- *-windows-*) echo "llama-server-$1.exe" ;;
- *) echo "llama-server-$1" ;;
+ *-windows-*) echo "lu-llama-server-$1.exe" ;;
+ *) echo "lu-llama-server-$1" ;;
esac
}
diff --git a/src-tauri/bin/.gitignore b/src-tauri/bin/.gitignore
index 270b1933..95f0804e 100644
--- a/src-tauri/bin/.gitignore
+++ b/src-tauri/bin/.gitignore
@@ -1,6 +1,9 @@
# Bundled llama.cpp sidecar binaries are build artifacts, never committed.
-# Produced by scripts/build-llama.sh into llama-server-<target-triple>[.exe]
+# Produced by scripts/build-llama.sh into lu-llama-server-<target-triple>[.exe]
# plus the ggml/llama/mtmd/omp runtime DLLs it links against on Windows.
+# The old unprefixed name stays listed so a checkout from before GitHub #120
+# does not suddenly offer a 3 GB binary for commit.
+lu-llama-server-*
llama-server-*
*.dll
!.gitignore
diff --git a/src-tauri/src/commands/engine.rs b/src-tauri/src/commands/engine.rs
index 110325f0..9cd678fe 100644
--- a/src-tauri/src/commands/engine.rs
+++ b/src-tauri/src/commands/engine.rs
@@ -45,18 +45,29 @@ const HEALTH_TIMEOUT: Duration = Duration::from_secs(60);
// ── Pure helpers (unit-tested without a real binary) ─────────────────────────
-/// Sidecar file name Tauri produces from `externalBin: ["bin/llama-server"]`
-/// inside the bundled app (target-triple suffix stripped, `.exe` on Windows).
+/// Sidecar file name Tauri produces from
+/// `externalBin: ["bin/lu-llama-server"]` inside the bundled app (target
+/// triple suffix stripped, `.exe` on Windows).
+///
+/// GitHub #120 (AnnSdf1969, Ubuntu 26.04, 2026-08-28): the file used to be
+/// called `llama-server`, and Tauri's deb bundler copies every external
+/// binary straight into `/usr/bin`. Debian ships its own `llama.cpp-tools`
+/// package that owns `/usr/bin/llama-server`, so dpkg refused the whole
+/// install with "trying to overwrite '/usr/bin/llama-server', which is also
+/// in package llama.cpp-tools". The bundler offers no way to put a sidecar
+/// anywhere else, so the name carries the app prefix instead. Renaming beats
+/// a Debian Conflicts entry: a conflict would make the user uninstall their
+/// own llama.cpp to install ours.
pub(crate) fn sidecar_binary_name() -> &'static str {
if cfg!(target_os = "windows") {
- "llama-server.exe"
+ "lu-llama-server.exe"
} else {
- "llama-server"
+ "lu-llama-server"
}
}
/// Rust host target-triple, used to locate the dev-time sidecar produced by
-/// `scripts/build-llama.sh` (`bin/llama-server-<triple>[.exe]`). mac-first for
+/// `scripts/build-llama.sh` (`bin/lu-llama-server-<triple>[.exe]`). mac-first for
/// 2.5.7; win/linux triples are here so P6 doesn't need to touch this.
pub(crate) fn host_target_triple() -> String {
let arch = std::env::consts::ARCH; // "aarch64" | "x86_64" | ...
@@ -406,11 +417,11 @@ fn resolve_engine_binary(app: &AppHandle) -> Option<PathBuf> {
}
}
- // 3. Dev: src-tauri/bin/llama-server-<triple>[.exe]. `tauri dev` runs the
- // binary from target/debug, so walk up to the manifest dir.
+ // 3. Dev: src-tauri/bin/lu-llama-server-<triple>[.exe]. `tauri dev` runs
+ // the binary from target/debug, so walk up to the manifest dir.
let triple = host_target_triple();
let suffix = if cfg!(target_os = "windows") { ".exe" } else { "" };
- let dev_name = format!("llama-server-{triple}{suffix}");
+ let dev_name = format!("lu-llama-server-{triple}{suffix}");
let mut dev_candidates: Vec<PathBuf> = Vec::new();
if let Ok(manifest) = std::env::var("CARGO_MANIFEST_DIR") {
dev_candidates.push(PathBuf::from(&manifest).join("bin").join(&dev_name));
@@ -1614,9 +1625,44 @@ mod tests {
fn sidecar_name_has_exe_only_on_windows() {
let name = sidecar_binary_name();
if cfg!(target_os = "windows") {
- assert_eq!(name, "llama-server.exe");
+ assert_eq!(name, "lu-llama-server.exe");
} else {
- assert_eq!(name, "llama-server");
+ assert_eq!(name, "lu-llama-server");
+ }
+ }
+
+ #[test]
+ fn the_bundled_sidecar_name_is_ours_and_not_one_debian_already_owns() {
+ // GitHub #120 (AnnSdf1969, Ubuntu 26.04): Tauri's deb bundler copies
+ // every externalBin straight into /usr/bin, so the file name IS the
+ // system path. Debian's own llama.cpp-tools package owns
+ // /usr/bin/llama-server, and dpkg refused the entire LU install over
+ // it. Two things have to hold, and both are checked from the shipped
+ // config rather than from a second copy of the string: the name the
+ // config bundles is the name this code looks for, and it is not a
+ // name the distro package already claims.
+ let conf: serde_json::Value = serde_json::from_str(include_str!("../../tauri.conf.json"))
+ .expect("tauri.conf.json parses");
+ let names: Vec<&str> = conf["bundle"]["externalBin"]
+ .as_array()
+ .expect("bundle.externalBin is an array")
+ .iter()
+ .filter_map(|b| b.as_str())
+ .map(|b| b.rsplit('/').next().unwrap_or(b))
+ .collect();
+ let name = sidecar_binary_name();
+ let stem = name.strip_suffix(".exe").unwrap_or(name);
+ assert!(
+ names.contains(&stem),
+ "the config bundles {names:?} but the app looks for {stem}",
+ );
+ // Negative control: the four binaries Debian's llama.cpp-tools puts
+ // in /usr/bin. None of them may be a name we bundle.
+ for owned in ["llama-server", "llama-cli", "llama-bench", "llama-quantize"] {
+ assert!(
+ !names.contains(&owned),
+ "{owned} is owned by llama.cpp-tools in /usr/bin, dpkg would refuse the install",
+ );
}
}
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index 836d4162..84ed4f1f 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -52,7 +52,7 @@
"../dist"
],
"externalBin": [
- "bin/llama-server"
+ "bin/lu-llama-server"
],
"icon": [
"icons/32x32.png",
diff --git a/src-tauri/windows/installer-hooks.nsh b/src-tauri/windows/installer-hooks.nsh
index ffdbfe70..def74a68 100644
--- a/src-tauri/windows/installer-hooks.nsh
+++ b/src-tauri/windows/installer-hooks.nsh
@@ -77,7 +77,7 @@
;
; aldrich_ironhart, 2026-08-10: the update stopped at "Error opening file for
; writing: D:\Locally Uncensored\llama-server.exe" with Abort, Retry, Ignore.
-; llama-server.exe is our own sidecar (externalBin), and Windows locks a running
+; The sidecar is our own (externalBin), and Windows locks a running
; image against writes, so the copy cannot succeed while it lives. Rust kills it
; on every orderly exit (state.rs shutdown_subprocesses), which is exactly why
; the installer never accounted for the cases that are left: the app still open
@@ -108,18 +108,22 @@
; the hook, and it beats the stock dialog where Retry loops on the same lock
; and Ignore leaves the new app running last release's engine. The leftover is
; swept at the start of the next install.
-!macro LU_FREE_SIDECAR
+; The file name is a parameter since GitHub #120 renamed the sidecar to
+; lu-llama-server.exe. An update coming from 2.6.6 or older still finds the old
+; llama-server.exe in the install folder, possibly with a live process on it,
+; so both names get freed and the one we no longer ship gets swept away.
+!macro LU_FREE_SIDECAR EXE
Push $R3
Push $R4
Push $R9
- Delete "$INSTDIR\llama-server.exe.old"
+ Delete "$INSTDIR\${EXE}.old"
StrCpy $R4 0
${Do}
- ${IfNot} ${FileExists} "$INSTDIR\llama-server.exe"
+ ${IfNot} ${FileExists} "$INSTDIR\${EXE}"
${ExitDo}
${EndIf}
ClearErrors
- FileOpen $R3 "$INSTDIR\llama-server.exe" a
+ FileOpen $R3 "$INSTDIR\${EXE}" a
${IfNot} ${Errors}
FileClose $R3
${ExitDo}
@@ -127,11 +131,11 @@
${If} $R4 >= 4
; Still locked after four rounds, so it is not our engine holding it.
; Move it out of the way instead of spinning here or failing the copy.
- Rename "$INSTDIR\llama-server.exe" "$INSTDIR\llama-server.exe.old"
+ Rename "$INSTDIR\${EXE}" "$INSTDIR\${EXE}.old"
${ExitDo}
${EndIf}
IntOp $R4 $R4 + 1
- nsExec::Exec `"$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NonInteractive -Command "Get-CimInstance Win32_Process | Where-Object { $$_.ExecutablePath -eq '$INSTDIR\llama-server.exe' } | ForEach-Object { Stop-Process -Id $$_.ProcessId -Force }"`
+ nsExec::Exec `"$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NonInteractive -Command "Get-CimInstance Win32_Process | Where-Object { $$_.ExecutablePath -eq '$INSTDIR\${EXE}' } | ForEach-Object { Stop-Process -Id $$_.ProcessId -Force }"`
Pop $R9
Sleep 800
${Loop}
@@ -140,8 +144,18 @@
Pop $R3
!macroend
+; What 2.6.6 and older left behind. We do not ship this file any more, so it is
+; freed for the same reason (a live orphan would keep answering on our port)
+; and then removed rather than left as a 3 GB stranger in the install folder.
+!macro LU_SWEEP_OLD_SIDECAR
+ !insertmacro LU_FREE_SIDECAR "llama-server.exe"
+ Delete "$INSTDIR\llama-server.exe"
+ Delete "$INSTDIR\llama-server.exe.old"
+!macroend
+
!macro NSIS_HOOK_PREINSTALL
- !insertmacro LU_FREE_SIDECAR
+ !insertmacro LU_FREE_SIDECAR "lu-llama-server.exe"
+ !insertmacro LU_SWEEP_OLD_SIDECAR
!if "${PRODUCTNAME}" != "Locally Uncensored"
!insertmacro LU_REMOVE_OLD_NSIS HKCU
diff --git a/src/lib/__tests__/installer-frees-sidecar.test.ts b/src/lib/__tests__/installer-frees-sidecar.test.ts
index d0e709b0..b1a99a30 100644
--- a/src/lib/__tests__/installer-frees-sidecar.test.ts
+++ b/src/lib/__tests__/installer-frees-sidecar.test.ts
@@ -56,15 +56,15 @@ describe('the installer frees the bundled engine', () => {
})
it('asks the only question that matters, can the file be written', () => {
- expect(unlock).toMatch(/FileOpen \$R3 "\$INSTDIR\\llama-server\.exe" a/)
+ expect(unlock).toMatch(/FileOpen \$R3 "\$INSTDIR\\\$\{EXE\}" a/)
// Bounded: a locked file must not spin the installer forever.
expect(unlock).toMatch(/\$R4 >= 4/)
})
it('frees the file the bundle actually ships and Rust actually starts', () => {
const external = conf.bundle?.externalBin ?? []
- expect(external).toContain('bin/llama-server')
- expect(engineRs).toMatch(/"llama-server\.exe"/)
+ expect(external).toContain('bin/lu-llama-server')
+ expect(engineRs).toMatch(/"lu-llama-server\.exe"/)
})
})
@@ -74,7 +74,7 @@ describe('it kills our engine and nobody elses', () => {
})
it('kills only the process whose image is the file being overwritten', () => {
- expect(unlock).toContain("-eq '$INSTDIR\\llama-server.exe'")
+ expect(unlock).toContain("-eq '$INSTDIR\\${EXE}'")
expect(unlock).toMatch(/Stop-Process -Id \$\$_\.ProcessId -Force/)
})
@@ -104,15 +104,48 @@ describe('it kills our engine and nobody elses', () => {
describe('a lock we cannot clear must not end the update', () => {
it('moves the old engine aside instead of failing the copy', () => {
expect(unlock).toMatch(
- /Rename "\$INSTDIR\\llama-server\.exe" "\$INSTDIR\\llama-server\.exe\.old"/,
+ /Rename "\$INSTDIR\\\$\{EXE\}" "\$INSTDIR\\\$\{EXE\}\.old"/,
)
// The rename is the last resort, it belongs after the retry budget.
expect(unlock.indexOf('$R4 >= 4')).toBeLessThan(unlock.indexOf('Rename'))
})
it('sweeps the leftover before the next install writes a new one', () => {
- const sweep = unlock.indexOf('Delete "$INSTDIR\\llama-server.exe.old"')
+ const sweep = unlock.indexOf('Delete "$INSTDIR\\${EXE}.old"')
expect(sweep).toBeGreaterThan(-1)
expect(sweep).toBeLessThan(unlock.indexOf('${Do}'))
})
})
+
+/**
+ * GitHub #120 (AnnSdf1969, Ubuntu 26.04, 2026-08-28): the sidecar was called
+ * llama-server, Tauri's deb bundler copies external binaries straight into
+ * /usr/bin, and Debian's own llama.cpp-tools package owns
+ * /usr/bin/llama-server. dpkg refused the entire install over the collision.
+ * The file now carries our prefix, which means a Windows update coming from
+ * 2.6.6 or older finds the old file, and possibly a live process on it, in an
+ * install folder we no longer write that name into.
+ */
+describe('an update from before the rename does not leave the old engine behind', () => {
+ const preinstall = hooks.slice(hooks.indexOf('!macro NSIS_HOOK_PREINSTALL'))
+
+ it('frees the file this build actually ships', () => {
+ expect(preinstall).toContain('!insertmacro LU_FREE_SIDECAR "lu-llama-server.exe"')
+ })
+
+ it('also frees and removes the name 2.6.6 shipped', () => {
+ expect(preinstall).toContain('!insertmacro LU_SWEEP_OLD_SIDECAR')
+ const sweep = hooks.slice(hooks.indexOf('!macro LU_SWEEP_OLD_SIDECAR'))
+ expect(sweep).toContain('!insertmacro LU_FREE_SIDECAR "llama-server.exe"')
+ expect(sweep).toContain('Delete "$INSTDIR\\llama-server.exe"')
+ })
+
+ it('never ships a name Debian already owns in /usr/bin', () => {
+ // Negative control: the four binaries llama.cpp-tools installs there.
+ const external = conf.bundle?.externalBin ?? []
+ const names = external.map((b) => b.split('/').pop())
+ for (const owned of ['llama-server', 'llama-cli', 'llama-bench', 'llama-quantize']) {
+ expect(names).not.toContain(owned)
+ }
+ })
+})