Files
codewhale/crates
Hunter Bown 383ed44fe8 fix(child_env): preserve MSVC toolchain vars for Windows exec_shell
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 finds `link.exe` via `PATH` but the linker can't resolve
`kernel32.lib` / `ucrt.lib` because LIB and the SDK roots were
filtered out. Any model-driven `cargo build` from 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 / VISUALSTUDIOVERSION

Also extends the `mcp_env_allowlist_inherits_base_keys` fixture and
adds `sanitized_child_env_preserves_windows_toolchain_vars` as a
regression test (locked under `env_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
2026-05-11 23:19:44 -05:00
..
2026-05-11 23:07:02 -05:00
2026-05-11 23:07:02 -05:00
2026-05-11 23:07:02 -05:00
2026-05-11 23:07:02 -05:00
2026-05-11 23:07:02 -05:00
2026-05-11 23:07:02 -05:00
2026-05-11 23:07:02 -05:00
2026-05-11 23:07:02 -05:00