feat/tauri2-desktop-migration #120
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/tauri2-desktop-migration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three workflow-side adjustments needed after the Tauri 2 swap: The build-desktop-{linux,windows} `paths:` filters previously fired only on `desktop/src/**` and `desktop/Cargo.toml`. The migration introduced four more inputs that change what the binary actually links: `desktop/build.rs` (which now invokes `tauri_build::build()`), `desktop/tauri.conf.json` (the source-of-truth config that `tauri::generate_context!()` reads at compile time), `desktop/capabilities/**` (the ACL surface that tauri-build folds into the binary), and `desktop/icons/**` (the default icon set required by `generate_context!()` and the Windows resource embedding step). Each is now part of the filter so an isolated change to any of them triggers a rebuild instead of silently shipping a stale binary. The Windows cross-compile needs `desktop/icons/icon.ico` in addition to the `icon.png` Linux relies on. `tauri-build` runs `embed-resource` to bake a Windows resource into the PE binary on `x86_64-pc-windows-gnu`, and that step hard-requires a real .ico. Without it the cross-compile fails with `icons/icon.ico not found; required for generating a Windows Resource file during tauri-build`. The .ico committed here is a multi-resolution (16/32/48/64/128/256) RGBA conversion of `desktop/icons/icon.png`, generated via `magick icon.png -define icon:auto-resize=... icon.ico`. Both Dockerfile comments updated to describe the Tauri 2 dependency surface (GTK 3 + WebKit2GTK 4.1 + libsoup 3 on Linux; mingw-w64 + windres + webview2-com on Windows) so future-me does not chase the wrong native deps. Verified locally: `docker buildx build -f ci-build/Dockerfile.desktop-linux .` produces a 15 MB x86_64 ELF and `docker buildx build -f ci-build/Dockerfile.desktop-windows .` produces a 22 MB x86_64 PE32+. Both unchanged in shape from the pre-migration Tao+Wry artifacts; CI extraction paths (`/build/target/release/lets-chat-desktop` and `/build/target/x86_64-pc-windows-gnu/release/lets-chat-desktop.exe`) still resolve. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>`just dev-desktop` was exiting with `Gtk-WARNING: cannot open display: :0` because the compose stack forwarded `DISPLAY` but never carried the X11 auth state into the container, so the X server rejected the connection before Tauri's GTK init could open a window. The wrapper script at `dev/cargo-desktop` had been doing this correctly for ad-hoc `cargo run`, so the gap was specific to the compose path. Two-sided fix: The `just dev-desktop` recipe now defaults `XAUTHORITY` to `$HOME/.Xauthority`, touches the file to make sure docker can bind-mount it (a bind mount of a missing host path silently turns into an empty directory that then masks the real cookie file forever), and runs `xhost +SI:localuser:$(id -un)` when an X server is available. The xhost grant is what unblocks GTK on the typical desktop setup; the cookie mount is the belt-and-braces path for environments where xhost is not installed. `compose.dev-desktop.yml` now passes `XAUTHORITY` through, mounts the cookie file at the same path inside the container, and stops defaulting `DISPLAY` to `:0`. The `:0` default was actively harmful on Wayland-only sessions: the container would try X first, fail, and exit before GTK ever consulted `WAYLAND_DISPLAY`. With `DISPLAY: ${DISPLAY:-}` an unset host DISPLAY stays unset in the container and GTK falls straight through to the Wayland socket (which the existing `${XDG_RUNTIME_DIR}` mount already exposes). The compose comment block is refreshed to mention Tauri 2 and to explain the recipe-and-compose split: compose has no `if` construct, so the auth-bootstrap work has to live in the justfile recipe and compose just consumes the resulting state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>