fix(desktop): statically link MSVC CRT into the Windows exe

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).
This commit is contained in:
yanghang committed 2026-07-07 20:00:53 +08:00
1 parent 86615d4f1e
commit 40efb4412d
1 file changed
+7
@@ -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"]