Skip to content

chore(deps): align the Tauri npm and Rust crates on 2.12.1 - #261

Merged
LIUBINfighter merged 1 commit into
devfrom
fix/tauri-version-alignment
Oct 3, 2026
Merged

LIUBINfighter merged 1 commit into
devfrom
fix/tauri-version-alignment

Conversation

@LIUBINfighter

Copy link
Copy Markdown
Owner

Why

Supersedes #256.

Dependabot bumped only the npm side to @tauri-apps/api@2.11.1, so the desktop build failed the CLI's own version gate:

Error Found version mismatched Tauri packages:
tauri (v2.10.3) : @tauri-apps/api (v2.11.1)

The Rust crate was still resolved at 2.10.3, and the Tauri CLI refuses to build when the JS API and the Rust crate disagree on major/minor. Pushing the Rust side up by exactly one minor does not avoid the churn either: both tauri 2.11.x and tauri 2.12.x pull wry 0.57, so this PR moves the whole stack to the current stable release instead of parking on an intermediate version.

Changes

  • package.json: @tauri-apps/api ^2.12.1, @tauri-apps/cli ^2.12.1
  • src-tauri/Cargo.toml: tauri floor "2.12", tauri-build floor "2.7" (bumping the floors keeps a future cargo update from silently walking the crate back below the JS API line)
  • src-tauri/Cargo.lock and pnpm-lock.yaml regenerated for exactly those versions

Transitive Rust movement is what the crates themselves require: tauri 2.12.1, tauri-runtime(-wry) 2.12.1, tauri-utils 2.10.1, tauri-build / tauri-codegen / tauri-macros 2.7.1, wry 0.57.0, tao 0.37.1, tray-icon 0.24.2, window-vibrancy 0.8.1. No unrelated dependency was re-resolved: the lockfile diff contains only Tauri entries.

Verification

Run in this worktree:

  • pnpm check — format / lint / type-check clean
  • pnpm test — 215 passed
  • pnpm verify:tauri — web build, cargo check, bundle thresholds, cargo test (27 Rust tests), Tauri security config check
  • pnpm build:tauri:ci — full unsigned release build and DMG/app bundling succeeded locally; the CLI version gate no longer reports a mismatch

Follow-up

The 2.10 to 2.12 jump carries wry 0.54 -> 0.57, so the WKWebView behaviours documented in docs/dev/reports/WKWEBVIEW_AUDIO_SLEEP_DIAGNOSIS.md and docs/dev/reports/PRINT_BLANK_PAGE.md (background throttling, print pagination) deserve a manual pass on a real macOS build. Those fixes are JS/CSS/tauri.conf.json level and are unchanged by this PR.

Closes #256

The @tauri-apps/api bump to 2.11.1 in #256 failed the desktop build because
the Rust `tauri` crate was still resolved at 2.10.3 and the CLI refuses to
build when the JS API and the Rust crate disagree on major/minor:

    tauri (v2.10.3) : @tauri-apps/api (v2.11.1)

Move the whole stack forward together instead of only the npm side:

- package.json: @tauri-apps/api ^2.12.1, @tauri-apps/cli ^2.12.1
- src-tauri/Cargo.toml: tauri "2.12", tauri-build "2.7" floors
- Cargo.lock / pnpm-lock.yaml regenerated for the same versions

Verified with pnpm check, pnpm test (215 passed), pnpm verify:tauri and a
local pnpm build:tauri:ci (release bundle, unsigned).
@LIUBINfighter
LIUBINfighter merged commit a12fbe8 into dev Oct 3, 2026
5 of 6 checks passed
LIUBINfighter added a commit that referenced this pull request Oct 3, 2026
…263)

CI on #261 failed once with

    tests::delete_file_repo_trash_rejects_paths_outside_the_repo_root
    left:  Some("No such file or directory (os error 2)")
    right: Some("path-outside-workspace")

and passed on rerun. The assertion is about path scope, so the error is reported
miles away from its cause: `delete_file` first canonicalizes the target, then
resolves the implicit default workspace root, and only then checks scope. The
ENOENT came out of that middle step.

`with_temp_home` replaces the process-global `HOME` for the duration of a test,
because Tauri resolves `app_data_dir()` straight from it. Nothing kept other
tests from reading `HOME` while it was replaced, so a test running concurrently
resolved its default workspace root inside another test's temporary home and then
raced the `fs::remove_dir_all` that deletes it. `create_dir_all` losing that race
reports `No such file or directory (os error 2)`, which is what the scope
assertion ended up printing.

Instrumenting the resolver showed 10 such misresolutions in a single test run,
so this was a race the suite hit often and only diagnosed rarely.

Fix the resolution instead of the timing:

- `default_save_dir` and `global_metadata_dir` now resolve through
  `test_resolved_home`, which prefers a thread-local override and otherwise uses
  the real home captured before any test replaced `HOME`. Nothing reads the
  mutable variable on the resolution path any more.
- `with_temp_home` still writes `HOME` (Tauri needs it) but also installs the
  thread-local override, so tests that do install it keep their private layout,
  and tests that do not are immune.
- `lock_home_env` ignores mutex poisoning, so one panicking test no longer turns
  every later test into a secondary failure.

`a_replaced_home_does_not_leak_into_path_resolution` pins the invariant and fails
against the previous resolution (`left: Some(".../tabst-tauri-test-foreign-home")`).

Test-support only; production resolution still goes straight to `home_dir()` and
`document_dir()`.

Verified: `cargo test` 28 passed, `cargo fmt --check`, `cargo check`,
`cargo clippy --all-targets` (no new warnings), `pnpm verify:tauri` end to end.
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