Skip to content

Commit 6d36a81

Browse files
committed
fix: CI toolchain tests actually use correct toolchain + assertions
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 <toolchain>" 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.
1 parent e5c0968 commit 6d36a81

2 files changed

Lines changed: 21 additions & 12 deletions

File tree

.github/workflows/ci-windows.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,20 @@ jobs:
9696
export MCPP="$MCPP_SELF"
9797
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
9898
export MCPP_E2E_TOOLCHAIN_MIRROR=GLOBAL
99-
"$MCPP_SELF" self config --mirror GLOBAL 2>/dev/null || true
100-
"$MCPP_SELF" toolchain default llvm@20.1.7 2>/dev/null || true
99+
"$MCPP_SELF" self config --mirror GLOBAL
100+
"$MCPP_SELF" toolchain default llvm@20.1.7
101101
bash tests/e2e/run_all.sh
102102
103+
- name: "Toolchain: LLVM — mcpp new → run"
104+
shell: bash
105+
run: |
106+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
107+
TMP=$(mktemp -d)
108+
cd "$TMP"
109+
"$MCPP_SELF" new hello_win
110+
cd hello_win
111+
"$MCPP_SELF" run
112+
103113
- name: "Toolchain: LLVM — build mcpp (self-host)"
104114
shell: bash
105115
run: |
@@ -108,8 +118,7 @@ jobs:
108118
MCPP=/tmp/mcpp-fresh.exe
109119
"$MCPP" toolchain default llvm@20.1.7
110120
"$MCPP" clean --bmi-cache
111-
"$MCPP" build
112-
"$MCPP" --version
121+
"$MCPP" build 2>&1 | tee /dev/stderr | grep -q "Resolved llvm@20.1.7"
113122
114123
- name: Package Windows release zip
115124
id: package

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,21 @@ jobs:
136136
137137
- name: "Toolchain: GCC — build mcpp + test"
138138
run: |
139-
"$MCPP" toolchain default gcc@16.1.0
140139
"$MCPP" clean
141-
"$MCPP" build
140+
"$MCPP" build 2>&1 | tee /dev/stderr | grep -q "Resolved gcc@16.1.0"
142141
"$MCPP" test
143142
144-
- name: "Toolchain: musl-gcc — build mcpp"
143+
- name: "Toolchain: musl-gcc — build mcpp (--target)"
145144
run: |
146-
"$MCPP" toolchain install gcc 15.1.0-musl
147-
"$MCPP" toolchain default gcc@15.1.0-musl
148145
"$MCPP" clean
149-
"$MCPP" build
146+
"$MCPP" build --target x86_64-linux-musl 2>&1 | tee /dev/stderr | grep -q "musl"
150147
151148
- name: "Toolchain: LLVM — build mcpp"
152149
run: |
153150
"$MCPP" toolchain install llvm 20.1.7
154-
"$MCPP" toolchain default llvm@20.1.7
151+
# Override project toolchain to use LLVM for this build
152+
sed -i 's/^default = "gcc@16.1.0"/default = "llvm@20.1.7"/' mcpp.toml
155153
"$MCPP" clean
156-
"$MCPP" build
154+
"$MCPP" build 2>&1 | tee /dev/stderr | grep -q "Resolved llvm@20.1.7"
155+
# Restore
156+
sed -i 's/^default = "llvm@20.1.7"/default = "gcc@16.1.0"/' mcpp.toml

0 commit comments

Comments
 (0)