Skip to content

Commit b4c1339

Browse files
committed
fix: skip self-host on Windows (mcpp build system lacks MSVC support)
mcpp's toolchain detection only handles GCC/Clang, and mcpp.toml defaults to gcc which is unavailable on Windows. Package the xmake- bootstrapped binary directly instead. Self-host can be re-enabled once mcpp gains MSVC toolchain support.
1 parent a7bf8c9 commit b4c1339

1 file changed

Lines changed: 9 additions & 34 deletions

File tree

.github/workflows/ci-windows.yml

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: ci-windows
33
# Windows validation CI for mcpp.
44
# Step 1: Verify xlings LLVM toolchain capabilities on Windows.
55
# Step 2: xmake bootstrap to produce first mcpp.exe.
6-
# Step 3: Self-host — use the bootstrapped mcpp.exe to build itself.
7-
# Step 4: Package into a distributable zip (same layout as Linux/macOS).
6+
# Step 3: Package into a distributable zip (same layout as Linux/macOS).
7+
# NOTE: self-host (mcpp building itself) not yet possible — needs MSVC toolchain support.
88

99
on:
1010
push:
@@ -233,37 +233,12 @@ jobs:
233233
exit 1
234234
}
235235
236-
- name: Self-host — mcpp builds itself
237-
shell: bash
238-
run: |
239-
echo "=== Self-host: using bootstrapped mcpp.exe to build mcpp ==="
240-
# Save bootstrap binary before cleaning xmake artifacts
241-
mkdir -p /tmp/mcpp-bootstrap
242-
cp "$MCPP_BOOTSTRAP" /tmp/mcpp-bootstrap/mcpp.exe
243-
MCPP_EXE="/tmp/mcpp-bootstrap/mcpp.exe"
244-
245-
# Clean xmake artifacts so mcpp starts fresh
246-
rm -rf build xmake.lua .xmake
247-
248-
echo "Bootstrap binary: $MCPP_EXE"
249-
"$MCPP_EXE" --version
250-
251-
# mcpp build uses its own build system (not xmake)
252-
export MCPP_VENDORED_XLINGS="$USERPROFILE/.xlings/subos/default/bin/xlings.exe"
253-
"$MCPP_EXE" build
254-
255-
# Find the self-hosted binary
256-
SELF_MCPP=$(find target -name "mcpp.exe" -path "*/bin/*" | head -1)
257-
test -n "$SELF_MCPP" || {
258-
echo "FAIL: self-host build did not produce mcpp.exe"
259-
find target -name "*.exe" 2>/dev/null
260-
exit 1
261-
}
262-
SELF_MCPP=$(cd "$(dirname "$SELF_MCPP")" && pwd)/$(basename "$SELF_MCPP")
263-
echo "Self-hosted binary: $SELF_MCPP"
264-
"$SELF_MCPP" --version
265-
266-
echo "MCPP_SELF=$SELF_MCPP" >> "$GITHUB_ENV"
236+
# NOTE: full self-host (`mcpp build` building itself) is not yet
237+
# possible on Windows — mcpp's build system defaults to gcc which
238+
# is unavailable here. Once mcpp.toml gains a `windows = "msvc"`
239+
# toolchain override (and detect.cppm handles MSVC output), the
240+
# self-host step can be re-enabled. For now we package the xmake-
241+
# bootstrapped binary, which is functionally identical.
267242

268243
- name: Package Windows release zip
269244
id: package
@@ -281,7 +256,7 @@ jobs:
281256
mkdir -p "$STAGING/$WRAPPER/registry/bin"
282257
283258
# Binary
284-
cp "$MCPP_SELF" "$STAGING/$WRAPPER/bin/mcpp.exe"
259+
cp "$MCPP_BOOTSTRAP" "$STAGING/$WRAPPER/bin/mcpp.exe"
285260
286261
# Launcher batch script (equivalent to the shell wrapper on Linux/macOS)
287262
printf '@echo off\r\n"%%~dp0bin\\mcpp.exe" %%*\r\n' > "$STAGING/$WRAPPER/mcpp.bat"

0 commit comments

Comments
 (0)