diff --git a/tools/stopgap/.gitattributes b/tools/stopgap/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/tools/stopgap/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/tools/stopgap/ygg-verify.sh b/tools/stopgap/ygg-verify.sh index 6a64ab6..0d4982e 100644 --- a/tools/stopgap/ygg-verify.sh +++ b/tools/stopgap/ygg-verify.sh @@ -72,7 +72,14 @@ esac # so every argument is quoted here. Without that, `a && b` in the command runs # b on the host. remote_args=$(printf '%q ' "$name" "$sha" "$image" "$cpus" "$mem" "$slots" "${KEEP:-0}" "$cmd") -ssh "${sshopts[@]}" "$host" "bash -s -- $remote_args" <<'REMOTE' +# The heredoc below travels with whatever line endings this file has on disk. +# On Windows that is CRLF, and the remote bash then fails on `set -euo pipefail ` +# BEFORE `set -e` is in force, so the script limps on and can exit 0 — a job that +# never ran, reported as success (seen 2026-09-23). `tr -d` strips the CRs on the +# far side before bash ever sees them. The sentinel below is the second guard: if +# the remote script dies early, no verdict line is printed and the local side +# refuses to report a status it did not receive. +(ssh "${sshopts[@]}" "$host" "tr -d ' ' | bash -s -- $remote_args" <<'REMOTE' set -euo pipefail name=$1 sha=$2 image=$3 cpus=$4 mem=$5 slots=$6 keep=$7 cmd=$8 root=~/eureka-verify @@ -111,5 +118,23 @@ sudo nice -n 10 docker run --rm --cpus="$cpus" --memory="$mem" \ status=$? set -e echo "ygg-verify: exit $status" >&2 +echo "__YGG_VERDICT__ $status" exit $status REMOTE +) | { + # The remote prints __YGG_VERDICT__ as its last line. Strip it from the + # output and exit with it. If it never arrives the remote script died before its + # own exit line, so refuse to report a status that was never produced. + verdict=97 + while IFS= read -r line; do + case "$line" in + "__YGG_VERDICT__ "*) verdict=${line#__YGG_VERDICT__ }; continue ;; + esac + printf '%s\n' "$line" + done + if [ "$verdict" = 97 ]; then + echo "ygg-verify: NO VERDICT from the remote job - treating as failure" >&2 + exit 97 + fi + exit "$verdict" +}