Skip to content

Commit 3e17834

Browse files
committed
ci: substitute the specification per step, not per job
Measured 2026-08-28 across the eight repositories of this ecosystem while one change spanned all of them: eight jobs in four of them called `mcpp build' at a point where the manifest still named openkal BY VERSION, so a version under review -- which by definition is not published -- failed them with E_NOT_FOUND. The mechanism is not a missing substitution. run-conformance.sh substitutes the manifest and RESTORES IT ON EXIT, correctly; every step after it is back to naming a version. So an audit asking "does this job substitute?" passes the job and misses the steps, which is how the first pass at this found three repositories and not four. These steps are green on main and can only be green there, because there the published version is the one under test. It is not a check that fails, it is a check that cannot run at the only time it would have something to say. The substitution is also portable now: the opensbi and uefi portability jobs run on macOS and Windows, where BSD sed requires an argument to -i that GNU sed refuses.
1 parent e858773 commit 3e17834

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,39 @@ jobs:
182182
run: |
183183
bash .spec/tools/run-conformance.sh openkal-macos . full,optional
184184
185+
# ⚠️⚠️ CLONING THE SPECIFICATION IS NOT THE SAME AS BUILDING AGAINST IT.
186+
#
187+
# `.spec` is cloned at the top of this job and consumed by the script
188+
# above, which substitutes this manifest itself and RESTORES IT ON EXIT
189+
# --- correctly, since a script that rewrote a checked-in file and walked
190+
# away would leave the tree holding a path. But every step BELOW calls
191+
# `mcpp build` directly, and by then the manifest names `openkal` by
192+
# version again, so they resolved the PUBLISHED specification:
193+
#
194+
# E_NOT_FOUND: package 'compat.openkal@0.9.0' not found in the synced
195+
# index ... the index is current, so this name is either wrong or not
196+
# published yet
197+
#
198+
# ⭐⭐ THE UNIT IS THE STEP, NOT THE JOB, AND NOT THE REPOSITORY. Measured
199+
# 2026-08-28 across the eight repositories of this ecosystem: eight jobs
200+
# in four of them had this shape. An audit that asked "does this job
201+
# substitute?" passed this one, because it does --- and then gives it
202+
# back. These steps are green on `main` and can only be green there,
203+
# because there the published version IS the one under test.
204+
- name: Point at the specification's working tree
205+
run: |
206+
set -euo pipefail
207+
# ⚠️ NOT `sed -i'. This step runs on macOS and on Windows too, and
208+
# BSD sed requires an argument to -i that GNU sed refuses. A temporary
209+
# file is the spelling that holds on all three.
210+
subst() { # subst <file> <relative-path-to-the-specification>
211+
sed "s|^openkal = .*$|openkal = { path = \"$2\" }|" "$1" > "$1.next"
212+
mv "$1.next" "$1"
213+
grep -q "path = \"$2\"" "$1" \
214+
|| { echo "::error::$1 was not substituted"; exit 1; }
215+
}
216+
subst mcpp.toml .spec
217+
185218
# The other architecture, as far as this system allows it to be reached.
186219
#
187220
# The system-call numbers agree between the two --- measured, in the

0 commit comments

Comments
 (0)