Skip to content

Commit 92efa9c

Browse files
committed
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.
1 parent ddc38dc commit 92efa9c

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

.github/workflows/ci-macos.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ jobs:
311311
MCPP=$(find target -path "*/bin/mcpp" | head -1)
312312
MCPP=$(cd "$(dirname "$MCPP")" && pwd)/$(basename "$MCPP")
313313
test -x "$MCPP"
314+
cp "$MCPP" /tmp/mcpp-fresh
315+
MCPP=/tmp/mcpp-fresh
314316
"$MCPP" toolchain default llvm@20.1.7
315317
"$MCPP" clean
316318
"$MCPP" build

.github/workflows/ci-windows.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ jobs:
104104
shell: bash
105105
run: |
106106
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
107-
"$MCPP_SELF" toolchain default llvm@20.1.7
108-
"$MCPP_SELF" clean
109-
"$MCPP_SELF" build
110-
"$MCPP_SELF" --version
107+
cp "$MCPP_SELF" /tmp/mcpp-fresh.exe
108+
MCPP=/tmp/mcpp-fresh.exe
109+
"$MCPP" toolchain default llvm@20.1.7
110+
"$MCPP" clean --bmi-cache
111+
"$MCPP" build
112+
"$MCPP" --version
111113
112114
- name: Package Windows release zip
113115
id: package

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,25 +128,28 @@ jobs:
128128
"$MCPP" toolchain default gcc@16.1.0
129129
bash tests/e2e/run_all.sh
130130
131-
- name: "Toolchain: GCC — build mcpp + test"
131+
- name: Save freshly-built mcpp for toolchain tests
132132
run: |
133133
MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)")
134+
cp "$MCPP" /tmp/mcpp-fresh
135+
echo "MCPP=/tmp/mcpp-fresh" >> "$GITHUB_ENV"
136+
137+
- name: "Toolchain: GCC — build mcpp + test"
138+
run: |
134139
"$MCPP" toolchain default gcc@16.1.0
135140
"$MCPP" clean
136141
"$MCPP" build
137142
"$MCPP" test
138143
139144
- name: "Toolchain: musl-gcc — build mcpp"
140145
run: |
141-
MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)")
142146
"$MCPP" toolchain install gcc 15.1.0-musl
143147
"$MCPP" toolchain default gcc@15.1.0-musl
144148
"$MCPP" clean
145149
"$MCPP" build
146150
147151
- name: "Toolchain: LLVM — build mcpp"
148152
run: |
149-
MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)")
150153
"$MCPP" toolchain install llvm 20.1.7
151154
"$MCPP" toolchain default llvm@20.1.7
152155
"$MCPP" clean

0 commit comments

Comments
 (0)