Skip to content

Commit 8f0a57a

Browse files
committed
ci: note why the fresh clone needs no mtime sort
The mcpp side of this cross-validation had to sort by mtime — its target/ is restored from a cache and `find … | head -1` returned a binary an earlier push had left, with the right version string and the wrong code. Here $src is a fresh clone, so the plain form is correct; `-printf` is a GNU extension and one of the runners reaching this line is macOS.
1 parent d771780 commit 8f0a57a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ jobs:
116116
# above, which is exactly what removing the file leaves.
117117
rm -f "$src/.xlings.json"
118118
( cd "$src" && mcpp build --release )
119+
# ⭐ `$src` is a FRESH clone each run, so `target/` holds exactly what
120+
# this step just built and there is no earlier fingerprint directory
121+
# to pick by mistake. `-printf` would be the safer form on a cached
122+
# tree and is a GNU extension this must not use — one of the runners
123+
# that reaches this line is macOS.
119124
built=$(find "$src/target" -type f -name mcpp -perm -u+x | head -1)
120125
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
121126
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"
@@ -232,6 +237,11 @@ jobs:
232237
# above, which is exactly what removing the file leaves.
233238
rm -f "$src/.xlings.json"
234239
( cd "$src" && mcpp build --release )
240+
# ⭐ `$src` is a FRESH clone each run, so `target/` holds exactly what
241+
# this step just built and there is no earlier fingerprint directory
242+
# to pick by mistake. `-printf` would be the safer form on a cached
243+
# tree and is a GNU extension this must not use — one of the runners
244+
# that reaches this line is macOS.
235245
built=$(find "$src/target" -type f -name mcpp -perm -u+x | head -1)
236246
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
237247
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"

0 commit comments

Comments
 (0)