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.
This commit is contained in:
@@ -103,19 +103,18 @@ async fn save_preferences(
|
||||
}
|
||||
|
||||
/// On Linux Wayland sessions (KDE, GNOME) WebKitGTK + DMABUF rendering hits
|
||||
/// known crashes that the HANDOVER documents working around with a manual
|
||||
/// env-var prefix:
|
||||
/// known crashes that the dev launcher works around by setting rendering
|
||||
/// env vars before WebKitGTK/WINIT initialise. In development, launch via:
|
||||
///
|
||||
/// ```sh
|
||||
/// env GDK_BACKEND=x11 WINIT_UNIX_BACKEND=x11 \
|
||||
/// WEBKIT_DISABLE_DMABUF_RENDERER=1 npm run tauri dev
|
||||
/// npm run dev:tauri
|
||||
/// ```
|
||||
///
|
||||
/// Detect the Wayland session at startup and warn when the process was not
|
||||
/// launched with the safe Linux rendering env vars. Rust 2024 marks runtime
|
||||
/// environment mutation unsafe in multi-threaded programs, so the app must be
|
||||
/// launched with these values by the desktop file, package wrapper, or dev
|
||||
/// shell rather than patching them here.
|
||||
/// launched with these values by `run.sh`, the desktop file, or a package
|
||||
/// wrapper rather than patching them here.
|
||||
///
|
||||
/// Inspired by Open-Whispr's similar Chromium self-relaunch (with
|
||||
/// --ozone-platform=x11). Day 6 of the upgrade plan.
|
||||
@@ -139,7 +138,7 @@ fn warn_if_x11_env_unset_on_wayland() {
|
||||
// renderer for no visible quality difference. Empirically (env-var
|
||||
// matrix on Ryzen 5 4650U / Vega 6, May 2026) toggling this dropped
|
||||
// magnotia idle CPU 12.30% → 2.80% of one core and idle GPU 17% → 10%.
|
||||
// Apples to both X11 and Wayland sessions; users can opt back in by
|
||||
// Applies to both X11 and Wayland sessions; users can opt back in by
|
||||
// setting WEBKIT_DISABLE_DMABUF_RENDERER=0 explicitly.
|
||||
warn_if_unset(
|
||||
"WEBKIT_DISABLE_DMABUF_RENDERER",
|
||||
|
||||
Reference in New Issue
Block a user