Skip to content

feat(linux): add .deb + AppImage builds, Linux CI, and sidecar resource_dir fix - #470

Open
Nikish-codes wants to merge 1 commit into
andrewyng:mainfrom
Nikish-codes:linux
Open

feat(linux): add .deb + AppImage builds, Linux CI, and sidecar resource_dir fix#470
Nikish-codes wants to merge 1 commit into
andrewyng:mainfrom
Nikish-codes:linux

Conversation

@Nikish-codes

Copy link
Copy Markdown

What

Adds native Linux packaging (.deb + AppImage) to the release pipeline — currently macOS + Windows only. Closes the gap requested in #232, #171, #117, #414, #80.

Verified end-to-end on Ubuntu 24.04:

  • OpenWorker_0.1.7_amd64.deb (79 MB) — installs and the app finds its sidecar at runtime
  • OpenWorker_0.1.7_amd64.AppImage (157 MB)
  • Backend suite: 1114 passed / 1 skipped · GUI unit: 108 passed · cargo build: warning-clean

Why a new PR (supersedes #173)

#173 ("Add Linux release artifacts: AppImage + .deb") is approved and well-scoped but has been open and stalled for ~2 weeks. I built it locally and it hits two correctness gaps that this PR fixes:

1. The deb builds but the app can't start (runtime sidecar resolution)

#173 bundles the sidecar via Tauri resources but does not touch server_bin() in src-tauri/src/lib.rs. That function resolves the sidecar next to the app binary — correct on macOS (Contents/MacOS/Contents/Resources/) and Windows (resources unpack next to the exe), but wrong on a .deb: the binary lives in /usr/bin/ and resources land under /usr/lib/OpenWorker/ (Tauri's resource_dir()). Without the fix the build is green but the app hangs on "Starting coworker…".

Fix: server_bin(app) resolves via app.path().resource_dir() on Linux (#[cfg(target_os = "linux")]). macOS/Windows paths are untouched.

Verified against the built deb:

$ dpkg-deb -c OpenWorker_0.1.7_amd64.deb | grep sidecar
-rwxr-xr-x  usr/lib/OpenWorker/sidecar/openworker-server

2. The STT sidecar doesn't compile in CI (missing build deps)

#173's apt list omits libasound2-dev (cpal → ALSA) and libclang-dev (whisper-rs-sys → bindgen), so cargo build fails on the ocw-stt crate. It also names the deprecated libappindicator3-dev instead of the libayatana-appindicator3-dev successor Tauri 2 needs. This PR includes the correct deps and a distro-aware installer helper.

What's in the PR

File Change
packaging/build_linux.sh (new) PyInstaller sidecar → stage at binaries/sidecartauri build --bundles deb,appimage. BUNDLES= overrides targets.
packaging/install_linux_deps.sh (new) Distro-aware installer (Debian/Fedora/Arch) for the Tauri webkit GUI + ocw-stt build-time libs.
surfaces/gui/src-tauri/src/lib.rs server_bin() takes AppHandle, resolves the sidecar via resource_dir() on Linux. Silences an unused_mut on non-macOS (the window builder is mut only inside the macOS title-bar cfg block).
.github/workflows/release.yml ubuntu-22.04 matrix leg (stable glibc 2.35 for broad compat), Linux deps + build + staging steps, and a regression guard that fails CI if the deb ships without the sidecar at usr/lib/OpenWorker/sidecar/ — prevents the #173 bug class from recurring.
packaging/make_update_manifest.py Registers OpenWorker-linux-amd64.deb as the linux-x86_64 updater target.
README.md "Build a Linux package" section + packaging table entry. No download link (release timing is a maintainer call).

Scope deliberately kept out (follow-ups)

How to verify locally

bash packaging/install_linux_deps.sh        # Tauri + STT build libs (distro-aware)
python3 -m venv .venv && .venv/bin/pip install -e '.[bedrock]' pyinstaller typer
cd surfaces/gui && npm ci && cd ../..
./packaging/build_linux.sh
# → surfaces/gui/src-tauri/target/release/bundle/{deb,appimage}/
sudo dpkg -i surfaces/gui/src-tauri/target/release/bundle/deb/OpenWorker_*.deb
openworker-desktop

Notes for maintainers

Happy to rework or narrow scope however fits your roadmap. If Linux is already under internal development (per the README note about the internal list), no worries — the server_bin() resource_dir() fix and the missing-deps findings may still save you the debugging round either way. I can also drop these fixes as review comments on #173 if you'd prefer to land it there instead of a new PR.

Refs: supersedes #173 · related #19 #78 #218 · demand #232 #171 #117 #414 #80

…ce_dir fix

Add native Linux packaging to the release pipeline (currently macOS + Windows
only). Verified end-to-end: builds a working OpenWorker_0.1.7_amd64.deb (79M)
and OpenWorker_0.1.7_amd64.AppImage (157M); backend suite 1114 passed / 1
skipped, GUI unit 108 passed, cargo warning-clean.

Supersedes andrewyng#173 (same goal, approved but stalled). Two correctness gaps in andrewyng#173
that this addresses:

  1. Runtime sidecar resolution — andrewyng#173 bundles but does NOT fix server_bin(),
     so on a .deb install the app cannot find its sidecar: macOS/Windows
     resolve it next to the binary, but a .deb puts the binary in /usr/bin and
     resources under /usr/lib/OpenWorker/ (Tauri's resource_dir()). Without the
     fix the build is green but the app hangs on "Starting coworker…".
     Fixed: server_bin(app) resolves via app.path().resource_dir() on Linux
     (#[cfg(target_os = "linux")]); macOS/Windows paths unchanged. Verified
     against the deb's contents (sidecar at usr/lib/OpenWorker/sidecar/).

  2. Build deps — andrewyng#173 omits libasound2-dev (cpal/ALSA) and libclang-dev
     (whisper-rs bindgen), so the STT sidecar crate fails to compile in CI,
     and uses the deprecated libappindicator3-dev. This uses the ayatana
     successor and includes the STT build deps.

Changes:
- packaging/build_linux.sh: PyInstaller sidecar -> stage at binaries/sidecar ->
  tauri build --bundles deb,appimage. Unsigned; BUNDLES= overrides targets.
- packaging/install_linux_deps.sh: distro-aware installer (Debian/Fedora/Arch)
  for the Tauri webkit GUI + ocw-stt (cpal/ALSA, whisper.cpp, libclang) libs.
- src-tauri/src/lib.rs: server_bin() takes AppHandle and resolves the sidecar
  via resource_dir() on Linux; silence an unused_mut on non-macOS (the window
  builder is mut only inside the macOS title-bar cfg block).
- .github/workflows/release.yml: ubuntu-22.04 matrix leg (stable glibc for
  broad compat), Linux deps step, build step, deb/AppImage staging, and a
  regression guard that fails CI if the deb ships without the sidecar at
  usr/lib/OpenWorker/sidecar/ (prevents the andrewyng#173 bug class recurring).
- packaging/make_update_manifest.py: register OpenWorker-linux-amd64.deb as
  the linux-x86_64 updater target.
- README: "Build a Linux package" section + packaging table entry.

Notes:
- Voice Input is marked unsupported on Linux for now (the STT crate compiles
  on Linux, but the shell's compatibility gate is conservative by design);
  wiring a Linux audio backend is a natural follow-up, kept out of scope here.
- Built on ubuntu-22.04 (glibc 2.35) so the artifacts run on 22.04+ and most
  derivatives. aarch64 is a follow-up (andrewyng#218 covers Linux arm64 test CI).
- Unsigned: Linux has no universal code-signing scheme; auto-update artifacts
  emit only when TAURI_SIGNING_PRIVATE_KEY is set, same as the other targets.

Refs: andrewyng#173 (supersedes), andrewyng#19, andrewyng#78, andrewyng#218. Demand: andrewyng#232 andrewyng#171 andrewyng#117 andrewyng#414 andrewyng#80.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant