Skip to content

Commit 78529c9

Browse files
committed
fix: use original xlings binary (MCPP_VENDORED_XLINGS) on Windows
The copied xlings binary in the mcpp sandbox fails to install large packages (LLVM 148MB) — likely missing runtime dependencies that the original xlings has in its own subos structure. On Windows, when MCPP_VENDORED_XLINGS is set, use the original binary directly for xlings commands. XLINGS_HOME still points to the mcpp sandbox, keeping packages self-contained. Also keep the fallback copy from xlings global data in package_fetcher as defense-in-depth for cases without MCPP_VENDORED_XLINGS.
1 parent 53a7df4 commit 78529c9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/config.cppm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ struct GlobalConfig {
8484

8585
// Create an xlings::Env from the resolved GlobalConfig.
8686
mcpp::xlings::Env make_xlings_env(const GlobalConfig& cfg) {
87+
#if defined(_WIN32)
88+
// On Windows, the copied xlings binary in the sandbox may not function
89+
// correctly for large package installs (missing runtime environment).
90+
// When MCPP_VENDORED_XLINGS is set, use the original xlings binary
91+
// directly — it has the full xlings runtime. The XLINGS_HOME env var
92+
// ensures packages are installed into the mcpp sandbox.
93+
if (auto* e = std::getenv("MCPP_VENDORED_XLINGS"); e && *e) {
94+
std::filesystem::path vendored{e};
95+
if (std::filesystem::exists(vendored))
96+
return { vendored, cfg.xlingsHome() };
97+
}
98+
#endif
8799
return { cfg.xlingsBinary, cfg.xlingsHome() };
88100
}
89101

0 commit comments

Comments
 (0)