-
fix(child_env): preserve MSVC toolchain vars for Windows exec_shell
发布于
2026-05-12 04:19:44 +00:00 Harvested from PR #1487 by @Jianfengwu2024 — the rest of that PR
(the TriadMind architecture-governance crate) needs a Discussion-
level design conversation before it can land, but this Windows
env-allowlist fix is a clean independent improvement and stands on
its own.When the parent shell has already loaded VsDevCmd / vcvars (the
standard pattern for running Rust + MSVC on Windows),exec_shell
was stripping the toolchain env on its way to the child. The result:
the model findslink.exeviaPATHbut the linker can't resolve
kernel32.lib/ucrt.libbecause LIB and the SDK roots were
filtered out. Any model-drivencargo buildfrom inside the TUI
silently broke on Windows installs that don't run inside a Developer
Command Prompt.Adds 13 MSVC-related env vars to the
is_allowed_parent_env_key
allowlist so they survive the sanitization pass:LIB / LIBPATH / INCLUDE
VSINSTALLDIR / VCINSTALLDIR / VCTOOLSINSTALLDIR
WINDOWSSDKDIR / WINDOWSSDKVERSION
UNIVERSALCRTSDKDIR / UCRTVERSION
EXTENSIONSDKDIR / DEVENVDIR / VISUALSTUDIOVERSIONAlso extends the
mcp_env_allowlist_inherits_base_keysfixture and
addssanitized_child_env_preserves_windows_toolchain_varsas a
regression test (locked underenv_lock()so it serialises with the
other env-mutating tests in the file).Pure additive — no non-Windows behaviour changes.
Harvested from PR #1487 by @Jianfengwu2024
下载附件