Skip to content

feat(desktop): set up everything automatically on first launch - #22

Merged
aryanjsx merged 2 commits into
mainfrom
feat/self-setup
Nov 1, 2026
Merged

aryanjsx merged 2 commits into
mainfrom
feat/self-setup

Conversation

@aryanjsx

@aryanjsx aryanjsx commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Summary

On a fresh PC, the packaged desktop app stopped on first launch unless the user had already installed uv, git and a Rust toolchain (plus Visual Studio Build Tools on Windows): it cloned the source repo and compiled locus_rust locally. The bundled Ollama also shipped without its inference libraries on Windows x64, macOS and Linux, so models couldn't run unless Ollama was installed separately.

After this PR, first launch sets everything up itself.

How it works

  • Bundled runtime: release builds bundle uv, the Locus wheel, a prebuilt locus_rust wheel and hash-locked requirements exported from uv.lock, under runtime/.
  • First launch, or after an app update: the app installs that runtime into ~/.locus/desktop-runtime with a uv-managed Python 3.12, then runs locus serve from it. An install stamp keyed on the bundled manifest triggers a reinstall when the app version changes.
  • Developer mode: source checkouts are unchanged. If LOCUS_ROOT is set or the app runs from inside a checkout, it uses uv sync / uv run locus as before.
  • Ollama runtime: Ollama's CPU and Vulkan runtime is bundled on Windows and Linux, and its helper libraries on macOS. CUDA and ROCm are skipped, since they add 1–2 GB. A user-installed Ollama is still preferred.

Changes

  • frontend/src-tauri/src/runtime.rs (new): manifest parsing, install steps, install stamp and error messages, with unit tests.
  • frontend/src-tauri/src/lib.rs:
    • runtime selection and first-launch install
    • shared serve target for both modes
    • bundled sidecar lookup on every platform
    • Ollama started in its runtime folder
    • console windows hidden on Windows
  • scripts/download-uv.sh (new): pinned uv 0.13.6, verified against the published SHA-256 checksums.
  • scripts/build-runtime.sh (new): builds the bundled runtime per platform. Windows ARM64 gets an x64 runtime, matching the existing emulated backend.
  • scripts/runtime-smoke.sh (new): installs the bundle exactly as the app does, then checks that locus serve reports healthy against a stand-in Ollama API.
  • scripts/download-ollama.sh: bundles the inference runtime for every target.
  • desktop.yml:
    • release builds bundle uv and the runtime, and smoke-test it before publishing
    • new runtime-smoke PR job on Linux and Windows
  • CLI banners now show Locus instead of the leftover OpenJarvis art.
  • README and docs: the desktop app no longer needs a backend or developer tools installed first.

Testing

  • Install path on Windows: verified locally with the same uv commands: uv-managed Python 3.12.16, 102 locked packages installed with hash checks, then the Locus wheel. locus serve reached HTTP 200 on /health in 13 s against a stand-in Ollama.
  • uv download: download-uv.sh downloads and verifies uv on Windows.
  • Scripts and workflow: all scripts pass bash -n, and desktop.yml parses.
  • Rust code: not compiled locally (no Visual Studio toolchain available). This PR's validate job (cargo test) is the first compile and unit-test run, and runtime-smoke is the first end-to-end run with the locus_rust wheel.
  • Clean-PC install: not tested yet. That happens with the next desktop release.

Packaged desktop installs previously stopped on first launch unless the
user had installed uv, git and a Rust toolchain, and the bundled Ollama
shipped without its inference libraries, so models couldn't run unless
Ollama was installed separately.

- Bundle uv and a prebuilt runtime (Locus wheel, locus_rust wheel and
  hash-locked requirements) per platform. On first launch, or after an
  app update, the app installs it into ~/.locus/desktop-runtime with a
  uv-managed Python and runs `locus serve` from there. Source checkouts
  (LOCUS_ROOT, or running from inside a checkout) work as before.
- Bundle Ollama's CPU and Vulkan runtime on Windows and Linux and its
  helper libraries on macOS; skip CUDA/ROCm to keep installers small.
- Find bundled sidecars beside the app on every platform, and hide
  console windows for child processes on Windows.
- Release builds smoke-test the bundled runtime before publishing; PRs
  run the same check on Linux and Windows.
- Replace the leftover OpenJarvis CLI banners with a Locus wordmark.
- Update the README and docs: no backend or developer tools to install.
The test fell back to a live DuckDuckGo search and failed whenever it
returned no results to the CI runner.
@aryanjsx
aryanjsx merged commit b33fc18 into main Nov 1, 2026
29 checks passed
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