From b790a39c1f591fd4ccca61093ac7fb792e994dd5 Mon Sep 17 00:00:00 2001 From: oudecheng <13802883547@139.com> Date: Tue, 4 Aug 2026 07:58:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(cargo):=20=E4=BF=AE=E6=AD=A3=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=88=86=E7=B1=BB=E9=94=99=E8=AF=AF=EF=BC=8C=E5=B0=86?= =?UTF-8?q?=E8=B7=A8=E5=B9=B3=E5=8F=B0=E4=BE=9D=E8=B5=96=E7=A7=BB=E5=87=BA?= =?UTF-8?q?=20windows=20target=20=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rmcp/schemars/http/tower-http/rust-embed 均为跨平台 crate 且在源码中被无条件引用,错放在 [target.'cfg(windows)'.dependencies] 下导致 Linux 构建必然失败。仅 windows-sys 是真正的 Windows 专用依赖,保留在 target 段。 --- Cargo.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fb95a6c..2a5699d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,14 +59,6 @@ wechatbot = { path = "vendor/wechatbot" } encoding_rs = "0.8" libc = "0.2" gray_matter = { version = "0.2", default-features = false, features = ["yaml"] } - -[target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.59", features = [ - "Win32_System_Threading", - "Win32_System_Diagnostics_Debug", - "Win32_Foundation", - "Win32_System_Kernel", -] } # MCP (Model Context Protocol) support rmcp = { version = "1.7", features = [ "client", @@ -78,3 +70,11 @@ schemars = "1.0" http = "1" tower-http = { version = "0.6", features = ["fs"] } rust-embed = "8" + +[target.'cfg(windows)'.dependencies] +windows-sys = { version = "0.59", features = [ + "Win32_System_Threading", + "Win32_System_Diagnostics_Debug", + "Win32_Foundation", + "Win32_System_Kernel", +] }