Repository navigation
fix(ci): Windows 目标 clippy 不再编译自带的 SQLite,补上停摆期间漏检的告警 (Refs 1lck/Lithe-IDEA#2231) - #170
Merged
Merged
Conversation
…e-IDEA#2231) #154 给 lithe-remote 加了 motty(bundled rusqlite),lithe-workspace 默认 打开它。从那以后,“Lint for Windows” 在 Linux runner 上编译 SQLite 的 C 源码时找不到 MSVC 的 lib.exe,所有 PR 的 Rust Core / Linux 和 gate 都失败。 - 这个步骤加 LIBSQLITE3_SYS_USE_PKG_CONFIG=1:libsqlite3-sys 只复制预生成 绑定、输出链接指令,不编译 C 源码。clippy 不链接,检查结果不变。 - 步骤停摆期间漏进来的告警:ssh_configuration 测试里只给 Unix 测试用的 Directory::write、lines、DEFAULTS 加 #[cfg(unix)]。 - CONTRIBUTING 的本地 Windows clippy 命令同样加上这个变量。
xiaoyumuxi
marked this pull request as ready for review
November 22, 2026 05:29
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
Refs 1lck/Lithe-IDEA#2231(远程开发完整设计)。#154 引入 Motty 导入后,所有 Core PR 的
Rust Core / Linux都在 “Lint for Windows” 步骤失败,Rust Core gate也跟着失败(例如 #169 的 run 44987781337)。这个 PR 修复这个步骤,并修掉它停摆期间漏检的 Windows clippy 错误。类型
原因
feat(remote): 连接窗口的地址解析、搜索、导入、ssh -G 生效值和连接阶段(#2231) #154 给
lithe-remote加了motty功能(rusqlite,打开bundled),lithe-workspace默认打开它。从这时起,“Lint for Windows” 选中的 crate 包含lithe-workspace(选择结果变成--workspace)。从 2026-11-21 起,每个 PR 都在这一步编译libsqlite3-sys。bundled要用 cc 编译 SQLite 的 C 源码,目标x86_64-pc-windows-msvc需要 MSVC 的cl.exe和lib.exe,Linux runner 上没有,所以报错:这一步在依赖编译阶段就失败了,后面的 clippy 一次都没有跑到,Windows 目标的告警因此漏了进来:
crates/workspace/src/ssh_configuration/tests.rs里的Directory::write、lines、DEFAULTS只被#[cfg(unix)]的测试使用,在 Windows 上是死代码(-D dead-code)。改动说明
.github/workflows/rust-core.ymlLIBSQLITE3_SYS_USE_PKG_CONFIG=1,没有新增步骤。设了这个变量,libsqlite3-sys的构建脚本就改走“链接系统库”的分支:只复制它自带的预生成绑定(和 bundled 时用的是同一份),只输出链接指令,不编译 C 源码。clippy 只做检查、不链接,所以检查范围和结果都不变。rust/crates/workspace/src/ssh_configuration/tests.rsDirectory::write、lines、DEFAULTS加上#[cfg(unix)],和用到它们的测试一致。这些测试运行的fake_ssh是 shell 脚本,只能在 Unix 上跑。CONTRIBUTING.md产品构建不受影响:桌面端 Core 在 Windows 上仍然编译并静态链接自带的 SQLite。这个变量只设在 CI 的 lint 步骤,以及文档里的本地检查命令中。
验证
LIBSQLITE3_SYS_USE_PKG_CONFIG=1 cargo clippy --locked --keep-going --manifest-path rust/Cargo.toml --workspace --all-targets --target x86_64-pc-windows-msvc -- -D warnings通过。改测试之前,只有上面 3 个lithe-workspace错误。cargo fmt --all -- --check通过。scripts/rust-core/verify-rust-core-comments.sh workspace通过。cargo clippy -p lithe-workspace --all-targets --all-features -- -D warnings通过。cargo test -p lithe-workspace ssh_configuration:8 个测试通过。rust:1.100.0,arm64 原生):在同一份源码上对lithe-remote --features motty跑 Windows 目标 clippy。不设变量时退出码 101,报libsqlite3-sys@0.30.1: GNU compiler is not supported for this target,和 CI 一样;设了变量退出码 0。Rust Core / Linux的结果。