From 40efb4412dfa55ec495088bb3aac0abe70822818 Mon Sep 17 00:00:00 2001 From: yanghang <2390375302@qq.com> Date: Tue, 7 Jul 2026 20:00:53 +0800 Subject: [PATCH] fix(desktop): statically link MSVC CRT into the Windows exe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GenericAgent.exe linked the Universal CRT dynamically, so on stripped/older Windows images the shell itself could fail to load before the (already UCRT-bundled) embedded python ever ran. Enable +crt-static via a target-scoped .cargo/config.toml — macOS/Linux builds never read the x86_64-pc-windows-msvc section. Verified locally: built exe imports no api-ms-win-crt-*/vcruntime140/ucrtbase (kernel32 control present). --- frontends/desktop/src-tauri/.cargo/config.toml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 frontends/desktop/src-tauri/.cargo/config.toml diff --git a/frontends/desktop/src-tauri/.cargo/config.toml b/frontends/desktop/src-tauri/.cargo/config.toml new file mode 100644 index 00000000..28e3047d --- /dev/null +++ b/frontends/desktop/src-tauri/.cargo/config.toml @@ -0,0 +1,7 @@ +# Statically link the MSVC CRT (UCRT + vcruntime) into the Windows exe so the thin +# shell itself runs on systems lacking an in-box Universal CRT (stripped/older +# images) — no DLLs needed next to GenericAgent.exe. Target-scoped: macOS/Linux +# builds never read this section. The embedded python keeps its own app-local UCRT +# (copied in CI next to python.exe) for the bridge/conductor subprocesses. +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"]