Skip to content

Commit df18b0a

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 fb9f712 commit df18b0a

1 file changed

Lines changed: 61 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@ on:
1919
branches: [main]
2020
pull_request:
2121
workflow_dispatch:
22-
22+
inputs:
23+
mcpp_ref:
24+
description: "Branch of mcpp-community/mcpp to build and test against (empty = the released pin)"
25+
required: false
26+
default: ""
2327
env:
24-
MCPP_VERSION: 2026.8.25.1
28+
MCPP_SOURCE_REF: ${{ github.event.inputs.mcpp_ref || vars.MCPP_SOURCE_REF }}
29+
MCPP_VERSION: 2026.8.25.2
2530
XLINGS_VERSION: v2026.8.17.2
2631
XLINGS_NON_INTERACTIVE: '1'
2732

@@ -71,6 +76,33 @@ jobs:
7176
xlings install "mcpp@$MCPP_VERSION" -y -g
7277
mcpp --version
7378
mcpp self config --mirror GLOBAL
79+
# ⭐⭐ CROSS-VALIDATION: BUILD THE mcpp UNDER REVIEW AND USE THAT ONE.
80+
#
81+
# Empty in the ordinary run, so this job keeps testing the RELEASED
82+
# mcpp the pin above names. Set it — `workflow_dispatch` input, or the
83+
# repository variable — and the same job runs against that source.
84+
#
85+
# ⚠️ THIS EXISTS BECAUSE THE ORDER USED TO BE WRONG. Several mcpp
86+
# releases went out green and only then turned this ecosystem red: the
87+
# engine's own CI cannot see a defect that appears only in a real
88+
# dependency graph, and this repository could not see the engine until
89+
# it had been published. Validating before the release closes that gap.
90+
#
91+
# The released mcpp installed just above is the bootstrap that compiles
92+
# it; mcpp builds itself and there is no other compiler for it here.
93+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
94+
src="$RUNNER_TEMP/mcpp-src"
95+
[ -d "$src" ] || git clone --quiet --depth 1 \
96+
--branch "$MCPP_SOURCE_REF" \
97+
https://github.com/mcpp-community/mcpp.git "$src"
98+
( cd "$src" && mcpp build --release )
99+
built=$(find "$src/target" -type f -name mcpp -perm -u+x | head -1)
100+
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
101+
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"
102+
# ⚠️ Reported, because a PATH entry that does not win looks exactly
103+
# like one that does until something built with the wrong engine.
104+
echo "under review: $("$built" --version) (from $MCPP_SOURCE_REF)"
105+
fi
74106
75107
- name: Select the toolchain
76108
run: |
@@ -140,6 +172,33 @@ jobs:
140172
xlings update
141173
xlings install "mcpp@$MCPP_VERSION" -y -g
142174
mcpp self config --mirror GLOBAL
175+
# ⭐⭐ CROSS-VALIDATION: BUILD THE mcpp UNDER REVIEW AND USE THAT ONE.
176+
#
177+
# Empty in the ordinary run, so this job keeps testing the RELEASED
178+
# mcpp the pin above names. Set it — `workflow_dispatch` input, or the
179+
# repository variable — and the same job runs against that source.
180+
#
181+
# ⚠️ THIS EXISTS BECAUSE THE ORDER USED TO BE WRONG. Several mcpp
182+
# releases went out green and only then turned this ecosystem red: the
183+
# engine's own CI cannot see a defect that appears only in a real
184+
# dependency graph, and this repository could not see the engine until
185+
# it had been published. Validating before the release closes that gap.
186+
#
187+
# The released mcpp installed just above is the bootstrap that compiles
188+
# it; mcpp builds itself and there is no other compiler for it here.
189+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
190+
src="$RUNNER_TEMP/mcpp-src"
191+
[ -d "$src" ] || git clone --quiet --depth 1 \
192+
--branch "$MCPP_SOURCE_REF" \
193+
https://github.com/mcpp-community/mcpp.git "$src"
194+
( cd "$src" && mcpp build --release )
195+
built=$(find "$src/target" -type f -name mcpp -perm -u+x | head -1)
196+
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
197+
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"
198+
# ⚠️ Reported, because a PATH entry that does not win looks exactly
199+
# like one that does until something built with the wrong engine.
200+
echo "under review: $("$built" --version) (from $MCPP_SOURCE_REF)"
201+
fi
143202
144203
- name: Every interface, every kind of examination
145204
env:

0 commit comments

Comments
 (0)