Observation
GalTranslPP on windows-2025 (Sunrisepeak/GalTranslPP#3), mcpp 2026.9.27.1, llvm@22.1.8 with msvc@system, mcpp:plugins 0.16.0 deps-vcpkg. On a build that installs the toolchain or a payload itself, the vcpkg install action fails:
Detecting compiler hash for triplet x64-windows...
error: while detecting compiler information:
The log file content at "...\bt\detect_compiler\stdout-x64-windows.log" is:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
The same vcpkg install command run outside mcpp succeeds. A second mcpp build, or a build after mcpp emit build-database installed the payloads in another process, succeeds.
Cause
On Windows, build_command_prefix (src/xlings/xlings.cppm) sets XLINGS_HOME and prepends the registry's shim directory to the process PATH:
mcpp::platform::env::set("XLINGS_HOME", env.home.string());
mcpp::platform::windows::prepend_path(xvmBin);
ScopedInvocationEnv restores only the scope variables. As its comment states, "XLINGS_HOME and the PATH prefix keep their process-wide lifetime". Each xlings invocation during provisioning therefore prepends <mcpp home>/registry/subos/default/bin once more; three copies were observed. ninja and every action started afterwards inherit this PATH.
That directory holds the shims xim:llvm registers on Windows:
cl for clang-cl;
link for lld-link;
lib for llvm-lib;
rc for llvm-rc.
vcpkg runs vcvarsall to detect MSVC for the host triplet, and that detection then meets these shims instead of MSVC's tools.
On POSIX the same values are part of the xlings command prefix and never reach the build.
Evidence
-
Environment of a build action. It was compared with the job's environment by an action running cmd /c set (run 36321504631). The action's PATH gains <mcpp home>\registry\data\xpkgs\xim-x-llvm\22.1.8\lib;<mcpp home>\registry\subos\default\bin (the second directory three times). The action also gets XLINGS_HOME=<mcpp home>\registry.
-
Isolation. A direct vcpkg install was run under each environment, 60 s each (run 36322488531):
| Environment |
Result |
| The job's environment |
Passes compiler detection |
The registry's shim directory in front of PATH |
Fails with the message above |
The XLINGS_* variables alone |
Passes |
The project's own SubOS bin in front of PATH |
Passes |
-
mcpp started directly. When provisioning is not part of the same process, compiler detection passes and the installation proceeds (run 36321827736).
Expected
The registry's shim directory and XLINGS_HOME reach the xlings child process only, as on POSIX. They should not reach the build.
Suggested direction
- Have
ScopedInvocationEnv save and restore PATH and XLINGS_HOME on Windows as well, so that build_command_prefix no longer changes the process.
- Alternatively, give the xlings child its environment directly.
Observation
GalTranslPP on
windows-2025(Sunrisepeak/GalTranslPP#3), mcpp 2026.9.27.1,llvm@22.1.8withmsvc@system, mcpp:plugins 0.16.0deps-vcpkg. On a build that installs the toolchain or a payload itself, thevcpkg installaction fails:The same
vcpkg installcommand run outside mcpp succeeds. A secondmcpp build, or a build aftermcpp emit build-databaseinstalled the payloads in another process, succeeds.Cause
On Windows,
build_command_prefix(src/xlings/xlings.cppm) setsXLINGS_HOMEand prepends the registry's shim directory to the processPATH:ScopedInvocationEnvrestores only the scope variables. As its comment states, "XLINGS_HOME and the PATH prefix keep their process-wide lifetime". Each xlings invocation during provisioning therefore prepends<mcpp home>/registry/subos/default/binonce more; three copies were observed. ninja and every action started afterwards inherit thisPATH.That directory holds the shims
xim:llvmregisters on Windows:clfor clang-cl;linkfor lld-link;libfor llvm-lib;rcfor llvm-rc.vcpkg runs vcvarsall to detect MSVC for the host triplet, and that detection then meets these shims instead of MSVC's tools.
On POSIX the same values are part of the xlings command prefix and never reach the build.
Evidence
Environment of a build action. It was compared with the job's environment by an action running
cmd /c set(run 36321504631). The action'sPATHgains<mcpp home>\registry\data\xpkgs\xim-x-llvm\22.1.8\lib;<mcpp home>\registry\subos\default\bin(the second directory three times). The action also getsXLINGS_HOME=<mcpp home>\registry.Isolation. A direct
vcpkg installwas run under each environment, 60 s each (run 36322488531):PATHXLINGS_*variables alonebinin front ofPATHmcpp started directly. When provisioning is not part of the same process, compiler detection passes and the installation proceeds (run 36321827736).
Expected
The registry's shim directory and
XLINGS_HOMEreach the xlings child process only, as on POSIX. They should not reach the build.Suggested direction
ScopedInvocationEnvsave and restorePATHandXLINGS_HOMEon Windows as well, so thatbuild_command_prefixno longer changes the process.