Skip to content

Commit ccaf9ee

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 bf6417b commit ccaf9ee

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
@@ -112,6 +112,11 @@ jobs:
112112
# above, which is exactly what removing the file leaves.
113113
rm -f "$src/.xlings.json"
114114
( cd "$src" && mcpp build --release )
115+
# ⭐ `$src` is a FRESH clone each run, so `target/` holds exactly what
116+
# this step just built and there is no earlier fingerprint directory
117+
# to pick by mistake. `-printf` would be the safer form on a cached
118+
# tree and is a GNU extension this must not use — one of the runners
119+
# that reaches this line is macOS.
115120
built=$(find "$src/target" -type f -name mcpp -perm -u+x | head -1)
116121
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
117122
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"
@@ -330,6 +335,11 @@ jobs:
330335
# above, which is exactly what removing the file leaves.
331336
rm -f "$src/.xlings.json"
332337
( cd "$src" && mcpp build --release )
338+
# ⭐ `$src` is a FRESH clone each run, so `target/` holds exactly what
339+
# this step just built and there is no earlier fingerprint directory
340+
# to pick by mistake. `-printf` would be the safer form on a cached
341+
# tree and is a GNU extension this must not use — one of the runners
342+
# that reaches this line is macOS.
333343
built=$(find "$src/target" -type f -name mcpp -perm -u+x | head -1)
334344
[ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; }
335345
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"

0 commit comments

Comments
 (0)