fix(tauri): 锁 Rust crate ~2.10 修 npm/Rust 跨 minor mismatch#281
Merged
Conversation
CI release-tauri.yml 三平台 (mac arm64 / Windows / Linux) Build step 在
~10 秒内全部失败:
Found version mismatched Tauri packages.
tauri (v2.11.0) : @tauri-apps/api (v2.10.1)
根因:
- Cargo.toml 写 \`tauri = { version = "2" }\`,cargo 解析到 latest 2.x = 2.11.0
- npm \`@tauri-apps/api\` / \`@tauri-apps/cli\` latest 仍是 2.10.1(Tauri 团队
把 Rust crate 发到了 crates.io 2.11,但 npm 包还没同步发 2.11)
- tauri build 启动时校验 npm 与 Rust crate 必须 major+minor 一致,跨 minor
直接 fail——三平台都没机会跑到 bundle 阶段。
修复:
- Cargo.toml 把 \`tauri\` 锁成 \`~2.10\`,让 cargo 选 2.10.x patch 版本,
与 npm 端 2.10.1 对齐。
- cargo update 精确下调到 tauri 2.10.3 / tauri-runtime 2.10.1 /
tauri-runtime-wry 2.10.1(连带 wry 0.55.1→0.54.4 / tray-icon 0.23.1→0.21.3
等 transitive 依赖一并回退,让 lock 内部一致——这也是 Cargo.lock diff 大
的原因,所有改动都是 \`cargo update\` 自动算出来的,没有手改)。
等 Tauri 团队把 npm @tauri-apps/api 2.11 发布后,再放开 Cargo.toml 的
约束。期间 package-lock.json 保持 2.10.1,CI 走 \`npm ci\` 不会自动漂。
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
appergb
pushed a commit
that referenced
this pull request
May 6, 2026
Release run 25419948896 三平台 (Linux / Win / mac arm64) 都挂在
tauri build 启动检查:
Found version mismatched Tauri packages.
tauri (v2.10.3) : @tauri-apps/api (v2.11.0)
根因翻转:
- 之前 (PR #281) Rust crate 漂上 2.11 而 npm 没发,所以锁 ~2.10 把 Rust
拉下来。
- 这次 PR #286 加 @tauri-apps/plugin-dialog 时 npm 解析把
@tauri-apps/api 升到 2.11.0(plugin-dialog 依赖 ^2.11.0),
Rust 还锁 ~2.10 → 反向 mismatch。
修复:
- Cargo.toml 锁 ~2.11
- cargo update 让 tauri / tauri-runtime / tauri-runtime-wry 三件套都升到
2.11.0(连带 wry 0.54.4 → 0.55.1 等 transitive 依赖)。
后续如果 Tauri 团队再发 2.12 而 npm 滞后,回头看 PR #281 同款做法处理。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
现象
release-tauri.yml workflow_dispatch 在 main 上 (run 25414817901) 三平台 (mac arm64 / Windows / Linux) 一致在 `Build` step 10 秒内挂掉:
```
Found version mismatched Tauri packages.
tauri (v2.11.0) : @tauri-apps/api (v2.10.1)
```
mac x86_64 还在 queue 没跑就被卡。
根因
修复
后续
Test plan
PR Type
Bug fix
Description
Pin
tauridependency from"2"to"~2.10"in Cargo.toml to align with npm packages still at 2.10.1Resolve immediate CI build failures where Tauri rejected the minor version mismatch (Rust 2.11.0 vs npm 2.10.1)
File Walkthrough
Cargo.toml
Pin tauri to compatible minor versionopenless-all/app/src-tauri/Cargo.toml
tauriversion constraint from"2"to"~2.10"release 2.11