From 9f787ad5c865d45e886fd72a2b97d41c878c0f76 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Thu, 21 May 2026 23:38:48 +0800 Subject: [PATCH 01/12] ci: add fresh-install workflow for first-time user experience MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Validates the released mcpp binary via xlings on all platforms: - Linux: xlings install mcpp → mcpp build (self) → mcpp new → mcpp run + install LLVM → mcpp new → mcpp run (continue-on-error) - macOS: xlings install mcpp → mcpp build → mcpp new → mcpp run - Windows: xlings install mcpp → mcpp build → mcpp new → mcpp run No caches — simulates a clean machine. Catches issues like incomplete sysroot, stale cfg paths, missing xpkg dependencies. --- .github/workflows/ci-fresh-install.yml | 114 +++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 .github/workflows/ci-fresh-install.yml diff --git a/.github/workflows/ci-fresh-install.yml b/.github/workflows/ci-fresh-install.yml new file mode 100644 index 0000000..9eed8f7 --- /dev/null +++ b/.github/workflows/ci-fresh-install.yml @@ -0,0 +1,114 @@ +name: ci-fresh-install + +# Fresh install CI — tests the released mcpp via xlings on clean machines. +# Validates: xlings install mcpp → mcpp build (self) → mcpp new → mcpp run + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +concurrency: + group: ci-fresh-install-${{ github.ref }} + cancel-in-progress: true + +jobs: + linux-fresh: + name: Linux fresh install + runs-on: ubuntu-24.04 + timeout-minutes: 45 + steps: + - uses: actions/checkout@v4 + + - name: Install xlings + mcpp + env: + XLINGS_NON_INTERACTIVE: '1' + run: | + curl -fsSL https://github.com/d2learn/xlings/releases/download/v0.4.30/xlings-0.4.30-linux-x86_64.tar.gz | tar -xzf - -C /tmp + /tmp/xlings-0.4.30-linux-x86_64/subos/default/bin/xlings self install + export PATH="$HOME/.xlings/subos/default/bin:$PATH" + xlings install mcpp -y + echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH" + + - name: mcpp build (self-host) + run: mcpp build + + - name: mcpp new hello → mcpp run + run: | + cd "$(mktemp -d)" + mcpp new hello + cd hello + mcpp run + + - name: install LLVM → mcpp new → mcpp run + continue-on-error: true + run: | + mcpp self config --mirror GLOBAL + mcpp toolchain install llvm 20.1.7 + mcpp toolchain default llvm@20.1.7 + cd "$(mktemp -d)" + mcpp new hello_llvm + cd hello_llvm + mcpp run + + macos-fresh: + name: macOS fresh install + runs-on: macos-15 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + + - name: Install xlings + mcpp + env: + XLINGS_NON_INTERACTIVE: '1' + run: | + curl -fsSL https://github.com/d2learn/xlings/releases/download/v0.4.30/xlings-0.4.30-macosx-arm64.tar.gz | tar -xzf - -C /tmp + /tmp/xlings-0.4.30-macosx-arm64/subos/default/bin/xlings self install + export PATH="$HOME/.xlings/subos/default/bin:$PATH" + xlings install mcpp -y + echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH" + + - name: mcpp build (self-host) + run: mcpp build + + - name: mcpp new hello → mcpp run + run: | + cd "$(mktemp -d)" + mcpp new hello + cd hello + mcpp run + + windows-fresh: + name: Windows fresh install + runs-on: windows-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + + - name: Install xlings + mcpp + shell: pwsh + env: + XLINGS_NON_INTERACTIVE: '1' + run: | + Invoke-WebRequest -Uri "https://github.com/d2learn/xlings/releases/download/v0.4.30/xlings-0.4.30-windows-x86_64.zip" -OutFile "$env:TEMP\xlings.zip" + Expand-Archive -Path "$env:TEMP\xlings.zip" -DestinationPath "$env:TEMP\xlings-extract" -Force + & "$env:TEMP\xlings-extract\xlings-0.4.30-windows-x86_64\subos\default\bin\xlings.exe" self install + $xlingsbin = "$env:USERPROFILE\.xlings\subos\default\bin" + $env:PATH = "$xlingsbin;$env:PATH" + xlings install mcpp -y + $xlingsbin | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + + - name: mcpp build (self-host) + shell: pwsh + run: mcpp build + + - name: mcpp new hello → mcpp run + shell: pwsh + run: | + $tmp = New-TemporaryFile | ForEach-Object { Remove-Item $_; New-Item -ItemType Directory -Path $_ } + Set-Location $tmp + mcpp new hello + Set-Location hello + mcpp run From e36c924c338fefe772f2c78855d524ab78cc5e41 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 22 May 2026 00:16:47 +0800 Subject: [PATCH 02/12] ci: add Windows LLVM smoke test + ci-fresh-install workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Main CI changes: - ci-windows.yml: add explicit "Toolchain: LLVM — mcpp new → build → run" smoke test (previously only soft fallback via || true) - All three main CIs (ci.yml, ci-macos.yml, ci-windows.yml) no longer have continue-on-error fresh user tests (removed in PR #62) Toolchain coverage after this change: Linux: gcc@16.1.0 ✓ musl-gcc@15.1.0 ✓ llvm@20.1.7 ✓ macOS: llvm@20.1.7 ✓ (comprehensive module tests) Windows: llvm@20.1.7 ✓ (explicit smoke test) New workflow: - ci-fresh-install.yml: tests released mcpp via xlings on clean machines (no caches). Validates real first-time user experience separately from PR code testing. --- .github/workflows/ci-windows.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 90d5412..baaaa9b 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -108,7 +108,16 @@ jobs: "$MCPP_SELF" --version echo ":: Self-host smoke PASS" - # Fresh user experience test moved to ci-fresh-install.yml (PR #63) + - name: "Toolchain: LLVM — mcpp new → build → run" + shell: bash + run: | + export MCPP_VENDORED_XLINGS="$XLINGS_BIN" + "$MCPP_SELF" toolchain default llvm@20.1.7 + TMP=$(mktemp -d) + cd "$TMP" + "$MCPP_SELF" new hello_llvm + cd hello_llvm + "$MCPP_SELF" run - name: Package Windows release zip id: package From 826cd90ab770f23b072d25924c3e9863a9c979f4 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 22 May 2026 00:18:31 +0800 Subject: [PATCH 03/12] =?UTF-8?q?fix:=20ci.yml=20=E2=80=94=20install=20mus?= =?UTF-8?q?l-gcc=20before=20setting=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The musl-gcc test step assumed the toolchain was already cached. After cache clears, `toolchain default gcc@15.1.0-musl` fails with "not installed". Add explicit install before setting default. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e42abf9..3a779d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,6 +147,7 @@ jobs: - name: "Toolchain: musl-gcc — mcpp new → build → run" run: | MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)") + "$MCPP" toolchain install gcc 15.1.0-musl "$MCPP" toolchain default gcc@15.1.0-musl TMP=$(mktemp -d) cd "$TMP" From 97505d6a07bd6057fe0c50d33e0bb8dc13dea46b Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 22 May 2026 00:24:53 +0800 Subject: [PATCH 04/12] ci: toolchain smoke tests build mcpp itself, not hello world MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each toolchain now builds mcpp from source (self-host) instead of a trivial hello-world project. This validates that the toolchain can compile a real C++23 modules codebase. Coverage: Linux: gcc@16.1.0 builds mcpp ✓ musl-gcc@15.1.0 builds mcpp ✓ llvm@20.1.7 builds mcpp ✓ macOS: llvm@20.1.7 builds mcpp ✓ (default, in self-host smoke) Windows: llvm@20.1.7 builds mcpp ✓ (new step) --- .github/workflows/ci-windows.yml | 9 +++------ .github/workflows/ci.yml | 27 +++++++++------------------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index baaaa9b..68c626f 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -108,16 +108,13 @@ jobs: "$MCPP_SELF" --version echo ":: Self-host smoke PASS" - - name: "Toolchain: LLVM — mcpp new → build → run" + - name: "Toolchain: LLVM — build mcpp" shell: bash run: | export MCPP_VENDORED_XLINGS="$XLINGS_BIN" "$MCPP_SELF" toolchain default llvm@20.1.7 - TMP=$(mktemp -d) - cd "$TMP" - "$MCPP_SELF" new hello_llvm - cd hello_llvm - "$MCPP_SELF" run + "$MCPP_SELF" clean + "$MCPP_SELF" build - name: Package Windows release zip id: package diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a779d9..4119018 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,34 +134,25 @@ jobs: "$MCPP" build "$MCPP" test - - name: "Toolchain: GCC — mcpp new → build → run" + - name: "Toolchain: GCC — build mcpp" run: | MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)") "$MCPP" toolchain default gcc@16.1.0 - TMP=$(mktemp -d) - cd "$TMP" - "$MCPP" new hello_gcc - cd hello_gcc - "$MCPP" run + "$MCPP" clean + "$MCPP" build - - name: "Toolchain: musl-gcc — mcpp new → build → run" + - name: "Toolchain: musl-gcc — build mcpp" run: | MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)") "$MCPP" toolchain install gcc 15.1.0-musl "$MCPP" toolchain default gcc@15.1.0-musl - TMP=$(mktemp -d) - cd "$TMP" - "$MCPP" new hello_musl - cd hello_musl - "$MCPP" run + "$MCPP" clean + "$MCPP" build - - name: "Toolchain: LLVM — install + mcpp new → build → run" + - name: "Toolchain: LLVM — build mcpp" run: | MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)") "$MCPP" toolchain install llvm 20.1.7 "$MCPP" toolchain default llvm@20.1.7 - TMP=$(mktemp -d) - cd "$TMP" - "$MCPP" new hello_llvm - cd hello_llvm - "$MCPP" run + "$MCPP" clean + "$MCPP" build From 9144db3740cee91840061e9c77600b5d4d38c117 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 22 May 2026 00:26:05 +0800 Subject: [PATCH 05/12] ci: each platform's every toolchain builds mcpp itself MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge redundant self-host smoke steps into unified toolchain steps. Each supported toolchain per platform does: clean → build mcpp → verify. Linux: gcc@16.1.0 (+ test), musl-gcc@15.1.0, llvm@20.1.7 macOS: llvm@20.1.7 Windows: llvm@20.1.7 --- .github/workflows/ci-macos.yml | 8 +++----- .github/workflows/ci-windows.yml | 11 ++--------- .github/workflows/ci.yml | 9 ++------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index 6343b67..71d5bba 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -306,14 +306,12 @@ jobs: "$MCPP" toolchain default llvm@20.1.7 bash tests/e2e/run_all.sh - - name: Self-host smoke (freshly-built mcpp builds itself again) + - name: "Toolchain: LLVM — build mcpp (self-host)" run: | MCPP=$(find target -path "*/bin/mcpp" | head -1) MCPP=$(cd "$(dirname "$MCPP")" && pwd)/$(basename "$MCPP") test -x "$MCPP" - export PATH="$(dirname "$MCPP"):$PATH" + "$MCPP" toolchain default llvm@20.1.7 + "$MCPP" clean "$MCPP" build "$MCPP" --version - echo ":: Self-host smoke PASS" - - # Fresh user experience test moved to ci-fresh-install.yml (PR #63) diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 68c626f..5a0ae0a 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -100,21 +100,14 @@ jobs: "$MCPP_SELF" toolchain default llvm@20.1.7 2>/dev/null || true bash tests/e2e/run_all.sh - - name: Self-host smoke (freshly-built mcpp builds itself again) - shell: bash - run: | - export MCPP_VENDORED_XLINGS="$XLINGS_BIN" - "$MCPP_SELF" build - "$MCPP_SELF" --version - echo ":: Self-host smoke PASS" - - - name: "Toolchain: LLVM — build mcpp" + - name: "Toolchain: LLVM — build mcpp (self-host)" shell: bash run: | export MCPP_VENDORED_XLINGS="$XLINGS_BIN" "$MCPP_SELF" toolchain default llvm@20.1.7 "$MCPP_SELF" clean "$MCPP_SELF" build + "$MCPP_SELF" --version - name: Package Windows release zip id: package diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4119018..a551a42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,18 +128,13 @@ jobs: "$MCPP" toolchain default gcc@16.1.0 bash tests/e2e/run_all.sh - - name: Self-host smoke (freshly-built mcpp builds itself again) - run: | - MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)") - "$MCPP" build - "$MCPP" test - - - name: "Toolchain: GCC — build mcpp" + - name: "Toolchain: GCC — build mcpp + test" run: | MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)") "$MCPP" toolchain default gcc@16.1.0 "$MCPP" clean "$MCPP" build + "$MCPP" test - name: "Toolchain: musl-gcc — build mcpp" run: | From f0a2761b32c68adec75ebfe27dd4cfd7bde6db66 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 22 May 2026 00:27:45 +0800 Subject: [PATCH 06/12] =?UTF-8?q?ci:=20complete=20CI=20architecture=20?= =?UTF-8?q?=E2=80=94=20dev=20CI=20+=20release=20validation=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two-tier CI design: Tier 1 — PR/dev CI (ci.yml, ci-macos.yml, ci-windows.yml): Runs on every PR. Builds mcpp from source, runs tests + e2e, then verifies each platform's supported toolchains can build mcpp: Linux: gcc@16.1.0 (+test), musl-gcc@15.1.0, llvm@20.1.7 macOS: llvm@20.1.7 Windows: llvm@20.1.7 Tier 2 — Release validation CI (ci-fresh-install.yml): Manual trigger + daily schedule. Tests released mcpp via xlings on clean machines (no caches). For each platform, every supported toolchain: new → run (basic project) + build mcpp (self-host). Linux: gcc, musl-gcc, llvm — new+run + build mcpp macOS: llvm — new+run + build mcpp Windows: llvm — new+run + build mcpp ci-fresh-install no longer runs on PRs (it tests released mcpp, not PR code). Moved to workflow_dispatch + daily cron. --- .github/workflows/ci-fresh-install.yml | 102 ++++++++++++++++++------- 1 file changed, 74 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci-fresh-install.yml b/.github/workflows/ci-fresh-install.yml index 9eed8f7..01c13bd 100644 --- a/.github/workflows/ci-fresh-install.yml +++ b/.github/workflows/ci-fresh-install.yml @@ -1,24 +1,33 @@ name: ci-fresh-install -# Fresh install CI — tests the released mcpp via xlings on clean machines. -# Validates: xlings install mcpp → mcpp build (self) → mcpp new → mcpp run +# Fresh install CI — validates the released mcpp binary via xlings. +# Simulates a real first-time user on a clean machine (no caches). +# +# For each platform, tests every supported toolchain: +# 1. mcpp new hello → mcpp run (basic project) +# 2. mcpp build (build mcpp itself from source) +# +# This workflow does NOT run on PRs — it tests released mcpp, not PR code. +# Triggered manually or on a schedule to catch regressions after releases. on: - push: - branches: [ main ] - pull_request: - branches: [ main ] workflow_dispatch: + schedule: + # Run daily at 06:00 UTC to catch issues from xlings/runner updates + - cron: '0 6 * * *' concurrency: - group: ci-fresh-install-${{ github.ref }} + group: ci-fresh-install cancel-in-progress: true jobs: + # ────────────────────────────────────────────────────────────────── + # Linux: gcc@16.1.0, musl-gcc@15.1.0, llvm@20.1.7 + # ────────────────────────────────────────────────────────────────── linux-fresh: name: Linux fresh install runs-on: ubuntu-24.04 - timeout-minutes: 45 + timeout-minutes: 60 steps: - uses: actions/checkout@v4 @@ -31,19 +40,38 @@ jobs: export PATH="$HOME/.xlings/subos/default/bin:$PATH" xlings install mcpp -y echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH" + mcpp --version - - name: mcpp build (self-host) - run: mcpp build + - name: "GCC: mcpp new → run" + run: | + mcpp toolchain default gcc + cd "$(mktemp -d)" + mcpp new hello_gcc + cd hello_gcc + mcpp run + + - name: "GCC: build mcpp" + run: | + mcpp toolchain default gcc + mcpp clean + mcpp build - - name: mcpp new hello → mcpp run + - name: "musl-gcc: mcpp new → run" run: | + mcpp toolchain install gcc 15.1.0-musl + mcpp toolchain default gcc@15.1.0-musl cd "$(mktemp -d)" - mcpp new hello - cd hello + mcpp new hello_musl + cd hello_musl mcpp run - - name: install LLVM → mcpp new → mcpp run - continue-on-error: true + - name: "musl-gcc: build mcpp" + run: | + mcpp toolchain default gcc@15.1.0-musl + mcpp clean + mcpp build + + - name: "LLVM: mcpp new → run" run: | mcpp self config --mirror GLOBAL mcpp toolchain install llvm 20.1.7 @@ -53,6 +81,15 @@ jobs: cd hello_llvm mcpp run + - name: "LLVM: build mcpp" + run: | + mcpp toolchain default llvm@20.1.7 + mcpp clean + mcpp build + + # ────────────────────────────────────────────────────────────────── + # macOS: llvm@20.1.7 + # ────────────────────────────────────────────────────────────────── macos-fresh: name: macOS fresh install runs-on: macos-15 @@ -69,17 +106,23 @@ jobs: export PATH="$HOME/.xlings/subos/default/bin:$PATH" xlings install mcpp -y echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH" + mcpp --version - - name: mcpp build (self-host) - run: mcpp build - - - name: mcpp new hello → mcpp run + - name: "LLVM: mcpp new → run" run: | cd "$(mktemp -d)" - mcpp new hello - cd hello + mcpp new hello_mac + cd hello_mac mcpp run + - name: "LLVM: build mcpp" + run: | + mcpp clean + mcpp build + + # ────────────────────────────────────────────────────────────────── + # Windows: llvm@20.1.7 + MSVC STL + # ────────────────────────────────────────────────────────────────── windows-fresh: name: Windows fresh install runs-on: windows-latest @@ -99,16 +142,19 @@ jobs: $env:PATH = "$xlingsbin;$env:PATH" xlings install mcpp -y $xlingsbin | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + mcpp --version - - name: mcpp build (self-host) - shell: pwsh - run: mcpp build - - - name: mcpp new hello → mcpp run + - name: "LLVM: mcpp new → run" shell: pwsh run: | $tmp = New-TemporaryFile | ForEach-Object { Remove-Item $_; New-Item -ItemType Directory -Path $_ } Set-Location $tmp - mcpp new hello - Set-Location hello + mcpp new hello_win + Set-Location hello_win mcpp run + + - name: "LLVM: build mcpp" + shell: pwsh + run: | + mcpp clean + mcpp build From f5f0fe290285c2eb8d32a9fbd4fd81726515a79f Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 22 May 2026 00:30:21 +0800 Subject: [PATCH 07/12] ci: temporarily enable ci-fresh-install on PR for validation --- .github/workflows/ci-fresh-install.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-fresh-install.yml b/.github/workflows/ci-fresh-install.yml index 01c13bd..845a244 100644 --- a/.github/workflows/ci-fresh-install.yml +++ b/.github/workflows/ci-fresh-install.yml @@ -11,6 +11,10 @@ name: ci-fresh-install # Triggered manually or on a schedule to catch regressions after releases. on: + push: + branches: [ main ] + pull_request: + branches: [ main ] workflow_dispatch: schedule: # Run daily at 06:00 UTC to catch issues from xlings/runner updates From ddc38dc1e8235639246e6c1674823715a94c962d Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 22 May 2026 00:37:35 +0800 Subject: [PATCH 08/12] =?UTF-8?q?ci:=20ci-fresh-install=20=E2=80=94=20fix?= =?UTF-8?q?=20GCC=20version,=20remove=20PR=20trigger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GCC: don't set toolchain default (GCC is already default after xlings install mcpp), fixes "gcc@ is not installed" error - Remove pull_request trigger: ci-fresh-install tests released mcpp (not PR code), so it should not block PRs. Runs on push to main, workflow_dispatch, and daily schedule only. --- .github/workflows/ci-fresh-install.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-fresh-install.yml b/.github/workflows/ci-fresh-install.yml index 845a244..a40c60a 100644 --- a/.github/workflows/ci-fresh-install.yml +++ b/.github/workflows/ci-fresh-install.yml @@ -7,14 +7,13 @@ name: ci-fresh-install # 1. mcpp new hello → mcpp run (basic project) # 2. mcpp build (build mcpp itself from source) # -# This workflow does NOT run on PRs — it tests released mcpp, not PR code. -# Triggered manually or on a schedule to catch regressions after releases. +# This workflow tests released mcpp, not PR code. +# It does NOT run on PRs — only on push to main, manual trigger, and daily schedule. +# Failures here mean the released mcpp has issues, not that the PR is broken. on: push: branches: [ main ] - pull_request: - branches: [ main ] workflow_dispatch: schedule: # Run daily at 06:00 UTC to catch issues from xlings/runner updates @@ -48,7 +47,6 @@ jobs: - name: "GCC: mcpp new → run" run: | - mcpp toolchain default gcc cd "$(mktemp -d)" mcpp new hello_gcc cd hello_gcc @@ -56,7 +54,6 @@ jobs: - name: "GCC: build mcpp" run: | - mcpp toolchain default gcc mcpp clean mcpp build From 92efa9cd297ef5ec8aeb3f45a1d649da6f7bfefe Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 22 May 2026 00:53:04 +0800 Subject: [PATCH 09/12] fix: save mcpp binary before clean in toolchain smoke tests mcpp clean deletes target/ which contains the freshly-built binary. Copy it to /tmp before running clean so it survives. Also: clear Windows BMI cache (--bmi-cache) to avoid MSVC version mismatch errors from stale std.pcm. --- .github/workflows/ci-macos.yml | 2 ++ .github/workflows/ci-windows.yml | 10 ++++++---- .github/workflows/ci.yml | 9 ++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index 71d5bba..116f154 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -311,6 +311,8 @@ jobs: MCPP=$(find target -path "*/bin/mcpp" | head -1) MCPP=$(cd "$(dirname "$MCPP")" && pwd)/$(basename "$MCPP") test -x "$MCPP" + cp "$MCPP" /tmp/mcpp-fresh + MCPP=/tmp/mcpp-fresh "$MCPP" toolchain default llvm@20.1.7 "$MCPP" clean "$MCPP" build diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 5a0ae0a..875ada9 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -104,10 +104,12 @@ jobs: shell: bash run: | export MCPP_VENDORED_XLINGS="$XLINGS_BIN" - "$MCPP_SELF" toolchain default llvm@20.1.7 - "$MCPP_SELF" clean - "$MCPP_SELF" build - "$MCPP_SELF" --version + cp "$MCPP_SELF" /tmp/mcpp-fresh.exe + MCPP=/tmp/mcpp-fresh.exe + "$MCPP" toolchain default llvm@20.1.7 + "$MCPP" clean --bmi-cache + "$MCPP" build + "$MCPP" --version - name: Package Windows release zip id: package diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a551a42..66a0052 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,9 +128,14 @@ jobs: "$MCPP" toolchain default gcc@16.1.0 bash tests/e2e/run_all.sh - - name: "Toolchain: GCC — build mcpp + test" + - name: Save freshly-built mcpp for toolchain tests run: | MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)") + cp "$MCPP" /tmp/mcpp-fresh + echo "MCPP=/tmp/mcpp-fresh" >> "$GITHUB_ENV" + + - name: "Toolchain: GCC — build mcpp + test" + run: | "$MCPP" toolchain default gcc@16.1.0 "$MCPP" clean "$MCPP" build @@ -138,7 +143,6 @@ jobs: - name: "Toolchain: musl-gcc — build mcpp" run: | - MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)") "$MCPP" toolchain install gcc 15.1.0-musl "$MCPP" toolchain default gcc@15.1.0-musl "$MCPP" clean @@ -146,7 +150,6 @@ jobs: - name: "Toolchain: LLVM — build mcpp" run: | - MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)") "$MCPP" toolchain install llvm 20.1.7 "$MCPP" toolchain default llvm@20.1.7 "$MCPP" clean From e5c096819078c7f9bd4cfb0b5d13b394a0427702 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 22 May 2026 01:11:56 +0800 Subject: [PATCH 10/12] =?UTF-8?q?fix:=20Windows=20packaging=20=E2=80=94=20?= =?UTF-8?q?find=20mcpp.exe=20from=20target/=20instead=20of=20stale=20$MCPP?= =?UTF-8?q?=5FSELF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-windows.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 875ada9..25981b9 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -119,9 +119,12 @@ jobs: WRAPPER="mcpp-${VERSION}-windows-x86_64" ZIPNAME="${WRAPPER}.zip" + MCPP_BIN=$(find target -name "mcpp.exe" -path "*/bin/*" | head -1) + test -n "$MCPP_BIN" || { echo "FAIL: no mcpp.exe in target/"; exit 1; } + STAGING=$(mktemp -d) mkdir -p "$STAGING/$WRAPPER/bin" "$STAGING/$WRAPPER/registry/bin" - cp "$MCPP_SELF" "$STAGING/$WRAPPER/bin/mcpp.exe" + cp "$MCPP_BIN" "$STAGING/$WRAPPER/bin/mcpp.exe" printf '@echo off\r\n"%%~dp0bin\\mcpp.exe" %%*\r\n' > "$STAGING/$WRAPPER/mcpp.bat" cp README.md "$STAGING/$WRAPPER/" 2>/dev/null || true cp LICENSE "$STAGING/$WRAPPER/" 2>/dev/null || true From 6d36a812b07733394bbad9c1cac71ef890648e29 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 22 May 2026 06:49:17 +0800 Subject: [PATCH 11/12] fix: CI toolchain tests actually use correct toolchain + assertions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review findings addressed: 1. Linux musl/LLVM steps were NOT actually using those toolchains (mcpp.toml [toolchain].default overrides global default). Fix: - musl: use `mcpp build --target x86_64-linux-musl` - LLVM: sed-override mcpp.toml before build - All steps: grep assertion on "Resolved " output 2. Windows: remove `|| true` on critical config/default commands that silently swallowed failures. 3. Windows: add explicit `mcpp new hello → mcpp run` smoke test (covers first-run user path that E2E skips due to missing fresh-sandbox capability). 4. All toolchain build steps: assert via grep that the expected toolchain was actually resolved. --- .github/workflows/ci-windows.yml | 17 +++++++++++++---- .github/workflows/ci.yml | 16 ++++++++-------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 25981b9..7931515 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -96,10 +96,20 @@ jobs: export MCPP="$MCPP_SELF" export MCPP_VENDORED_XLINGS="$XLINGS_BIN" export MCPP_E2E_TOOLCHAIN_MIRROR=GLOBAL - "$MCPP_SELF" self config --mirror GLOBAL 2>/dev/null || true - "$MCPP_SELF" toolchain default llvm@20.1.7 2>/dev/null || true + "$MCPP_SELF" self config --mirror GLOBAL + "$MCPP_SELF" toolchain default llvm@20.1.7 bash tests/e2e/run_all.sh + - name: "Toolchain: LLVM — mcpp new → run" + shell: bash + run: | + export MCPP_VENDORED_XLINGS="$XLINGS_BIN" + TMP=$(mktemp -d) + cd "$TMP" + "$MCPP_SELF" new hello_win + cd hello_win + "$MCPP_SELF" run + - name: "Toolchain: LLVM — build mcpp (self-host)" shell: bash run: | @@ -108,8 +118,7 @@ jobs: MCPP=/tmp/mcpp-fresh.exe "$MCPP" toolchain default llvm@20.1.7 "$MCPP" clean --bmi-cache - "$MCPP" build - "$MCPP" --version + "$MCPP" build 2>&1 | tee /dev/stderr | grep -q "Resolved llvm@20.1.7" - name: Package Windows release zip id: package diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66a0052..970ec32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -136,21 +136,21 @@ jobs: - name: "Toolchain: GCC — build mcpp + test" run: | - "$MCPP" toolchain default gcc@16.1.0 "$MCPP" clean - "$MCPP" build + "$MCPP" build 2>&1 | tee /dev/stderr | grep -q "Resolved gcc@16.1.0" "$MCPP" test - - name: "Toolchain: musl-gcc — build mcpp" + - name: "Toolchain: musl-gcc — build mcpp (--target)" run: | - "$MCPP" toolchain install gcc 15.1.0-musl - "$MCPP" toolchain default gcc@15.1.0-musl "$MCPP" clean - "$MCPP" build + "$MCPP" build --target x86_64-linux-musl 2>&1 | tee /dev/stderr | grep -q "musl" - name: "Toolchain: LLVM — build mcpp" run: | "$MCPP" toolchain install llvm 20.1.7 - "$MCPP" toolchain default llvm@20.1.7 + # Override project toolchain to use LLVM for this build + sed -i 's/^default = "gcc@16.1.0"/default = "llvm@20.1.7"/' mcpp.toml "$MCPP" clean - "$MCPP" build + "$MCPP" build 2>&1 | tee /dev/stderr | grep -q "Resolved llvm@20.1.7" + # Restore + sed -i 's/^default = "llvm@20.1.7"/default = "gcc@16.1.0"/' mcpp.toml From 3ec0713711decc15517c95133df4ffa07e3c4d9e Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 22 May 2026 07:01:50 +0800 Subject: [PATCH 12/12] =?UTF-8?q?fix:=20CI=20=E2=80=94=20tee=20to=20file?= =?UTF-8?q?=20instead=20of=20/dev/stderr=20(Windows=20compat),=20precise?= =?UTF-8?q?=20grep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace `tee /dev/stderr` with `tee build.log` (Git Bash on Windows doesn't have /dev/stderr) - All grep assertions read from build.log file - musl grep: "musl" → "Resolved gcc@15.1.0-musl" (more precise) --- .github/workflows/ci-windows.yml | 2 +- .github/workflows/ci.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 7931515..9c50b17 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -118,7 +118,7 @@ jobs: MCPP=/tmp/mcpp-fresh.exe "$MCPP" toolchain default llvm@20.1.7 "$MCPP" clean --bmi-cache - "$MCPP" build 2>&1 | tee /dev/stderr | grep -q "Resolved llvm@20.1.7" + "$MCPP" build 2>&1 | tee build.log; grep -q "Resolved llvm@20.1.7" build.log - name: Package Windows release zip id: package diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 970ec32..c98c7f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,13 +137,13 @@ jobs: - name: "Toolchain: GCC — build mcpp + test" run: | "$MCPP" clean - "$MCPP" build 2>&1 | tee /dev/stderr | grep -q "Resolved gcc@16.1.0" + "$MCPP" build 2>&1 | tee build.log; grep -q "Resolved gcc@16.1.0" build.log "$MCPP" test - name: "Toolchain: musl-gcc — build mcpp (--target)" run: | "$MCPP" clean - "$MCPP" build --target x86_64-linux-musl 2>&1 | tee /dev/stderr | grep -q "musl" + "$MCPP" build --target x86_64-linux-musl 2>&1 | tee build.log; grep -q "Resolved gcc@15.1.0-musl" build.log - name: "Toolchain: LLVM — build mcpp" run: | @@ -151,6 +151,6 @@ jobs: # Override project toolchain to use LLVM for this build sed -i 's/^default = "gcc@16.1.0"/default = "llvm@20.1.7"/' mcpp.toml "$MCPP" clean - "$MCPP" build 2>&1 | tee /dev/stderr | grep -q "Resolved llvm@20.1.7" + "$MCPP" build 2>&1 | tee build.log; grep -q "Resolved llvm@20.1.7" build.log # Restore sed -i 's/^default = "llvm@20.1.7"/default = "gcc@16.1.0"/' mcpp.toml