Skip to content

Commit bcc49e4

Browse files
committed
ci: validate against the mcpp under review, before it is released
Several mcpp releases went out green and only then turned this ecosystem red. The engine's own CI cannot see a defect that appears only in a real dependency graph, and this repository could not see the engine until it had been published — so the first place the two met was after the release. `MCPP_SOURCE_REF` (a workflow_dispatch input, or a repository variable) names a branch of mcpp-community/mcpp. When set, every job builds that source with the released mcpp as bootstrap and puts the result first on PATH; when empty the job tests the released pin exactly as before. Also re-pins to 2026.8.25.2, which fixes what this repository last failed on.
1 parent ac587e5 commit bcc49e4

1 file changed

Lines changed: 64 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,22 @@ on:
55
branches: [main]
66
pull_request:
77
workflow_dispatch:
8+
inputs:
9+
mcpp_ref:
10+
description: "Branch of mcpp-community/mcpp to build and test against (empty = the released pin)"
11+
required: false
12+
default: ""
13+
env:
14+
MCPP_SOURCE_REF: ${{ github.event.inputs.mcpp_ref || vars.MCPP_SOURCE_REF }}
15+
MCPP_SOURCE_REF: ${{ github.event.inputs.mcpp_ref || vars.MCPP_SOURCE_REF }}
816

917
jobs:
1018
build:
1119
name: boots under real OpenSBI
1220
runs-on: ubuntu-24.04
1321
timeout-minutes: 40
1422
env:
15-
MCPP_VERSION: 2026.8.25.1
23+
MCPP_VERSION: 2026.8.25.2
1624
XLINGS_VERSION: v2026.8.17.2
1725
XLINGS_NON_INTERACTIVE: '1'
1826
# The branch of the specification this backend is verified against. It
@@ -65,6 +73,33 @@ jobs:
6573
done
6674
mcpp --version
6775
mcpp self config --mirror GLOBAL
76+
# ⭐⭐ CROSS-VALIDATION: BUILD THE mcpp UNDER REVIEW AND USE THAT ONE.
77+
#
78+
# Empty in the ordinary run, so this job keeps testing the RELEASED
79+
# mcpp the pin above names. Set it — `workflow_dispatch` input, or the
80+
# repository variable — and the same job runs against that source.
81+
#
82+
# ⚠️ THIS EXISTS BECAUSE THE ORDER USED TO BE WRONG. Several mcpp
83+
# releases went out green and only then turned this ecosystem red: the
84+
# engine's own CI cannot see a defect that appears only in a real
85+
# dependency graph, and this repository could not see the engine until
86+
# it had been published. Validating before the release closes that gap.
87+
#
88+
# The released mcpp installed just above is the bootstrap that compiles
89+
# it; mcpp builds itself and there is no other compiler for it here.
90+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
91+
src="$RUNNER_TEMP/mcpp-src"
92+
[ -d "$src" ] || git clone --quiet --depth 1 \
93+
--branch "$MCPP_SOURCE_REF" \
94+
https://github.com/mcpp-community/mcpp.git "$src"
95+
( cd "$src" && mcpp build --release )
96+
built=$(find "$src/target" -type f -name mcpp -perm -u+x | head -1)
97+
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
98+
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"
99+
# ⚠️ Reported, because a PATH entry that does not win looks exactly
100+
# like one that does until something built with the wrong engine.
101+
echo "under review: $("$built" --version) (from $MCPP_SOURCE_REF)"
102+
fi
68103
69104
- name: Install the emulator
70105
run: |
@@ -181,7 +216,7 @@ jobs:
181216
run:
182217
shell: bash
183218
env:
184-
MCPP_VERSION: 2026.8.25.1
219+
MCPP_VERSION: 2026.8.25.2
185220
XLINGS_VERSION: v2026.8.17.2
186221
XLINGS_NON_INTERACTIVE: '1'
187222
steps:
@@ -236,6 +271,33 @@ jobs:
236271
done
237272
mcpp --version
238273
mcpp self config --mirror GLOBAL
274+
# ⭐⭐ CROSS-VALIDATION: BUILD THE mcpp UNDER REVIEW AND USE THAT ONE.
275+
#
276+
# Empty in the ordinary run, so this job keeps testing the RELEASED
277+
# mcpp the pin above names. Set it — `workflow_dispatch` input, or the
278+
# repository variable — and the same job runs against that source.
279+
#
280+
# ⚠️ THIS EXISTS BECAUSE THE ORDER USED TO BE WRONG. Several mcpp
281+
# releases went out green and only then turned this ecosystem red: the
282+
# engine's own CI cannot see a defect that appears only in a real
283+
# dependency graph, and this repository could not see the engine until
284+
# it had been published. Validating before the release closes that gap.
285+
#
286+
# The released mcpp installed just above is the bootstrap that compiles
287+
# it; mcpp builds itself and there is no other compiler for it here.
288+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
289+
src="$RUNNER_TEMP/mcpp-src"
290+
[ -d "$src" ] || git clone --quiet --depth 1 \
291+
--branch "$MCPP_SOURCE_REF" \
292+
https://github.com/mcpp-community/mcpp.git "$src"
293+
( cd "$src" && mcpp build --release )
294+
built=$(find "$src/target" -type f -name mcpp -perm -u+x | head -1)
295+
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
296+
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"
297+
# ⚠️ Reported, because a PATH entry that does not win looks exactly
298+
# like one that does until something built with the wrong engine.
299+
echo "under review: $("$built" --version) (from $MCPP_SOURCE_REF)"
300+
fi
239301
240302
- name: The backend cross-builds
241303
run: |

0 commit comments

Comments
 (0)