Commit graph

2 commits

Author SHA1 Message Date
Pascal André
547398c482
build(tauri): update to Tauri 2.12 and keep its crates current (#1320)
## Summary

Updates the Tauri desktop host from 2.10 to the current 2.12 release.
The crate family (tauri, tauri-build, tauri-runtime-wry, wry, tao and
the plugins) and `@tauri-apps/*` are aligned; the exact versions are in
`packages/tauri-app/Cargo.toml`, `Cargo.lock` and the `package.json`
files. `Cargo.toml` minimums now equal the qualified versions. Crates
that follow the updated family also move: webview2-com (was pinned
exactly) and windows-core with Wry, rfd with the dialog plugin.

A Dependabot `cargo` entry for `/packages/tauri-app` now proposes Tauri
crate updates weekly against `dev`. It allows `tauri`, `tauri-build`,
`tauri-plugin-*`, `tauri-runtime*` (including the refcount test
fixture's direct requirements) and `wry` (lock-only); minor and patch
updates arrive grouped, each major separately. Tao is excluded, because
it is vendored and patched. A new check fails a PR whose lock no longer
resolves a vendored copy, so an update can't silently drop the local
fixes.

## Changes that apply

- **tauri-macros 2.7, second hidden macro per command:**
`client_state.rs` re-exports commands explicitly and now also re-exports
the new names.
- **Tao 0.37, logout exit:** Tao calls `std::process::exit(0)` when its
hidden window receives `WM_ENDSESSION`. Windows can deliver it there
before our window, which would skip the logout flush. Session-end
handling moved to `windows_session_end.rs` and is installed on Tao's
hidden window too, so client state is flushed and the backend stopped
before Tao exits.
- **Tauri 2.12.2, macOS restart through `open -n`:** that path drops the
environment, so a launch pinned with `CODENOMAD_PROFILE` or `CLI_CONFIG`
would restart in another profile after a developer-mode, profile or
update restart. The macOS restart now launches the bundle's executable
directly at the same point (`macos_relaunch.rs`), keeping the
environment. Like Tauri's own fallback, it takes the executable name
from `Info.plist` (`CFBundleExecutable`), so an update that renames the
executable still restarts. It uses the current binary outside a bundle
or when that value is missing or unsafe.
- **Tao 0.36, IME rewrite:** the IME scenario of the input-deadlock
regression no longer applies and is removed.
- **Tauri 2.11, macOS renderer termination:** when the app registers no
`on_web_content_process_terminate` hook, as here, the runtime reloads a
crashed macOS renderer itself. The reload goes through the page-load
path, which resets the badge count; `NOTIFICATION_BADGES.md` and
`notification_badge_lifetime.rs` describe this. The notification
plugin's Windows permission fix needs no change here.

The other 2.11–2.12 changes (ACL and scope fixes, `on_new_window`
threading, window creation from other threads, asset protocol, updater
`allowDowngrades` and stricter signature checks, fs plugin fixes) were
checked and don't affect this code.

## Vendored crates

- **tao:** the upstream releases now include the input-deadlock fix
(tao#1215) and the macOS zoom fix (tao#1182), so those backports are
gone. The Windows runner refcount correction is still needed
(tauri#15408 open, tao#1290/#1334 declined), so it is re-applied to the
new Tao with its SHA-256 and patch. Its negative control still crashes;
the corrected build passes 5/5.
- **tauri-plugin-updater:** the new release still releases client state
before `ShellExecuteW`, so the success-only handoff is re-applied. Cargo
can't test a patched crate with dev-dependencies, so CI's `cargo test -p
tauri-plugin-updater` step is replaced by
`scripts/test-tauri-updater-handoff.mjs`, which tests a temporary copy
with the crate's own lockfile.
- `packages/tauri-app/scripts/vendored-patches.test.mjs` (CI Linux job)
fails when `Cargo.lock` no longer resolves a vendored copy. The
regression scripts read the vendored Tao version from `cargo metadata`.
The input-deadlock and macOS window negative controls pin the last
unfixed Tao; the runner-refcount negative control reverts the counter in
a temporary copy of the vendored Tao.

## Docs

`dev-docs/RUNTIME_MAINTENANCE.md` (Dependabot for the Tauri crates,
re-qualifying vendored crates, system-managed
WebView2/WKWebView/WebKitGTK, `@tauri-apps/*` kept on the crates'
minor), `TAURI_UPDATER.md`, `DESKTOP_DATA_PROFILES.md`,
`NOTIFICATION_BADGES.md` and `vendor/README.md`. `docs/help` is
unchanged; nothing user-facing changes.

## Validation

- **Windows:**
- `cargo check --workspace --all-targets`, and `cargo test --locked --
--test-threads=1` in `src-tauri`: 313 pass, including the CLI-signed
updater download and tamper rejection.
- Input deadlock: 4/4 reproduced on the old Tao, 4/4 pass on the new
one. Refcount: reproduced, then 5/5 pass. Updater handoff and zoom
(17/17) pass.
  - Packaging invariants 27/27; UI and root typechecks clean.
- The release `npm run build` produces the NSIS installer, and
`smoke:resources` passes.
- Hidden smoke: the release executable ran on a separate, never-shown
desktop with its own profile. It reached ready, and a simulated logout
flushed client state, stopped the backend and exited 0.
- **Ubuntu 24.04 VM:** `cargo test` 303 pass. The CI-style AppImage
launches, renders the UI, and on close stops the backend and unmounts
cleanly.
- **macOS Intel VM:** `cargo test` 302 pass, including the `Info.plist`
relaunch resolution tests; the window regression and its negative
control pass.
- **Not run end to end:** a real Windows logout, a signed-installer
update, and a packaged macOS restart (the restart is unit-tested). Apple
Silicon is covered by CI only.
2026-11-06 23:05:59 +01:00
Pascal André
89db55d340
fix(tauri): prevent Windows input reentrancy deadlocks (#773)
Backport upstream tao#1215 unchanged onto Tao 0.34.6 to correct the same-thread native input mutex deadlock identified in a symbolized Windows hang dump. Preserve the existing Tauri dependency/API line, all non-Windows sources, licensing and exact published-crate/patch provenance through a workspace Cargo override.

Add real isolated Win32 reentry regressions for keydown, keyup, character, system-character and IME input. Original-crate controls reproduce bounded deadlocks; the backport passes all five cases. Independently cover the IME lock boundary with temporary-source instrumentation and require an IME-only lock-order mutation to fail, preventing keyboard pre-peeking from masking an IME regression.

Independent gatekeeper pass 1 identified the IME coverage gap; pass 2 on 462f9eac reports zero actionable findings and independently reran all controls. Full local Tauri tests passed 181/181. Administrator squash merge requested by the user; remaining CI jobs were still running at merge.
2026-09-24 21:02:20 +02:00