Skip to content

Commit efcb5f6

Browse files
authored
ci: pin mcpp 2026.8.25.1 (#9)
* 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 1c24825 commit efcb5f6

1 file changed

Lines changed: 125 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 125 additions & 4 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.19.4
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

@@ -68,9 +73,67 @@ jobs:
6873
- name: Install mcpp
6974
run: |
7075
xlings update
71-
xlings install "mcpp@$MCPP_VERSION" -y -g
76+
# ⚠️ THE PIN MAY NAME THE RELEASE THIS RUN IS VALIDATING, which does
77+
# not exist yet — that is the whole point of MCPP_SOURCE_REF. Bootstrap
78+
# from whatever the index has; the step below replaces it with the
79+
# build under review, and the pin is what an ordinary run tests.
80+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
81+
xlings install mcpp -y -g
82+
else
83+
xlings install "mcpp@$MCPP_VERSION" -y -g
84+
fi
7285
mcpp --version
7386
mcpp self config --mirror GLOBAL
87+
# ⭐⭐ CROSS-VALIDATION: BUILD THE mcpp UNDER REVIEW AND USE THAT ONE.
88+
#
89+
# Empty in the ordinary run, so this job keeps testing the RELEASED
90+
# mcpp the pin above names. Set it — `workflow_dispatch` input, or the
91+
# repository variable — and the same job runs against that source.
92+
#
93+
# ⚠️ THIS EXISTS BECAUSE THE ORDER USED TO BE WRONG. Several mcpp
94+
# releases went out green and only then turned this ecosystem red: the
95+
# engine's own CI cannot see a defect that appears only in a real
96+
# dependency graph, and this repository could not see the engine until
97+
# it had been published. Validating before the release closes that gap.
98+
#
99+
# The released mcpp installed just above is the bootstrap that compiles
100+
# it; mcpp builds itself and there is no other compiler for it here.
101+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
102+
src="$RUNNER_TEMP/mcpp-src"
103+
[ -d "$src" ] || git clone --quiet --depth 1 \
104+
--branch "$MCPP_SOURCE_REF" \
105+
https://github.com/mcpp-community/mcpp.git "$src"
106+
# ⚠️ THE CLONE'S OWN WORKSPACE PIN MUST NOT DECIDE WHICH mcpp
107+
# BUILDS IT. `.xlings.json` at mcpp's root pins the mcpp that
108+
# compiles mcpp, and that pin does not move when mcpp is released —
109+
# so a build inside the checkout obeys it and tries to install a
110+
# version the index may no longer carry:
111+
#
112+
# [error] xlings: version '2026.8.17.1' not found for 'mcpp'
113+
# available: 2026.8.25.1
114+
#
115+
# What is wanted here is the source compiled by the mcpp installed
116+
# above, which is exactly what removing the file leaves.
117+
rm -f "$src/.xlings.json"
118+
( cd "$src" && mcpp build --release )
119+
# ⚠️ BOTH SPELLINGS, AND NO `-perm`. The matrix reaches Windows and
120+
# macOS runners too: on Windows the artefact is `mcpp.exe`, and
121+
# `-perm -u+x` is not a question that filesystem answers the way this
122+
# expects. Measured: `Finished release [optimized] in 173.44s`
123+
# followed by "mcpp did not build" — the build had succeeded and the
124+
# search was looking for the wrong name.
125+
#
126+
# `$src` is a FRESH clone each run, so `target/` holds exactly what
127+
# this step just built; `-printf` would be the safer form on a cached
128+
# tree and is a GNU extension this must not use.
129+
built=$(find "$src/target" -type f \
130+
\( -name mcpp -o -name mcpp.exe \) | head -1)
131+
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
132+
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"
133+
# ⚠️ Reported, because a PATH entry that does not win looks exactly
134+
# like one that does until something built with the wrong engine.
135+
echo "under review: $("$built" --version) (from $MCPP_SOURCE_REF)"
136+
fi
74137
75138
- name: Select the toolchain
76139
run: |
@@ -138,8 +201,66 @@ jobs:
138201
- name: Install mcpp
139202
run: |
140203
xlings update
141-
xlings install "mcpp@$MCPP_VERSION" -y -g
204+
# ⚠️ THE PIN MAY NAME THE RELEASE THIS RUN IS VALIDATING, which does
205+
# not exist yet — that is the whole point of MCPP_SOURCE_REF. Bootstrap
206+
# from whatever the index has; the step below replaces it with the
207+
# build under review, and the pin is what an ordinary run tests.
208+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
209+
xlings install mcpp -y -g
210+
else
211+
xlings install "mcpp@$MCPP_VERSION" -y -g
212+
fi
142213
mcpp self config --mirror GLOBAL
214+
# ⭐⭐ CROSS-VALIDATION: BUILD THE mcpp UNDER REVIEW AND USE THAT ONE.
215+
#
216+
# Empty in the ordinary run, so this job keeps testing the RELEASED
217+
# mcpp the pin above names. Set it — `workflow_dispatch` input, or the
218+
# repository variable — and the same job runs against that source.
219+
#
220+
# ⚠️ THIS EXISTS BECAUSE THE ORDER USED TO BE WRONG. Several mcpp
221+
# releases went out green and only then turned this ecosystem red: the
222+
# engine's own CI cannot see a defect that appears only in a real
223+
# dependency graph, and this repository could not see the engine until
224+
# it had been published. Validating before the release closes that gap.
225+
#
226+
# The released mcpp installed just above is the bootstrap that compiles
227+
# it; mcpp builds itself and there is no other compiler for it here.
228+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
229+
src="$RUNNER_TEMP/mcpp-src"
230+
[ -d "$src" ] || git clone --quiet --depth 1 \
231+
--branch "$MCPP_SOURCE_REF" \
232+
https://github.com/mcpp-community/mcpp.git "$src"
233+
# ⚠️ THE CLONE'S OWN WORKSPACE PIN MUST NOT DECIDE WHICH mcpp
234+
# BUILDS IT. `.xlings.json` at mcpp's root pins the mcpp that
235+
# compiles mcpp, and that pin does not move when mcpp is released —
236+
# so a build inside the checkout obeys it and tries to install a
237+
# version the index may no longer carry:
238+
#
239+
# [error] xlings: version '2026.8.17.1' not found for 'mcpp'
240+
# available: 2026.8.25.1
241+
#
242+
# What is wanted here is the source compiled by the mcpp installed
243+
# above, which is exactly what removing the file leaves.
244+
rm -f "$src/.xlings.json"
245+
( cd "$src" && mcpp build --release )
246+
# ⚠️ BOTH SPELLINGS, AND NO `-perm`. The matrix reaches Windows and
247+
# macOS runners too: on Windows the artefact is `mcpp.exe`, and
248+
# `-perm -u+x` is not a question that filesystem answers the way this
249+
# expects. Measured: `Finished release [optimized] in 173.44s`
250+
# followed by "mcpp did not build" — the build had succeeded and the
251+
# search was looking for the wrong name.
252+
#
253+
# `$src` is a FRESH clone each run, so `target/` holds exactly what
254+
# this step just built; `-printf` would be the safer form on a cached
255+
# tree and is a GNU extension this must not use.
256+
built=$(find "$src/target" -type f \
257+
\( -name mcpp -o -name mcpp.exe \) | head -1)
258+
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
259+
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"
260+
# ⚠️ Reported, because a PATH entry that does not win looks exactly
261+
# like one that does until something built with the wrong engine.
262+
echo "under review: $("$built" --version) (from $MCPP_SOURCE_REF)"
263+
fi
143264
144265
- name: Every interface, every kind of examination
145266
env:

0 commit comments

Comments
 (0)