Skip to content

Commit ab0e5ba

Browse files
authored
the measurement can run against an engine that has not been released (#452)
* the measurement can run against an engine that has not been released Every ecosystem repository mcpp's changes reach already honours `MCPP_SOURCE_REF`: non-empty, it builds the engine from that ref and asserts that the binary on PATH is the one it built. This workflow was the gap, and it is the one that matters most --- mcpp's own CI cannot see a defect that appears only in a real dependency graph, and this repository holds thirty of them. THE COST OF THE GAP IS MEASURED, NOT HYPOTHETICAL. 2026.9.20.1 shipped on 2026-09-20. Within a day the four members that stop at `#include <windows.h>` through a borrowed `__CYGWIN__` --- archive, sqlite3, mimalloc, c-ares --- made a second release necessary. That reading was available from these same thirty graphs before the first release merged; nothing could produce it, because this job could only install a published engine. A release is not one build. It is a tag, four platform builds, two mirrors, a GET check per asset, an xim-pkgindex bump, an index artifact, and a consumer-side confirmation. What this closes is a second pass down that whole chain. Shape: the released engine the pin names is still installed, because mcpp builds itself and is its own bootstrap; the build from the ref then replaces it on PATH, and `MCPP_HOME` follows it. `.xlings.json` is removed from the clone first --- it pins the mcpp that compiles mcpp, does not move when mcpp is released, and would otherwise ask the index for a version it may no longer carry. The version under review is printed, because a PATH entry that does not win looks exactly like one that does until something has been measured with the wrong engine. The pins-agree check is unaffected: it compares this workflow's pin with pins.toml, and both still name the released version. A source ref is an override on top of that agreement, not a replacement for it. * the engine under review replaces the released binary in place The first revision prepended the freshly built `mcpp` to PATH beside its own `target/` directory. The measurement then stopped at error: xlings binary not found A released archive carries a BUNDLED xlings that mcpp resolves relative to its own location; a binary sitting in a build tree has no such neighbour, and moving `MCPP_HOME` to that tree moved the search with it. Overwriting `bin/mcpp` inside the released root instead keeps everything about that root as the release left it --- the bundled xlings, the layout, `MCPP_HOME`, the PATH entry already exported --- and changes only the one file under review. The version is reported from the path the measurement will actually run, because a copy that did not land looks exactly like one that did until something has been measured with the wrong engine. Found by using this mechanism on its first real cross-verification, which is where a plumbing defect is cheap.
1 parent bf62dd5 commit ab0e5ba

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/openkal-compat.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
description: "Space-separated members to measure (empty = every listed member)"
1818
required: false
1919
default: ""
20+
mcpp_ref:
21+
description: "Branch of mcpp-community/mcpp to build and measure against (empty = the released pin)"
22+
required: false
23+
default: ""
2024
pull_request:
2125
paths:
2226
- "pkgs/**/*.lua"
@@ -34,6 +38,22 @@ env:
3438
# pins.toml for why this pin, not just validate.yml's, is gated by the
3539
# index floor.
3640
MCPP_VERSION: "2026.9.20.1"
41+
# CROSS-VALIDATION BEFORE A RELEASE, NOT AFTER IT.
42+
#
43+
# Empty in an ordinary run, so this measurement keeps using the RELEASED
44+
# engine the pin above names. Set it -- workflow_dispatch input, or the
45+
# repository variable -- and the same measurement runs against mcpp built
46+
# from that ref instead.
47+
#
48+
# THIS EXISTS BECAUSE AN ENGINE CHANGE'S REAL LOAD IS HERE. mcpp's own CI
49+
# cannot see a defect that appears only in a real dependency graph; this
50+
# repository holds thirty such graphs and could not see the engine until it
51+
# had been published. 2026.9.20.1 shipped and, within a day, the four
52+
# members that stop at `windows.h` through a borrowed `__CYGWIN__` made a
53+
# second release necessary -- a reading this job could have produced before
54+
# the first one merged. Every ecosystem repository that mcpp's changes reach
55+
# already honours this variable; this workflow was the gap.
56+
MCPP_SOURCE_REF: ${{ github.event.inputs.mcpp_ref || vars.MCPP_SOURCE_REF }}
3757
XLINGS_NON_INTERACTIVE: "1"
3858

3959
jobs:
@@ -76,6 +96,44 @@ jobs:
7696
echo "$root/bin" >> "$GITHUB_PATH"
7797
echo "MCPP_HOME=$root" >> "$GITHUB_ENV"
7898
99+
# The released engine above is the BOOTSTRAP when a ref is under
100+
# review: mcpp builds itself and there is no other compiler for it
101+
# here.
102+
#
103+
# THE BUILD REPLACES THE BINARY INSIDE THE RELEASED ROOT, rather than
104+
# being prepended to PATH beside its own `target/` directory. An
105+
# earlier revision did the latter and the measurement stopped at
106+
#
107+
# error: xlings binary not found
108+
#
109+
# because a released archive carries a BUNDLED xlings that mcpp
110+
# resolves relative to its own location, and a freshly built binary
111+
# has no such neighbour. Overwriting `bin/mcpp` in place keeps that
112+
# root --- its bundled xlings, its layout, `MCPP_HOME`, the PATH
113+
# entry already exported above --- exactly as the released engine
114+
# left it, and changes only the one file under review.
115+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
116+
src="$RUNNER_TEMP/mcpp-src"
117+
git clone --quiet --depth 1 --branch "$MCPP_SOURCE_REF" \
118+
https://github.com/mcpp-community/mcpp.git "$src"
119+
# `.xlings.json` at mcpp's root pins the mcpp that compiles mcpp,
120+
# and that pin does not move when mcpp is released, so a build
121+
# inside the checkout would try to install a version the index may
122+
# no longer carry. What is wanted is the source compiled by the
123+
# engine installed above, which removing the file leaves.
124+
rm -f "$src/.xlings.json"
125+
( cd "$src" && "$root/bin/mcpp" build --release )
126+
built=$(find "$src/target" -type f -name mcpp | head -1)
127+
[ -n "$built" ] \
128+
|| { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
129+
cp "$built" "$root/bin/mcpp"
130+
# Reported from the path the measurement will actually run, not
131+
# from the build directory: a copy that did not land looks exactly
132+
# like one that did until something has been measured with the
133+
# wrong engine.
134+
echo "under review: $("$root/bin/mcpp" --version) (from $MCPP_SOURCE_REF)"
135+
fi
136+
79137
# The Windows cross headers of the host are installed deliberately. A
80138
# graph that reached them would build differently with them present, so a
81139
# result that is the same here and on a runner without them is evidence

0 commit comments

Comments
 (0)