Skip to content

Commit 4b5df6e

Browse files
committed
probe: list every ninja candidate, and measure build.ninja against the cmd.exe 8191-char cap
1 parent 66f9fc7 commit 4b5df6e

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

.github/workflows/validate.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -379,19 +379,26 @@ jobs:
379379
vrc=0
380380
MCPP_VERBOSE=1 "$MCPP" test -p tests/examples/ffmpeg 2>&1 | tail -60 || vrc=$?
381381
echo "=== verbose retry exit status: $vrc ==="
382-
# Previous attempt was invalid: it used a RELATIVE ninja path and
383-
# then cd'd, so bash could not find it — "No such file or directory",
384-
# rc 127. Absolute paths only this time, and -C instead of cd. Also
385-
# dump what mcpp itself recorded (target/.build_cache holds outputDir
386-
# and the ninja program it intends to run).
387-
echo "=== mcpp build cache ==="
388-
cat tests/examples/ffmpeg/target/.build_cache 2>/dev/null || echo "(none)"
382+
# Third attempt. The two before this failed on my own path mistakes
383+
# (a relative ninja path, then looking under $HOME instead of the
384+
# extracted release, which is the registry mcpp actually uses). List
385+
# every candidate this time and require an absolute one.
386+
echo "=== ninja candidates ==="
387+
find "$PWD" "$HOME" -name 'ninja.exe' 2>/dev/null | head -5
388+
NJ=$(find "$PWD" "$HOME" -name 'ninja.exe' 2>/dev/null | head -1)
389389
BN=$(find "$PWD/tests/examples/ffmpeg/target" -maxdepth 3 -name build.ninja 2>/dev/null | head -1)
390-
NJ=$(find "$HOME/.mcpp/registry" -name 'ninja.exe' 2>/dev/null | head -1)
391390
echo "build.ninja: $BN"
392391
echo "ninja: $NJ"
393-
if [ -n "$NJ" ]; then "$NJ" --version || echo "(ninja --version failed rc=$?)"; fi
392+
# cmd.exe caps a command line at 8191 chars and ninja spawns through
393+
# it. ffmpeg is the only member big enough for that to bite, so
394+
# measure rather than assume.
395+
if [ -n "$BN" ]; then
396+
echo "=== build.ninja size / longest line ==="
397+
wc -c "$BN"
398+
awk '{ if (length($0) > m) { m = length($0); ml = NR } } END { print "longest line: " m " chars (line " ml ")" }' "$BN"
399+
fi
394400
if [ -n "$BN" ] && [ -n "$NJ" ]; then
401+
"$NJ" --version || echo "(ninja --version failed rc=$?)"
395402
nrc=0
396403
"$NJ" -C "$(dirname "$BN")" -j2 2>&1 | tail -40 || nrc=$?
397404
echo "=== manual ninja exit status: $nrc ==="

0 commit comments

Comments
 (0)