Skip to content

Commit c2545b2

Browse files
committed
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 5b67dca commit c2545b2

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,18 @@ jobs:
119119
# above, which is exactly what removing the file leaves.
120120
rm -f "$src/.xlings.json"
121121
( cd "$src" && mcpp build --release )
122-
# ⭐ `$src` is a FRESH clone each run, so `target/` holds exactly what
123-
# this step just built and there is no earlier fingerprint directory
124-
# to pick by mistake. `-printf` would be the safer form on a cached
125-
# tree and is a GNU extension this must not use — one of the runners
126-
# that reaches this line is macOS.
127-
built=$(find "$src/target" -type f -name mcpp -perm -u+x | head -1)
122+
# ⚠️ BOTH SPELLINGS, AND NO `-perm`. The matrix reaches Windows and
123+
# macOS runners too: on Windows the artefact is `mcpp.exe`, and
124+
# `-perm -u+x` is not a question that filesystem answers the way this
125+
# expects. Measured: `Finished release [optimized] in 173.44s`
126+
# followed by "mcpp did not build" — the build had succeeded and the
127+
# search was looking for the wrong name.
128+
#
129+
# `$src` is a FRESH clone each run, so `target/` holds exactly what
130+
# this step just built; `-printf` would be the safer form on a cached
131+
# tree and is a GNU extension this must not use.
132+
built=$(find "$src/target" -type f \
133+
\( -name mcpp -o -name mcpp.exe \) | head -1)
128134
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
129135
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"
130136
# ⚠️ Reported, because a PATH entry that does not win looks exactly

0 commit comments

Comments
 (0)