Repository navigation
fix(desktop): 用 rust-toolchain.toml 固定构建 Rust 内核的 Rust 1.100.0 - #1959
Merged
Merged
Conversation
- 仓库根目录新增 rust-toolchain.toml(1.100.0)。build-desktop-core.sh 在本仓库 里用 --manifest-path 调用 cargo,rustup 按当前目录选工具链,所以由这份文件 决定编译器,与 Lithe-core-rust 固定的版本保持一致。 - desktop-ci、desktop-release、desktop-autobuild 的 dtolnay/rust-toolchain 从 @stable 改为 @1.100.0,与固定文件写同一个版本字符串,Windows GNU 等额外目标 装在同一个工具链上。 - 桌面端入门文档:Rust 版本改为固定的 1.100.0;Windows 的 GNU 目标改到克隆后 在仓库目录里安装;Intel 打包和常见问题里的 rustup 命令说明要在仓库目录里运行; GNU 主机工具链改用 rustup override set,rustup default 会被固定文件覆盖。
xiaoyumuxi
marked this pull request as ready for review
November 15, 2026 06:24
14 of 20 tasks
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.
关联 Issue / Linked issue
rust-toolchain.toml1.100.0,以及 clippy 1.100 的修复;已合入 Core main,提交 67a911a)PR 类型 / Type
改动说明 / What changes
背景 / Why
桌面端 CI 和发布工作流都用
dtolnay/rust-toolchain@stable编译 Rust 内核,开发者本机用的是各自的 rustup 默认版本。这样有两个问题:stable是 1.96.0,CI 是 1.100.0,本地编出的内核和 CI 不同。本 PR 用仓库根目录的
rust-toolchain.toml把版本固定到 1.100.0,与 Core #51 的固定版本一致。CI 现在用的stable本来就是 1.100.0,所以 CI 实际用的编译器不变,Core 构建缓存的 key 也不变。改动 / Changes
rust-toolchain.toml(新增):channel = "1.100.0"。rustup 按运行cargo时所在的目录选择工具链。scripts/desktop/build-desktop-core.sh是在本仓库里用--manifest-path调用 Core 检出的cargo,所以起作用的是本仓库这份文件,不是 Lithe-core-rust 里那份。文件注释写明它要和 Core 保持一致,以及工作流引用要写同一个版本字符串。工作流:5 处
dtolnay/rust-toolchain@stable改为@1.100.0。desktop-ci.yml:Linux、macOS、Windows(targets: x86_64-pc-windows-gnu)三条车道。desktop-release.yml:targets: ${{ matrix.rust-target }}。desktop-autobuild.yml:targets: ${{ matrix.rust-target }}。两处必须写成完全相同的字符串。rustup 把
1.100和1.100.0当作两个不同的工具链;写得不一致时,cargo会按固定文件另装一份 1.100.0,而这份不带工作流里配置的 Windows GNU、x86_64-apple-darwin 等目标。docs/development/desktop-getting-started.md:rust-toolchain.toml固定)”。rustup target add,升级之后还要重新添加一次。rustup default stable和rustup target add,改为克隆后在仓库目录里运行rustup toolchain install和rustup target add x86_64-pc-windows-gnu,再检查已安装的目标。rustup target add x86_64-apple-darwin。rustup default stable-x86_64-pc-windows-gnu会被固定文件覆盖,改为在仓库目录里运行rustup override set <版本>-x86_64-pc-windows-gnu。缺少 GNU 目标那一条也补上“在仓库目录里运行”和“升级后重新添加”。不在本 PR 范围内 / Out of scope
PINNED_CORE_REVISION不动。工具链版本和 Core 修订互不依赖,现在固定的 52c54e0 用 1.100.0 编译通过。Vet and test on Windows原本就是失败的(最近一次是 run 43682939259,提交 116a0b2),失败的都是 Go 测试,和 Rust 版本无关:TestHTMLPreviewSharedFixture(\\?\路径)、TestProcessesListsThisProcessAndItsChild、feat(desktop): 托管 tcpAnnounced 调试适配器 #1954 新增的 4 个TestDebugAnnounced*、TestMemoryDetailsShowTheSummaryOfTheWholeInstance。本 PR 不处理这些失败。rust-toolchain.toml和各自的工作流引用。步骤写在 Core 的CONTRIBUTING.md“工具链”一节(已随 Core Feat/windows/terminal sessions #51 合入)。类型专属:fix
复现与根因
stable浮动,新版本发布当天就可能让和改动无关的 PR 失败;本机和 CI 用的版本也不一致。在本仓库目录里,固定前rustc -V是本机默认的 1.96.0,固定后是 1.100.0。dtolnay/rust-toolchain@stable,仓库也没有rust-toolchain.toml。检查项
rustc -V和rustup show active-toolchain,应显示 1.100.0,并注明来自rust-toolchain.toml;运行scripts/desktop/build-desktop-core.sh --debug后,identity.txt中应为rustc=rustc 1.100.0。dtolnay/rust-toolchain(其他工作流不编译 Rust);build-desktop-core.sh不指定工具链,通过 rustup 读取固定文件;文档里的 rustup 命令只出现在desktop-getting-started.md;debug-windows-on-parallelsSkill 和其他 Skill、Agent Note 里没有rustup default、stable这类工具链说明。CONTRIBUTING.md“工具链”一节和两份rust-toolchain.toml的注释里。本仓库文档只写操作步骤,不另写一份 Note,免得出现会漂移的第二份规则。范围检查 / Scope checks
功能矩阵 / Feature matrix
N/A:只改构建工具链和开发文档,没有用户可见的能力变化,也不改变跨平台行为。
插件归属 / Plugin ownership
develop-lithe第三节的自查命令,结果为空(rg退出码 1)UI 验证 / UI evidence
N/A:界面没有变化。
统一日志系统 / Structured logging
N/A:没有新增或改动日志事件。
界面文案 / i18n
N/A:没有用户可见的文案变化。按 AGENTS.md 的要求,仍然运行了下面“验证”一节里的两项 i18n 检查,都通过。
逻辑归属 / Logic placement
N/A:没有业务逻辑改动。
性能与内存 / Performance and memory
N/A:CI 现在用的
stable就是 1.100.0,编译器没有变化,运行时也没有改动。设置 / Settings
N/A:不涉及设置。
插件契约 / Plugin contract
N/A:不改契约,也不改
PINNED_CORE_REVISION。发行包与资源 / Bundle and resources
N/A:没有新增运行时资源或下载资源。
identity.txt本来就记录 rustc 版本,worktree-resources.json也没有把 Core 构建状态登记为跨 worktree 复用,所以资源清单不用改。无用代码与重构 / Dead code and refactoring
验证 / Verification
desktop/里运行rustc -V、rustup show active-toolchainrustc 1.100.0 (0ef1bc386 2026-11-09),显示 overridden byrust-toolchain.toml;rustc +stable -V仍是本机的 1.96.0scripts/desktop/build-desktop-core.sh --debug(新 worktree,完整编译)identity.txt:core-revision=52c54e0…、core-source=pinned、rustc=rustc 1.100.0 (0ef1bc386 2026-11-09)、target=aarch64-apple-darwin、macos-deployment-target=13.0make -C desktop build.artifacts/desktop/bin/lithe,只有入门文档写明可以忽略的ignoring duplicate libraries警告;只编译,没有启动应用actionlint检查 3 个改动的工作流rg命令node scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --checkVet and test on Linux、Verify pins、Format and script tests通过;macOS、Windows 按 Draft 规则跳过Verify Platform Feature Matrix43684142351dtolnay/rust-toolchain的1.100.0分支rustc +"$toolchain",不受固定文件影响未能执行的检查和原因:
rustup toolchain install加rustup target add x86_64-pc-windows-gnu的新顺序。Windows 车道的 CI 会用@1.100.0安装同一个工具链和 GNU 目标,覆盖 CI 这条路径;Draft 阶段只跑 Linux,要到 ready 后才会跑 Windows 车道。提交前确认 / Final checks
preview(116a0b2bc)创建,目标分支为preview.build/、target/、dist/、.artifacts/等产物,没有凭据、个人路径或未脱敏的日志、截图