Skip to content

fix(tauri): 锁 Rust crate ~2.10 修 npm/Rust 跨 minor mismatch#281

Merged
appergb merged 1 commit into
mainfrom
fix/tauri-version-pin
May 6, 2026
Merged

fix(tauri): 锁 Rust crate ~2.10 修 npm/Rust 跨 minor mismatch#281
appergb merged 1 commit into
mainfrom
fix/tauri-version-pin

Conversation

@appergb
Copy link
Copy Markdown
Collaborator

@appergb appergb commented May 6, 2026

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 没跑就被卡。

根因

  • `Cargo.toml`: `tauri = { version = "2" }` → cargo 拉到 latest 2.x = 2.11.0
  • npm `@tauri-apps/api` / `@tauri-apps/cli` latest 仍是 2.10.1(已经 `npm view` 验证 — Tauri 团队 Rust crate 发到 crates.io 2.11,npm 还没同步发 2.11)
  • `tauri build` 启动时校验 npm/Rust major+minor 一致,跨 minor 拒跑

修复

  • `Cargo.toml`: `tauri = "~2.10"` 限定 `>=2.10.0, <2.11.0`
  • `cargo update --precise` 把 `tauri` / `tauri-runtime` / `tauri-runtime-wry` 三件套锁到 2.10.3 / 2.10.1 / 2.10.1
  • 连带 wry 0.55.1→0.54.4、tray-icon 0.23.1→0.21.3 等 transitive 依赖回退(cargo 自动算的,没有手改)

后续

  • 等 Tauri 团队发 `@tauri-apps/api@2.11.x` 到 npm 后再放开 `~2.10`
  • 期间 `package-lock.json` 保持 2.10.1,CI `npm ci` 严格按 lock 装不会自动漂

Test plan

  • 本地 `cargo check` 通过
  • PR CI `Windows Tauri checks` + `pr_agent_job` 通过
  • 合并后 `workflow_dispatch release-tauri.yml` 4 平台全 build 成功

PR Type

Bug fix


Description

  • Pin tauri dependency from "2" to "~2.10" in Cargo.toml to align with npm packages still at 2.10.1

  • Resolve immediate CI build failures where Tauri rejected the minor version mismatch (Rust 2.11.0 vs npm 2.10.1)


File Walkthrough

Relevant files
Dependencies
Cargo.toml
Pin tauri to compatible minor version                                       

openless-all/app/src-tauri/Cargo.toml

  • Changed tauri version constraint from "2" to "~2.10"
  • Added comment documenting the temporary pin needed until npm packages
    release 2.11
+4/-1     

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\` 不会自动漂。
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@appergb appergb merged commit 284b75d into main May 6, 2026
2 checks passed
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 同款做法处理。
@appergb appergb deleted the fix/tauri-version-pin branch May 6, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant