Files
Lumotia/docs/architecture-map/05-core-storage-hotkey-build/workspace-cargo.md
Jake 792fb5ea08 agent: dev launcher — own Linux env-var contract, add dev:tauri, doc sweep
The 2026-05-12 engine-slop pass removed runtime std::env::set_var mutation from src-tauri/src/lib.rs and replaced it with warn_if_x11_env_unset_on_wayland. With no launcher owning the contract, Linux Wayland dogfood was about to regress.

run.sh:
- now owns Linux launcher env defaults via case "$(uname -s)"
  LIBCLANG_PATH=/usr/lib64/llvm21/lib64 (user-set wins)
  WEBKIT_DISABLE_DMABUF_RENDERER=1 (always on Linux; user-set wins)
  GDK_BACKEND=x11, WINIT_UNIX_BACKEND=x11 (Wayland only; user-set wins)
- 60s Vite readiness timeout
- detects early Vite exit (kill -0 + wait) instead of hanging forever
- trap installed before wait so Ctrl-C cleans up
- args forwarded: ./run.sh --release etc.
- non-exec final Tauri launch preserved so cleanup trap fires

package.json:
- "dev:tauri": "./run.sh" — canonical discoverable dev command

Docs:
- README, dev-setup, architecture-map runtime + launcher pages updated with the new contract; canonical command is npm run dev:tauri (./run.sh as direct equivalent)
- dev-launcher-and-scripts.md replaces the incorrect "kills process group" claim with honest "kills the spawned npm process"
- dev-setup.md path /CORBEL-Projects/magnotia → /CORBEL-Projects/transcription-app
- gpu-tuning/plan.md gets a superseded note rather than rewriting the original rationale
- engine-slop-residuals.md gains Area F (packaged-binary launcher contract) with honest wrapper-vs-.desktop trade-off documented

Verification: bash -n run.sh; shellcheck clean; cargo check -p magnotia green; npm pkg get 'scripts.dev:tauri' returns "./run.sh"; stale-ref sweep clean across living docs.
2026-05-12 22:05:33 +01:00

4.0 KiB

name, type, slice, last_verified
name type slice last_verified
Workspace Cargo.toml architecture-map-page 05-core-storage-hotkey-build 2026/05/09

Workspace Cargo.toml

Where you are: Architecture mapCore, Storage, Hotkey, Build → Workspace Cargo.toml

Plain English summary. The repo-root Cargo.toml. Tiny — 161 bytes. Defines the Cargo workspace (one binary at src-tauri/, every crate under crates/*) and the release profile that produces the Tauri bundle artefacts.

At a glance

  • File: /Cargo.toml (repo root, 161 bytes).
  • External: none. The workspace root has no dependencies of its own; member crates pin their own versions.
  • Consumers: every Cargo invocation. cargo check --workspace from the repo root walks the members.

Contents

[workspace]
members = ["src-tauri", "crates/*"]
resolver = "2"

[profile.release]
codegen-units = 1
lto = "thin"
opt-level = 3
panic = "abort"
strip = "symbols"

Members

The crates/* glob picks up every directory under crates/ that contains a Cargo.toml. Members at the time of writing:

  • crates/core/magnotia-core
  • crates/storage/magnotia-storage
  • crates/hotkey/magnotia-hotkey
  • crates/audio/ → audio capture (slice 3)
  • crates/transcription/ → transcription engines (slice 3)
  • crates/llm/magnotia-llm (slice 4)
  • crates/ai-formatting/magnotia-ai-formatting (slice 4)
  • crates/mcp/magnotia-mcp (slice 4)
  • crates/cloud-providers/magnotia-cloud-providers (slice 4)
  • src-tauri/ → the Tauri binary magnotia (slice 2)

Resolver

resolver = "2" is mandatory for any workspace that mixes feature flags across [dependencies] and [build-dependencies] or [dev-dependencies]. Without it, features unify in surprising ways (a build-script-only feature can silently affect the runtime crate). Tauri 2's docs require resolver 2.

Release profile

codegen-units = 1   # one codegen unit; longer compile, better optimisation
lto = "thin"         # cross-crate inlining without full LTO's compile blow-up
opt-level = 3        # standard optimised
panic = "abort"      # smaller binaries; no unwind tables; mandatory for embedded panics
strip = "symbols"    # debug symbols stripped from release artefacts

The panic = "abort" setting is a deliberate trade-off:

  • Plus: smaller binary, no __rust_panic_unwind machinery, faster cold start.
  • Minus: any panic is fatal. The crash hook (slice 2) writes a .crash file before the process dies; the diagnostic-report bundler in Settings → About surfaces it on next launch.

lto = "thin" not "fat" because thin LTO gives most of the optimisation benefit at a fraction of the compile time. Whisper-rs-sys + llama-cpp-sys-2 are already huge C++ builds; saving build time matters more than the last 5% of optimisation.

Watch-outs

  • No [workspace.dependencies] block. Each member crate pins its own dep versions independently. Side effect: sqlx 0.8 in magnotia-storage and sysinfo 0.35 in magnotia-core could drift between members. A future tidy would centralise common pins.
  • No [patch] overrides. Useful to know — every crate is consumed at its registered version.
  • codegen-units = 1 makes release builds slow. ~10 minutes on Jake's Monolith for a clean cargo tauri build. Acceptable for release; use cargo tauri dev (debug, default) for iteration.
  • No [profile.dev] overrides. Default debug build. cargo build produces a binary in target/debug/. The workspace target dir is ./target at the repo root, not src-tauri/target — this caught the CI cache step (see ci-pipeline.md).

See also