Skip to content

Commit 70360ec

Browse files
committed
fix: Windows xlings — drop cmd.exe redirections + debug self-host
Remove >nul/2>/dev/null redirections that break cmd.exe quote parsing. Don't shq() the binary path in build_command_prefix. Add debug output to self-host step (cygpath, xlings version).
1 parent 2f88075 commit 70360ec

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/ci-windows.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,16 @@ jobs:
250250
251251
# mcpp build uses its own build system; mcpp.toml now has
252252
# windows = "llvm@20.1.7" so it will use the xlings LLVM.
253-
export MCPP_VENDORED_XLINGS="$USERPROFILE/.xlings/subos/default/bin/xlings.exe"
253+
# Use Windows-native path for MCPP_VENDORED_XLINGS
254+
XLINGS_WIN=$(cygpath -w "$USERPROFILE/.xlings/subos/default/bin/xlings.exe")
255+
echo "MCPP_VENDORED_XLINGS=$XLINGS_WIN"
256+
export MCPP_VENDORED_XLINGS="$XLINGS_WIN"
257+
258+
echo "xlings exists: $(test -f "$USERPROFILE/.xlings/subos/default/bin/xlings.exe" && echo YES || echo NO)"
259+
260+
# Debug: test xlings directly
261+
"$USERPROFILE/.xlings/subos/default/bin/xlings.exe" --version || echo "xlings direct call failed"
262+
254263
"$MCPP_EXE" build
255264
256265
# Find the self-hosted binary

src/xlings.cppm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,8 @@ std::string build_command_prefix(const Env& env) {
436436
std::string newPath = xvmBin + ";" + (std::getenv("PATH") ? std::getenv("PATH") : "");
437437
_putenv_s("PATH", newPath.c_str());
438438
}
439-
return shq(env.binary.string());
439+
// Return raw path — no quoting to avoid cmd.exe double-quote parsing issues
440+
return env.binary.string();
440441
#else
441442
if (env.projectDir.empty()) {
442443
// Global mode: unset XLINGS_PROJECT_DIR (existing behavior).
@@ -463,7 +464,7 @@ std::string build_interface_command(const Env& env,
463464
std::string_view capability,
464465
std::string_view argsJson) {
465466
#if defined(_WIN32)
466-
return std::format("{} interface {} --args {} 2>nul",
467+
return std::format("{} interface {} --args {}",
467468
build_command_prefix(env), capability, shq(argsJson));
468469
#else
469470
return std::format("{} interface {} --args {} 2>/dev/null",
@@ -662,7 +663,7 @@ int install_with_progress(const Env& env, std::string_view target,
662663
#if defined(_WIN32)
663664
_putenv_s("XLINGS_HOME", env.home.string().c_str());
664665
_putenv_s("XLINGS_PROJECT_DIR", "");
665-
auto cmd = std::format("{} interface install_packages --args {} 2>nul",
666+
auto cmd = std::format("{} interface install_packages --args {}",
666667
shq(env.binary.string()),
667668
shq(argsJson));
668669
#else
@@ -792,8 +793,7 @@ void ensure_init(const Env& env, bool quiet) {
792793
#if defined(_WIN32)
793794
_putenv_s("XLINGS_HOME", env.home.string().c_str());
794795
_putenv_s("XLINGS_PROJECT_DIR", "");
795-
auto cmd = std::format("{} self init >nul 2>&1",
796-
shq(env.binary.string()));
796+
auto cmd = env.binary.string() + " self init";
797797
#else
798798
auto cmd = std::format(
799799
"cd {} && env -u XLINGS_PROJECT_DIR XLINGS_HOME={} {} self init >/dev/null 2>&1",

0 commit comments

Comments
 (0)