@@ -3,10 +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 attempt — try using mcpp.exe to build itself (via LLVM).
7- # Currently blocked by Clang on Windows lacking import std support.
8- # Falls back to xmake bootstrap binary for packaging.
9- # Step 4: Package into a distributable zip (same layout as Linux/macOS).
6+ # Step 3: Self-host — use the bootstrapped mcpp.exe to build itself (LLVM + MSVC STL).
7+ # Step 4: Package the self-hosted binary into a distributable zip.
108
119on :
1210 push :
@@ -276,25 +274,20 @@ jobs:
276274 ls "$MCPP_XPKGS/xim-x-llvm/20.1.7/bin/" | head -5
277275 fi
278276
279- "$MCPP_EXE" build && SELF_HOST_OK=1 || SELF_HOST_OK=0
280-
281- if [ "$SELF_HOST_OK" = "1" ]; then
282- # Find the self-hosted binary
283- SELF_MCPP=$(find target -name "mcpp.exe" -path "*/bin/*" | head -1)
284- if [ -n "$SELF_MCPP" ]; then
285- SELF_MCPP=$(cd "$(dirname "$SELF_MCPP")" && pwd)/$(basename "$SELF_MCPP")
286- echo "Self-hosted binary: $SELF_MCPP"
287- "$SELF_MCPP" --version
288- echo "MCPP_SELF=$SELF_MCPP" >> "$GITHUB_ENV"
289- else
290- echo "::warning::self-host build succeeded but mcpp.exe not found in target/"
291- SELF_HOST_OK=0
292- fi
293- fi
277+ "$MCPP_EXE" build
294278
295- if [ "$SELF_HOST_OK" = "0" ]; then
296- echo "::warning::Self-host build not yet possible (Clang on Windows lacks import std support). Using xmake bootstrap binary."
297- fi
279+ # Find the self-hosted binary
280+ SELF_MCPP=$(find target -name "mcpp.exe" -path "*/bin/*" | head -1)
281+ test -n "$SELF_MCPP" || {
282+ echo "FAIL: self-host build did not produce mcpp.exe"
283+ find target -name "*.exe" 2>/dev/null
284+ exit 1
285+ }
286+ SELF_MCPP=$(cd "$(dirname "$SELF_MCPP")" && pwd)/$(basename "$SELF_MCPP")
287+ echo "Self-hosted binary: $SELF_MCPP"
288+ "$SELF_MCPP" --version
289+
290+ echo "MCPP_SELF=$SELF_MCPP" >> "$GITHUB_ENV"
298291
299292 - name : Package Windows release zip
300293 id : package
@@ -311,10 +304,9 @@ jobs:
311304 mkdir -p "$STAGING/$WRAPPER/bin"
312305 mkdir -p "$STAGING/$WRAPPER/registry/bin"
313306
314- # Binary: prefer self-hosted build, fall back to saved bootstrap copy
315- MCPP_BIN="${MCPP_SELF:-/tmp/mcpp-bootstrap/mcpp.exe}"
316- echo "Packaging binary: $MCPP_BIN"
317- cp "$MCPP_BIN" "$STAGING/$WRAPPER/bin/mcpp.exe"
307+ # Binary: use the self-hosted build
308+ echo "Packaging binary: $MCPP_SELF"
309+ cp "$MCPP_SELF" "$STAGING/$WRAPPER/bin/mcpp.exe"
318310
319311 # Launcher batch script (equivalent to the shell wrapper on Linux/macOS)
320312 printf '@echo off\r\n"%%~dp0bin\\mcpp.exe" %%*\r\n' > "$STAGING/$WRAPPER/mcpp.bat"
0 commit comments