@@ -118,12 +118,44 @@ jobs:
118118 git fetch -q --depth 1 origin "$ref"
119119 git checkout -q FETCH_HEAD
120120 echo "self-hosting $repo @ $ref"
121+ # The clone's .xlings.json declares `workspace.mcpp` — the BOOTSTRAP
122+ # pin, hand-maintained and deliberately lagging the newest release.
123+ # It is scoped to the working directory and beats anything installed,
124+ # so every `mcpp` below resolved the bootstrap version, which the
125+ # fresh-install steps above never installed:
126+ #
127+ # [error] xlings: version '2026.8.6.2' not found for 'mcpp'
128+ # [error] available: 2026.8.8.2
129+ #
130+ # "newest release != bootstrap pin" is the NORMAL state, so this step
131+ # failed on every run from the moment the two diverged — and it is
132+ # weekly, so nothing pointed at it. This step tests the freshly
133+ # installed RELEASED binary against a source tree; the bootstrap pin
134+ # has no standing in that question. install_released_mcpp.sh removes
135+ # it for exactly this reason on the x86_64 legs (its point 1); this
136+ # leg was written separately and never got it.
137+ rm -f .xlings.json
121138 mcpp self config --mirror GLOBAL 2>/dev/null || true
122139 mcpp build --target aarch64-linux-musl
123140 # Absolute: it is used again after `cd /tmp/xlings-src` below.
124141 m=$(find "$PWD/target/aarch64-linux-musl" -type f -path '*/bin/mcpp' | head -1)
125142 file "$m" | grep -q "ARM aarch64" || { echo "expected aarch64 mcpp"; exit 1; }
126143 "$m" --version
144+ # MCPP_HOME must be carried over explicitly: mcpp derives it from the
145+ # BINARY's location, so a binary sitting in /tmp/mcpp-src/target would
146+ # otherwise adopt an empty home and re-bootstrap the whole ecosystem
147+ # instead of reusing what the fresh-install steps above provisioned.
148+ #
149+ # Resolved HERE, before the cd below, and that placement is load-
150+ # bearing: `mcpp` is the shim, so it obeys whatever workspace pin the
151+ # CURRENT DIRECTORY carries — and the xlings checkout declares one too
152+ # (`workspace.mcpp = 2026.8.6.1`, its own bootstrap). Run from there,
153+ # this resolves a version nothing installed, MCPP_HOME comes back
154+ # empty, and the step dies on the guard below instead of on the real
155+ # cause. /tmp/mcpp-src has had its pin removed above, so ask from here.
156+ export MCPP_HOME=$(mcpp self env | awk -F'= *' '/^MCPP_HOME/{print $2; exit}')
157+ echo "reusing MCPP_HOME=$MCPP_HOME"
158+ test -d "$MCPP_HOME" || { echo "could not determine MCPP_HOME"; exit 1; }
127159 git clone --depth 1 https://github.com/openxlings/xlings /tmp/xlings-src
128160 cd /tmp/xlings-src
129161 # "$m", not `mcpp`: the just-built binary is the code under review,
@@ -132,14 +164,6 @@ jobs:
132164 # records, one line further down. It surfaced the same way: a fix for
133165 # an aarch64-only failure in exactly this build could not be
134166 # validated here, because the binary running it predated the fix.
135- #
136- # MCPP_HOME must be carried over explicitly: mcpp derives it from the
137- # BINARY's location, so a binary sitting in /tmp/mcpp-src/target would
138- # otherwise adopt an empty home and re-bootstrap the whole ecosystem
139- # instead of reusing what the fresh-install steps above provisioned.
140- export MCPP_HOME=$(mcpp self env | awk -F'= *' '/^MCPP_HOME/{print $2; exit}')
141- echo "reusing MCPP_HOME=$MCPP_HOME"
142- test -d "$MCPP_HOME" || { echo "could not determine MCPP_HOME"; exit 1; }
143167 "$m" build --target aarch64-linux-musl
144168 x=$(find target/aarch64-linux-musl -type f -path '*/bin/xlings' | head -1)
145169 file "$x" | grep -q "ARM aarch64" || { echo "expected aarch64 xlings"; exit 1; }
@@ -162,6 +186,13 @@ jobs:
162186 # is the only place #295 can actually be reproduced.
163187 - name : Build current mcpp source for native regression tests
164188 run : |
189+ # Third site of the same pin, and the reason to remove it here too:
190+ # this job installs `xlings install mcpp` (bare = latest) and NOTHING
191+ # else, so the bootstrap version the checkout pins is never on this
192+ # runner. Obeying the pin here does not select an older builder — it
193+ # selects one that does not exist. Same removal as the self-host step
194+ # above, same reason as install_released_mcpp.sh point 1.
195+ rm -f .xlings.json
165196 mcpp build --target aarch64-linux-musl
166197 self=$(find target/aarch64-linux-musl -type f -path '*/bin/mcpp' | head -1)
167198 test -x "$self"
0 commit comments