Skip to content

Commit 5a3dd3e

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 074ce7a commit 5a3dd3e

1 file changed

Lines changed: 34 additions & 2 deletions

File tree

.github/workflows/ci.yml

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

@@ -72,6 +77,33 @@ jobs:
7277
xlings install "mcpp@$MCPP_VERSION" -y -g
7378
mcpp --version
7479
mcpp self config --mirror GLOBAL
80+
# ⭐⭐ CROSS-VALIDATION: BUILD THE mcpp UNDER REVIEW AND USE THAT ONE.
81+
#
82+
# Empty in the ordinary run, so this job keeps testing the RELEASED
83+
# mcpp the pin above names. Set it — `workflow_dispatch` input, or the
84+
# repository variable — and the same job runs against that source.
85+
#
86+
# ⚠️ THIS EXISTS BECAUSE THE ORDER USED TO BE WRONG. Several mcpp
87+
# releases went out green and only then turned this ecosystem red: the
88+
# engine's own CI cannot see a defect that appears only in a real
89+
# dependency graph, and this repository could not see the engine until
90+
# it had been published. Validating before the release closes that gap.
91+
#
92+
# The released mcpp installed just above is the bootstrap that compiles
93+
# it; mcpp builds itself and there is no other compiler for it here.
94+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
95+
src="$RUNNER_TEMP/mcpp-src"
96+
[ -d "$src" ] || git clone --quiet --depth 1 \
97+
--branch "$MCPP_SOURCE_REF" \
98+
https://github.com/mcpp-community/mcpp.git "$src"
99+
( cd "$src" && mcpp build --release )
100+
built=$(find "$src/target" -type f -name mcpp -perm -u+x | head -1)
101+
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
102+
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"
103+
# ⚠️ Reported, because a PATH entry that does not win looks exactly
104+
# like one that does until something built with the wrong engine.
105+
echo "under review: $("$built" --version) (from $MCPP_SOURCE_REF)"
106+
fi
75107
76108
# The compiler family and version for this row. mcpp keeps its toolchains
77109
# in a sandbox of its own, so this selects rather than installs into the

0 commit comments

Comments
 (0)