Skip to content

Commit 38be140

Browse files
authored
ci: pin mcpp 2026.8.25.1 (#10)
* ci: pin the build tool this package was released against The pin was several releases behind, so what CI validated was not what the ecosystem resolves. 2026.8.24.6 is the version this package's current contents were released alongside — openkal 0.7.0 and the implementations that follow it. A version verified to build this package, not a measured minimum: the pin exists for reproducibility rather than because an older mcpp is known to fail. * ci: pin 2026.8.25.1 — the release that fixes what 2026.8.24.6 broke * 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. * ci: bootstrap from the index when validating an unreleased mcpp The pin may name the very release the run is validating, which does not exist yet — that is what MCPP_SOURCE_REF is for. Bootstrap from whatever the index has; the build under review replaces it a step later. * ci: the clone's workspace pin does not decide which mcpp builds it `.xlings.json` at mcpp's root pins the mcpp that compiles mcpp, and that pin does not move when mcpp is released — a build inside the checkout obeys it and installs a version the index may no longer carry. What this step wants is the source compiled by the mcpp installed a moment earlier. * ci: note why the fresh clone needs no mtime sort The mcpp side of this cross-validation had to sort by mtime — its target/ is restored from a cache and `find … | head -1` returned a binary an earlier push had left, with the right version string and the wrong code. Here $src is a fresh clone, so the plain form is correct; `-printf` is a GNU extension and one of the runners reaching this line is macOS. * ci: find the built mcpp by either spelling, on every runner The matrix reaches Windows and macOS. Measured on the Windows row: `Finished release [optimized] in 173.44s` followed by "mcpp did not build" — the build had succeeded and the search was looking for a name that filesystem does not use.
1 parent a02dfac commit 38be140

1 file changed

Lines changed: 66 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@ on:
2424
branches: [main]
2525
pull_request:
2626
workflow_dispatch:
27-
27+
inputs:
28+
mcpp_ref:
29+
description: "Branch of mcpp-community/mcpp to build and test against (empty = the released pin)"
30+
required: false
31+
default: ""
2832
env:
29-
MCPP_VERSION: 2026.8.19.4
33+
MCPP_SOURCE_REF: ${{ github.event.inputs.mcpp_ref || vars.MCPP_SOURCE_REF }}
34+
MCPP_VERSION: 2026.8.25.2
3035
XLINGS_VERSION: v2026.8.17.2
3136
XLINGS_NON_INTERACTIVE: '1'
3237

@@ -71,9 +76,67 @@ jobs:
7176
- name: Install mcpp
7277
run: |
7378
xlings update
74-
xlings install "mcpp@$MCPP_VERSION" -y -g
79+
# ⚠️ THE PIN MAY NAME THE RELEASE THIS RUN IS VALIDATING, which does
80+
# not exist yet — that is the whole point of MCPP_SOURCE_REF. Bootstrap
81+
# from whatever the index has; the step below replaces it with the
82+
# build under review, and the pin is what an ordinary run tests.
83+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
84+
xlings install mcpp -y -g
85+
else
86+
xlings install "mcpp@$MCPP_VERSION" -y -g
87+
fi
7588
mcpp --version
7689
mcpp self config --mirror GLOBAL
90+
# ⭐⭐ CROSS-VALIDATION: BUILD THE mcpp UNDER REVIEW AND USE THAT ONE.
91+
#
92+
# Empty in the ordinary run, so this job keeps testing the RELEASED
93+
# mcpp the pin above names. Set it — `workflow_dispatch` input, or the
94+
# repository variable — and the same job runs against that source.
95+
#
96+
# ⚠️ THIS EXISTS BECAUSE THE ORDER USED TO BE WRONG. Several mcpp
97+
# releases went out green and only then turned this ecosystem red: the
98+
# engine's own CI cannot see a defect that appears only in a real
99+
# dependency graph, and this repository could not see the engine until
100+
# it had been published. Validating before the release closes that gap.
101+
#
102+
# The released mcpp installed just above is the bootstrap that compiles
103+
# it; mcpp builds itself and there is no other compiler for it here.
104+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
105+
src="$RUNNER_TEMP/mcpp-src"
106+
[ -d "$src" ] || git clone --quiet --depth 1 \
107+
--branch "$MCPP_SOURCE_REF" \
108+
https://github.com/mcpp-community/mcpp.git "$src"
109+
# ⚠️ THE CLONE'S OWN WORKSPACE PIN MUST NOT DECIDE WHICH mcpp
110+
# BUILDS IT. `.xlings.json` at mcpp's root pins the mcpp that
111+
# compiles mcpp, and that pin does not move when mcpp is released —
112+
# so a build inside the checkout obeys it and tries to install a
113+
# version the index may no longer carry:
114+
#
115+
# [error] xlings: version '2026.8.17.1' not found for 'mcpp'
116+
# available: 2026.8.25.1
117+
#
118+
# What is wanted here is the source compiled by the mcpp installed
119+
# above, which is exactly what removing the file leaves.
120+
rm -f "$src/.xlings.json"
121+
( cd "$src" && mcpp build --release )
122+
# ⚠️ BOTH SPELLINGS, AND NO `-perm`. The matrix reaches Windows and
123+
# macOS runners too: on Windows the artefact is `mcpp.exe`, and
124+
# `-perm -u+x` is not a question that filesystem answers the way this
125+
# expects. Measured: `Finished release [optimized] in 173.44s`
126+
# followed by "mcpp did not build" — the build had succeeded and the
127+
# search was looking for the wrong name.
128+
#
129+
# `$src` is a FRESH clone each run, so `target/` holds exactly what
130+
# this step just built; `-printf` would be the safer form on a cached
131+
# tree and is a GNU extension this must not use.
132+
built=$(find "$src/target" -type f \
133+
\( -name mcpp -o -name mcpp.exe \) | head -1)
134+
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
135+
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"
136+
# ⚠️ Reported, because a PATH entry that does not win looks exactly
137+
# like one that does until something built with the wrong engine.
138+
echo "under review: $("$built" --version) (from $MCPP_SOURCE_REF)"
139+
fi
77140
78141
- name: Select the toolchain
79142
run: |

0 commit comments

Comments
 (0)