Skip to content

Commit 4264fe4

Browse files
committed
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 5fd1bcb commit 4264fe4

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

.github/workflows/openkal-compat.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,20 @@ jobs:
9898
9999
# The released engine above is the BOOTSTRAP when a ref is under
100100
# review: mcpp builds itself and there is no other compiler for it
101-
# here. The build replaces it on PATH, and MCPP_HOME follows, because
102-
# a PATH entry that does not win looks exactly like one that does
103-
# until something has been measured with the wrong engine.
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.
104115
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
105116
src="$RUNNER_TEMP/mcpp-src"
106117
git clone --quiet --depth 1 --branch "$MCPP_SOURCE_REF" \
@@ -115,10 +126,12 @@ jobs:
115126
built=$(find "$src/target" -type f -name mcpp | head -1)
116127
[ -n "$built" ] \
117128
|| { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
118-
bindir=$(cd "$(dirname "$built")" && pwd)
119-
echo "$bindir" >> "$GITHUB_PATH"
120-
echo "MCPP_HOME=$(dirname "$bindir")" >> "$GITHUB_ENV"
121-
echo "under review: $("$built" --version) (from $MCPP_SOURCE_REF)"
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)"
122135
fi
123136
124137
# The Windows cross headers of the host are installed deliberately. A

0 commit comments

Comments
 (0)